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

Re: draft of alternate proposal for EVAL-WHEN-NON-TOP-LEVEL



    Date: Tue, 7 Mar 89 12:37:07 MST
    From: sandra%defun@cs.utah.edu (Sandra J Loosemore)

    > Date: Tue, 7 Mar 89 13:30 EST
    > From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
    > 
    > Here is the criterion I prefer to use: a form is non-top-level if its
    > lexical environment cannot be fully constructed at compile time or if it
    > is not manifestly executed at load time exactly once.  In other words,
    > the form is enclosed in a variable binding, a block, a tagbody, a loop,
    > or a conditional.

    I would also add "in a FUNCTION special form", although it's unlikely
    that anybody would put one directly at top-level.  

I disagree.  The immediate "body" of a FUNCTION special form is not a form,
so the concept of "top level form" cannot be relevant to it.  The immediate
"body" might be a LAMBDA expression that has forms in its body, but those
inner forms are not manifestly executed exactly once.

						       Also, what about
    things like CATCH and UNWIND-PROTECT that alter the dynamic
    environment?

I'd say that these special forms do not manifestly execute their body
exactly once (because they imply throwing out of the middle of the
body), although I admit that there is a fine distinction here.

    As other people have noted before, it seems like we are arriving at a
    very complicated idea of "top-level" that has very little to do with
    people's intuitive notions on the subject.

I vehemently disagree.  My message was intended to arrive at a very simple
idea of "top-level" that corresponds exactly to intuitive notions.  I was
hoping that this very simple idea would immediately clarify any supposed
issues such as whether the body of a top-level LOCALLY is or is not top-level.

    It makes me wonder if
    perhaps we shouldn't retreat to a minimalist position where PROGN is
    the only special case.

Do we really have to rehearse all the arguments as to why that won't work
once again?