[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: NIL at MIT-MC
- Subject: CONSTANT declarations
- From: JONL at MIT-MC (Jon L White)
- Date: Sat, 11 Nov 78 18:21:00 GMT
- Cc: (BUG LISP) at MIT-MC, HIC at MIT-MC
- Original-date: 11 NOV 1978 1321-EST
One thing I would like for symbolic constants is the same flexibility
that one now has with SPECIAL declarations - namely, if done at top-level
of a "file", the declarations is in effect for all functions, but
if done within a LAMBDA or PROG (as a local declare) it has only
local effect. I would like to propose "CSETQ" instead of "CONSTANT"
and let CSETQ merely turn into SETQ in the interpreter; but the compiler
would notice top-level CSETQ's, and in addition to doing the SETting,
would put a CONSTANT (or CSETQ) property on the propterty list of the
symbol. But for local declarations, e.g.
((LAMBDA (A B N)
(DECLARE (SPECIAL A) (FIXNUM N) (CSETQ PI 3.14159))
(TIMES B (//$ (*$ 2.0 PI) 13.0) N))
'T (MUMBLIFY) 4)
then the PI would get "evalualted" out of the "//$", but N would
not be "folded" out. If the name "CSETQ" has bad connotations,
then how about other suggestions? Of course, the compiler would
signal as erroneous an attempt to lambda-bind a symbolic-constant.