[cmucl-ticket] [cmucl] #26: slto-value type check

cmucl cmucl-devel at common-lisp.net
Mon Dec 1 21:23:42 UTC 2008


#26: slto-value type check
--------------------+-------------------------------------------------------
 Reporter:  rtoy    |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  minor   |   Milestone:          
Component:  Core    |     Version:  2008-11 
 Keywords:  pcl     |  
--------------------+-------------------------------------------------------
 From cmucl-help, 2008-11-26
 {{{
 (defclass foo ()
   ((a :type fixnum)))

 (defvar *object* (make-instance 'foo))
 }}}

 This works, even though the assigned value is not a fixnum:
 {{{
 (setf (slot-value *object* 'a) 3.5)    ;; this works like a charm
 }}}

 but with
 {{{
 (defmethod setslot ((foo foo) val)
     (setf (slot-value foo 'a) val))
 }}}

 We have
 {{{
 (setslot *object* 3.5) ;; triggers a type error
 }}}

-- 
Ticket URL: <http://127.0.0.1:8000/cmucl/ticket/26>
cmucl <http://common-lisp.net/project/cmucl>
cmucl


More information about the cmucl-ticket mailing list