[Openmcl-devel] (symbol-function function-name) no error signaled

Frank some.frank at gmail.com
Tue Jan 11 12:38:09 PST 2011


Well I'm kinda new to LISP but I corrected the code example and put the 
SAFETY in place.

(defparameter *store* nil)

(defun (setf store) (newval)
  (setf *store* newval))

(defun foo ()
  (declare (optimize safety))
  (symbol-function '(setf store)))

(foo)  ; No error signaled!

There's still no error signaled so I assume this is a bug;  If you guys 
agree I will report this.

Thanks
#:Frank

> On Jan 11, 2011, at 14:54, Frank wrote:
>
>> Hello,
>> Just stumbled over this while I was reading the HS.  Shouldn't  
>> symbol-function signal an error if it's argument doesn't evaluate to  
>> a symbol?
>>
>> (defparameter *store* nil)
>>
>> (defun (setf store) (newval)
>> (setf *store* newval))
>>
>> (symbol-function '(setf store))  ; Shouldn't this signal an error?
>
>
>
> symbol-function "Should signal an error of type type-error if symbol  
> is not a symbol."
>
> 1.4.2 Error Terminology:
>
>> An error should be signaled
>>
>> This means that an error is signaled in safe code, and an error  
>> might be signaled in unsafe code. Conforming code may rely on the  
>> fact that the error is signaled in safe code. Every implementation  
>> is required to detect the error at least in safe code. When the  
>> error is not signaled, the ``consequences are undefined'' (see  
>> below). For example, ``+ should signal an error oftype type-error if  
>> any argument is not of type number.''
>
>
> To have safe code, you must have declared (optimize safety) at the  
> call site. If OpenMCL does not then signal an error then there is a bug.
>




More information about the Openmcl-devel mailing list