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

Re: COMPILER-LET



I looked through your ideas about how to get around the use of
COMPILER-LET.  I think and hope that you'll admit that the use of
COMPILER-LET is spectacularly simple compared to your rewrites.  In fact
I had difficulty following them for a while.  Once again, if there is
more than one environment control that must be multiplex in the
expansion of VAL, I think you will have turned a trivial coding task
into one that is horrendous.

In re
	* Should the bindings made by COMPILER-LET be seen by any nested EVAL-WHENs?
	What should this piece of code do in each of the eval-when situations?

	(eval-when (eval compile load)
	(defvar *foo* "outside"))

	(compiler-let ((*foo* "inside"))
	(eval-when (eval compile load)
		(print *foo*)))

My opinion is that "outside" should always be printed.  By the way,
my answer to this is independent of the comments I make below --
its my answer given the current wisdom.  Your point about one
COMPILER-LET's initialization seeing another's is spot on--it should.

There is and has been massive confusion in the community about what
EVAL-WHEN and its arguments should mean.  A (long) while ago, JonL ask
me to write an article on macros for POINTERS, I haven't had the time.
However, when thinking it through, I, at least to my own satisfaction,
decided what all of these things should be.  I simply haven't had time
to write any of it up in a way that would be comprehensible to anyone
but me.  

Some points of interest were that the times were READ, COMPILE, LOAD,
and EXECUTE.  The model assumed that there would be three
transformations, in order, between these four times,  Further, the
EVAL-WHEN form could be meaningfully nested.  Note, to get things right,
EVAL had to mimick this behavior.  In other words something like
``digesting'' lambdas MUST (really must) be done by eval as its compile
pass.  When I said before that EVAL should compile, execute and mark for
GC, I had this in mind.

I don't think that COMPILER-LET is the real problem, it's thinks like
EVAL-WHEN and everybody getting used to lexical scoping.  I want to make
a bet -- those implementors that are having trouble with COMPILER-LET
are (1) having trouble with other scoping issues and (2) have compilers
and interpretors that are incompatible in other ways.  This is just a
bet, I don't know it for a fact.  If you do, let me know if I win or
lose.