Le 10/02/2023 à 19:50, Brandon Hale a écrit :
Don't be confused by the various implementations of helloword in that project.  Look at the Makefile, only the lisp files are used when compiling with ecl.
One thing I am confused about with this are all of the #-(and) in generate.lisp. I know the #+ecl means only run this in ecl, but what do the #-(and)'s do?

It's a way to comment out a form.

#+ and #- read a boolean feature expression, and then it reads a s-expr and either ignore it or return it, depending on the value of the boolean feature expression.

feature expression are either symbols (read in the keyword package or qualified symbols), that are then tested for membership in the *features* list; or AND, OR or NOT feature expressions. In the case of AND and OR, if no subexpressions are present, then they evaluate to the neutral element, ie, for AND, true, and for OR nil.

So #-(and) means read the following expression only if true is false. Which is obviously false, so the following expression is ignored.

An equivalent form would be #+(or), which would mean to read the following expression only of nil is true. Which is false too.

Some people could use #+nil ignored but the problem with #+nil, is that :NIL could be in *features*, and there was once upon a time a lisp implementation named New Lisp Implementation and abbreviated as NIL...

--
__Pascal Bourguignon__


Reply via email to