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

1k views Asked by At

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

2

There are 2 answers

1
ninjaknight On BEST ANSWER
  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")

0
Neo On

It is actually pretty easy to do.

  1. Open TextEdit.
  2. Write your code.
  3. Save it as text file or whatever.
  4. Go to Finder and find where you saved your file.
  5. Right click on the file.
  6. Tap to show information button.
  7. You will notice “Name and Extension” field.
  8. Change “.txt” with “.lisp” extension for your file.
  9. You are good to go!