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

Re: the lexical environment for DEFTYPE, DEFINE-SETF-METHOD and



	Date: Mon, 12 Oct 87 11:56 EDT
	From: Ram@C.CS.CMU.EDU

	If I believed in your proposed semantics for DEFMACRO, then I would
	buy this argument, but I don't.  It seems to me to be a bizzarre
	suggestion that the semantics of an operation should depend on whether
	the environment is null or not.  I think that the only reason that
	anyone buys this at all is that Lisp compilers have traditionally
	magically special-cased forms that "appear at top-level", whatever
	that means.

	I think that there is a pretty convincing argument that the whole
	concept of a "top-level form" is inappropriate in a lexically scoped
	Lisp.  In my proposal for Common Lisp compilation (really evaluation)
	semantics, I define things in a way that is consistent with general
	usage, but makes no use of the concept "top level".

If I remember your proposal correctly (it's been a while since I read
it), you insist that the compiler ALWAYS be able to evaluate the body of
a DEFMACRO.  I claim that this is overly restrictive.  I can well
imagine wanting to use a lexical variable as an "own" variable for
maintaining state across expansions of a particular macro.  Such
variables might be used for allowing functionality like the :include
feature of DEFSTRUCT, for keeping statistics, etc.  Your semantics would
not allow this.

I have no trouble with requiring the compiler to notice macro
definitions and to make use of them when it can.  I also have no trouble
with there being a class of such definitions that cannot be made use of
at compilation time.

	Pavel