[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
just a question
Date: Thu, 3 Dec 87 11:05:13 -0200
From: Moshe Cohen <moco@wisdom.bitnet>
Why is it not possible to set an array element to the result of
the COMPILE function as in:
(SETF (AREF ARRAY-NAME 1) (COMPILE NIL #'(LAMBDA () 'F))) .
The following error message is received:
Trap: The argument given to the CAR instruction,
#<LEXICAL-CLOSURE (LAMBDA NIL #) 40303466>,
was not a locative, a list, or NIL.
It IS possible to do it with an auxiliary variable to hold the
result or by using what I understand as a NOOP:
(SETF (AREF ARRAY-NAME 1) (EVAL '(COMPILE NIL #'(LAMBDA () 'F))))
Moshe Cohen.
This is because the second argument to the COMPILE function is a lambda
expression (that is, a list starting with LAMBDA), not a function. The
following form works fine:
(SETF (AREF ARRAY-NAME 1) (COMPILE NIL '(LAMBDA () 'F)))