[Top][All Lists]

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

RE: [PATCH] Fix (letrec ((ignore)))

From: Drew Adams
Subject: RE: [PATCH] Fix (letrec ((ignore)))
Date: Sun, 13 Dec 2015 09:41:44 -0800 (PST)

>    (let ((foo) ... ) ...)
> is accepted by the interpreter and byte compiler, binding foo to nil.
> Should we make that form invalid, too?

Of course not.  It is helpful to a (human) reader to distinguish
the use of a `(foo  nil)' let-binding from a `(foo)' let-binding.

Some coders use the convention that showing the nil initial
value explicitly indicates that this is the initialization,
whereas `(foo)' indicates that the `let' body will perform
the (real, significant) initialization.

>From "Common Lisp, The Language", section Establishing New
Variable Bindings:

"Instead of a list (varj valuej), one may write simply varj.
In this case varj is initialized to nil.  As a matter of style,
it is recommended that varj be written only when that variable
will be stored into (such as by setq) before its first use.
If it is important that the initial value be nil rather than
some undefined value, then it is clearer to write out (varj nil)
if the initial value is intended to mean ``false,'' or
(varj '()) if the initial value is intended to be an empty list."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]