[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lset not define
Date: Fri, 10 Jun 88 14:47:14 EDT
From: James J. Hunt <firstname.lastname@example.org>
Sorry, I want to write (lset foo) not (define foo). But are all these bind
forms (set, lset, define, define-constant, and define-integrable) really
necessary? For instance (define-constant alpha 60) could be replaced by
(define-integrable alpha 60).
SET is not a binding form, just as := is not a binding form in Algol.
It doesn't know a priori in what environment the assignment should
take place. PL/1 and Common Lisp assume some default environment
for assignments, but that seems unclean.
The other binding forms are the same except in how they declare the
use's confidence that the value won't change. LSET says the variable
can be freely mutated with SET; DEFINE says it won't be SET, but
may be redefined during debugging -- this allows optimizations
such as beta-reduction of
(let ((x global)) (unknown) x);
DEFINE-CONSTANT and DEFINE-INTEGRABLE both say that global beta-reduction
is permitted, and differ only in what they say about the advisability
it in the case that the value is a procedure.
In the best of possible languages this advisory information might be
provided by declarations, and these forms would be macros (actually this
change may have already been made?). Also in the case of DEFINE-INTEGRABLE,
the compiler, not the user, should be deciding whether integration is
a good idea, assuming it's to be permitted.