Re: #;



verec <verec@xxxxxxx> writes:

I have seen many examples using #+nil for this
purpose, but this precisely doesn't work for
incomplete expressions whereas:

Btw, NIL was the New Implementation of Lisp (a lisp implementation for
the VAX some years ago), and #+NIL actually did have an implementation
it was defined in. I don't recommend it for conditionals. #+(or) is
safer, though not terribly intelligible to everyone. #+ignore is something
I've seen enough people use that it's unlikely anyone would make :ignore
feature and expect it to work.

(defun foo (n)
(cond
#; treat this special case later

This previous line makes no sense since it is not code. Perhaps
you meant

#; ; treat this special case later.

#; ((= n 1)
#; (foo-1 n))

I'm not sure I totally see the point of this. I can see it makes the
lines easier to see visually on the left margin, but it's very hard to
mechanically check because if I write

#; (foo)
#; (bar)

the question arises: Is this a single commented-out form, in which case
it's ill-formed. Or is it two in a row? You still can't see the end of
it because the thing that appears as the "end" (the second line) is actually
the start/end of the next one.

Personally, I think prefer to just use this: #|| ... ||#

The use the innermost vertical bar pairs ------^.....^
does nothing for Lisp, and #|...|# would theoretically work the same.
But most Emacs editors see the #|| and the ||# as if you'd written
two independent no-character symbols using the || notation, and so they
syntax the part between the double-pairs as if they were not inside vertical
bars, so they will indent the code better in the "..." range. That makes code
coloring work better and makes code-hopping commands work better.

.



Relevant Pages

  • Re: Implementing custom containers in Lisp
    ... CMU Common Lisp 18b, running on shell.xxx.com ... distinguish between immediate values and handles to heap objects, ... *all* integers are in fact BIGNUMs or equivalent, immutable objects on ... NIL ...
    (comp.lang.lisp)
  • Re: Predicate for lexical bindings
    ... I assume you mean that you have started up an interactive Lisp ... lower level of parse, sees the word "let" which sees there already ... but there's no symbol by that name (in the current package) so ... so it puts NIL into the CDR of that same CONS cell to ...
    (comp.lang.lisp)
  • Re: Advice for a new lisper
    ... This is my first experience with lisp, ... (defun simplify-card (card) ... unless return nil) ...
    (comp.lang.lisp)
  • Re: can someone explain this quote by Tim Daly?
    ... What's so special about nil and in the context of being a Lisp? ... Language design based on ... nothing contrived about saying that language designers do, in fact, ...
    (comp.lang.lisp)
  • Re: Why forth is not popular
    ... >> it would be very surprising if a production-quality Lisp system ... > (cdr nil), for example. ... SEGV trap handler can be an issue again. ... Douglas Johnson, Trap Architectures for Lisp Systems, pages 79-86, ...
    (comp.lang.forth)