[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.

The second argument to the COMPILE function is a lambda-expression, not
a function.  You must give COMPILE a quoted lambda expression, which is
implicitly in the null lexical environment, not a closure.

It's essentially a bug that typing at top-level

  (compile nil #'(lambda () 'f))

is sometimes treated as synonymous with

  (compile nil '(lambda () 'f))

Only the latter is intended to work.