Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the convention for Lisp filename extension?

".el" is the convention for filename ending with Emacs Lisp programs. What is the convention when writing Common Lisp programs, please?

like image 508
yves Baumes Avatar asked Mar 03 '13 15:03

yves Baumes


People also ask

What is the file extension for Lisp?

Typically, AutoLISP source files are named with an . lsp file extension. The FAS(.


2 Answers

Common Lisp pathname types for source code:

  • lisp is the default. Use this if possible.
  • lsp if the pathname type allows only three characters
  • l if the pathname type should be one character (rare).

The pathname type cl is mostly not used. You can see it sometimes in older code or projects which use several different Lisp dialects.

For compiled code the pathname type can be computed in Common Lisp using the function COMPILE-FILE-PATHNAME (here 64bit LispWorks on a Mac):

CL-USER > (pathname-type (compile-file-pathname "foo.lisp")) "64xfasl" 
like image 45
Rainer Joswig Avatar answered Sep 20 '22 19:09

Rainer Joswig


Wikipedia and the Google Common Lisp Style guide both suggest .lisp.

Practical Common Lisp suggests .lisp or .cl.

Note, I'm not a Common Lisp programmer by any measure, so I have no idea if .lisp is actually used in practice.

like image 192
Matt Ball Avatar answered Sep 22 '22 19:09

Matt Ball