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

RESTART



ALAN's position on RESTART seems valid. It seems to me conceptually
right that a function begins at the time the jump is done to its code.
Any computation which is done after that time should be redone when you
do a restart of the function.

Although seemingly part of the bound variable list, optional and aux args
are really just shorthand for code that is conceptually part of the body.

After all, it would be useful to preserve the property that things like
 (DEFUN F (X &OPTIONAL (Y 3)) (LIST X Y))
can be re-written as
 (DEFUN F (X &REST G0001)
   (LET ((Y (IF (NOT (NULL G0001)) (CAR G0001) 3)))
     (LIST X Y)))
If you RESTART didn't re-execute the &optional inits, then you couldn't
do this re-write without doing a code analysis to verify that either
RESTART wasn't called or that the inits were constant with respect to
the preceding arguments.

Certainly people will expect &AUX things to be redone since they think
 (DEFUN F (X &AUX (Y (...X...)))
is the same as
 (DEFUN F (X) (LET ((Y ...X...)) ...)).
This re-write will also be unsafe without careful code analysis if at
least &aux variables at least are not re-run with a (RESTART F).