macosterminalclisp

How to create .lisp files and run them on mac?


As can be seen on the picture TextEdit on mac gives only limited options of file extensions in which I can safe a file. Lisp not included.

  1. Create .lisp files https://www.tutorialspoint.com/lisp/lisp_environment.htm is describing everything step by step, but it says TextEditor on Mac can save .lisp files, which I wasn't able to do.

  2. Load .lisp file (load "filename.lisp") leads to error: file with such name doesn't exist


Solution

    1. TextEditor on mac has limitations to how file can be saved (.txt, etc.). You can use any other editor, ex: TextWrangler, which allow you to write file extension. Or you can use editors specific for lisp, ex: Emacs (more massive)

    2. It's possible that when you type (load "filename.lisp") it searches in some specific directory, where it's not present. So, to avoid this, you should type full path to the file you want to open. Ex: (load "/Users/macbook/Desktop/foldername/filename.lisp")