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

PROGV mystery explained



Thanks, everybody, for your suggestions, and pointing out that
PROGV doesn't in fact declare anything, and since MCL EVAL runs
everything through COMPILE, of course I get an undeclared free
variable message.  My previous implementations (in UCI Lisp,
Franz, Interlisp-D, Franz Allegro CL) never griped about this
point in this and similar code, since apparently they just
interpreted the form to an EVAL, and the variables in question
were bound at the time.  I guess its like your income tax; just
because you didn't get caught doesn't mean you did it right.

Kim's suggestion to do

    (PROGV SYMBOL-LIST VALUE-LIST
      ...
      (DOLIST (ACTION ACTION-LIST)
        ...   (EVAL `(locally (declare (special ,@symbol-list)) ,ACTION))

works and provides exactly what I had in mind, since declaring
the variables globally special is not my intent. Moreover, it
works fine in my old Franz Allegro CL, which it should.

Kim, your mention that EVAL does COMPILE by default prompts me to
ask about the performance implications.  How much, relatively &
intuitively, am I paying for this?   Would I be better off to
arrange it so that compile is not the default on EVAL?  If so,
what is the switch for it? Is this the same control as for the
toplevel READ-EVAL loop?