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

Re: BUG -- NOT



>Sorry, I did not express what I wanted to. in general, when I try
>
>(mapcar '(lambda (x) (function x)) lis)
>where function is something like print or car, the compiler balks. However,
>it does take (mapcar 'function lis) as it should. ALso, this problem is not
>related to the first one with the sort as far as me coding them in the same
>file. Both problems accur several times in my code of about 200 functions.
>They werent a problem when I used them in a MCL version 1.3.2.
>
>ps, I realize that mapcar '(lambda (x) (print x)) lis) is silly when you
>can just write (mapcar 'print lis)

This is the result of an X3J13 cleanup issue. In 1.3.2 and Common Lisp
as specified by CLtL, (functionp '(lambda (x) ...)) was true. In 2.0 and
Common Lisp as specified by CLtL2, it is not. In MCL 2.0,
'(lambda (x) ...) is simply a form that evaluates to a list whose CAR
is LAMBDA. You need to pass it to COMPILE to turn it into a function
that can be passed to MAPCAR, APPLY, or FUNCALL. Usually, you make
this happen at file compile time by writing #'(lambda (x) ...).