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

EVALHOOK and STORE



The interaction of EVALHOOK with the special way STORE
treats its first argument is still not quite right, which
causes STEP to blow up.  Let me first review the
fix that was made to EVALHOOK a year or so ago.

---------
When EVALHOOK was initially installed, evaluation
of the form

	(STORE (ARRAYCALL NIL A I) X)

caused the following sub-form to be
passed to the EVALHOOK function for evaluation:

	(ARRAYCALL NIL A I)

This of course caused an error because the relationship
between STORE and ARRAYCALL here is not really nested function
evaluation, but a special communication hack involving leaving
things in internal registers.

So, it was decided that the correct behavior of EVALHOOK
would be to treat STORE specially and pass only the forms "A" and "I" above to the
EVALHOOK function for evaluation.
----------

The related new problem which has come to my atttention now
is when a macro is used instead of ARRAYCALL above, such as
the following

	(DEFUN A MACRO (F)
		 (LIST 'ARRAYCALL NIL 'A (CADR F)))

Then calls to store look like:

	(STORE (A I) X)

In this case the sub-form 

	(A I)

is first passed to the EVALHOOK function for evaluation (which is correct,
since the macro has to get expanded).  The evaluation of this form
returns

	(ARRAYCALL NIL A I)

But at this point, the interpreter should recall that it is inside of
STORE and behave just as it did above, i.e. pass only "A" and "I" to
the EVALHOOK function for evaluation.  However, what is does now
is pass this whole form to be evaluated, which causes an error
for the reason explained above.

So I would appreciate if you would fix the interpreter so that it
watches out for this situation with STORE and does the right
thing.  I know this is a crock, but the root of the crock is
with STORE.

Thanks, Chuck Rich.

P.S. You might suggest the answer is to put code in STEP to treat
STORE specially, but this seems like the wrong modularity.
Furthermore, the current problem is really just an extension of the older
problem, which was solved by fixing EVALHOOK.