[Openmcl-devel] initarg for :foreign-type slot ignored
Paul Krueger
plkrueger at comcast.net
Fri Jan 18 08:54:09 PST 2013
Is this expected behavior or another oversight?
Welcome to Clozure Common Lisp Version 1.9-dev-r15567M-trunk (DarwinX8664)!
? (defclass test (ns:ns-object)
((s1 :foreign-type :id
:accessor s1
:initarg :s1)
(s2 :accessor s2
:initarg :s2))
(:metaclass ns:+ns-object))
#<OBJC:OBJC-CLASS TEST (#x26F695E0)>
? (setf obj (make-instance 'ns:ns-view))
#<NS-VIEW <NSView: 0x26f2a240> (#x26F2A240)>
? (setf t1 (make-instance 'test :s1 obj :s2 3))
#<TEST <Test: 0x237f36e0> (#x237F36E0)>
? (s1 t1)
#<A Null Foreign Pointer> <== initarg for :foreign-type slot ignored
? (s2 t1)
3
?
As before, I can create an initialize-instance :after method that takes the keyword value and explicitly sets
the slot value, so there is a work-around.
More information about the Openmcl-devel
mailing list