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

Handling of #, (load-time-eval)



Here are the possible alternatives for dealing with #,.  The first two
have already been written up in detail in the LOAD-TIME-EVAL issue
 from the cleanup committee.  I only have a paper copy of this issue;
could somebody (Dan?) who has an electronic copy please send it around
to the rest of us?

(1) (LOAD-TIME-EVAL:QUOTED-MAGIC-TOKEN) Define a function that returns
a magic token that can appear inside quoted structures to define a
load-time constant.

(2) (LOAD-TIME-EVAL:NEW-SPECIAL-FORM) Define a new special form that
causes its argument to be evaluated once at load time and the value
cached.  Calls to the special form would have to appear in a place
where they would be evaluated, and not inside quoted structure.  #, would
be changed incompatibly.

(3) Throw out #, entirely and do not provide any other similar
functionality.

(4) Simply clarify that #, must appear inside of quoted structure and
that it's really not the same as #. in interpreted code.

(5) Like (2), but somehow graft the new functionality onto EVAL-WHEN.

To summarize briefly the responses I got to my question about #,
usage, it appears that nearly all usages of #, could be replaced by
references to a variable initialized with DEFVAR or DEFCONSTANT.  The
people who responded appeared to be well aware of this, but liked #,
syntax better because they didn't have to think of a variable name,
and thought it might be somewhat more efficient.  As far as I can
tell, #, is almost never used at other than top-level in quoted
structure (that is, people use '#,(foo) but not '(... #',(foo) ...)).

What I would like to do is get some reactions to the various
alternatives so that I'll know which one(s) to pursue further.  I
personally would favor either (2) or (3), but if there isn't any
concensus arising on this issue I think we would have to write up (4)
as the fallback position.

Finally, a subissue I think we need to touch upon: Should the object
returned by evaluating the form indicated by #, be read-only?  I'd
argue that if we go with a proposal that restricts #, to appearing in
quoted structure, and if we accept that quoted structures are
read-only, we'd have to say Yes to this question as well.

-Sandra
-------