[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of .lisp Extension



> From: Ray Liere <lierer@python.CS.ORST.EDU>
> 
> I am using some provided Lisp source code as a starting point for
> a project, and all of the sources are named with the ".lisp" extension
> instead of the ".lsp" that clisp expects. Does anyone know of a relatively
> easy way to have clisp recognize ".lisp" as well as ".lsp" as legal?

I can't find any variable that contains the value of the expected
extension if none is given so I assume it is built in at compile time
to clisp.

An easy way to overcome this to me seems to be something like the
following:

(defun myload (file &key (extension "lisp"))
  (load (concatenate 'string file "." extension)))

then instead of going

(load file)

go

(myload file)

and you only need specify the extension when it's not .lisp.
Something a little more elaborate might be better if you want it fall
back on .lsp when there's no .lisp found, but I'm sure you can figure
that out ;-)

I hope that helps,

8<--------------------------->8

Richard Shepherd. 

(rls@therat.math.waikato.ac.nz)