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

New special form suggestion: LET-CONSTANT

Today I noticed myself creating DEFCONSTANTS for symbolic constants that
would only be used by the one function I was writing.  It struck me that
they really wanted to be local to the function, not top-level variables,
but I wanted to make sure that the compiler would open-code them, and I
also wanted to declare their constantness to readers.  There is
currently no way to do this in Common Lisp (nor, as far as I know, in
Symbolics Common Lisp, which I was using) without DEFCONSTANT, which
also creates a useless special variable.

It seems like a LET-CONSTANT special form, or an &CONSTANT lambda-list
keyword, would be the right thing for this.  LET-CONSTANT would be to
DEFPARAMETER what FLET is to DEFUN, and &CONSTANT would be analogous to

Actually, for consistency with the names FLET and MACROLET, I suppose
this should be called CONSTANTLET (although to me that seems like the
word for a little constant).  However, I never liked those names anyway.