[Openmcl-devel] same foreign object?
bhyde at pobox.com
Sat Jan 30 07:19:53 PST 2010
I could use a bit of critique here. No doubt I am confused on many
many different levels, but I think I need something like this.
(defmethod same-foreign-object ((a foreign-standard-object) (b foreign-
(flet ((raw-addr (x)
(let* ((p (%null-ptr)))
(%set-macptr-domain p 1)
(%setf-macptr p x)
(eq (raw-addr a) (raw-addr b))))
This came up because I wanted to toggle the IDE's menubar back and
forth between my App's menubar and the IDE's one. That lead to a
desire to squirrel away the current menubar. See that (slot-value
(slot-value *application* 'ccl::ui-object) 'ns:_main-menu)) boxes; so
eq tests don't work out. Diving into the objective c bridge leads to
finding that ns-object is based on foreign-standard-object. That raw-
addr code is entirely adhoc -- based on something I saw in the bridge.
More information about the Openmcl-devel