From: Douglas K. <do...@go...> - 2013-10-13 16:16:48
|
This COMPILE operation should have no effect (assuming *evaluator-mode* = :interpret). Its effect should not be to crash. However the defaulting form for COMPILE's second argument is (or (macro-function name) (fdefinition name)) where macro-function is only defined on symbols. * (defun (setf trythis) (new sym) (setf (get sym :something) new)) * (compile '(setf trythis)) debugger invoked on a TYPE-ERROR in thread #<THREAD "main thread" RUNNING {1002ACB573}>: The value (SETF TRYTHIS) is not of type SYMBOL. CLHS says: *compile* *name &optional definition* => *function, warnings-p, failure-p* *Arguments and Values:* *name*---a *function name*<http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#function_name>, or *nil*<http://www.lispworks.com/documentation/HyperSpec/Body/a_nil.htm#nil> . *macro-function* *symbol &optional environment* => *function* * * *function name* *n.* 1. (in an *environment*<http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#environment>) A *symbol*<http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#symbol> or a *list*<http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_l.htm#list> (setf *symbol*) that is the *name*<http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_n.htm#name> of a *function*<http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#function> in that *environment*<http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#environment>. 2. A *symbol*<http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#symbol> or a *list*<http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_l.htm#list> (setf *symbol*). |