[Openmcl-devel] patches, and a question

Randall Beer beer at eecs.cwru.edu
Wed Oct 6 22:08:36 UTC 2004


> Moral:
>
> - it's necessary to use MAKE-INSTANCE to create an NSObject that has
>   lisp slots.  As long as it can be used to instantiate any type of
>   NSObject (and I don't -think- it'll create empty slot-vectors for
>   "pure" ObjC objects), MAKE-OBJC-INSTANCE should probably be 
> deprecated.

I agree that MAKE-OBJC-INSTANCE should probably be deprecated.  It was 
designed to provide a MAKE-INSTANCE-like interface to ObjC object 
creation in the original Cocoa Bridge, before the CLOS/ObjC integration 
efforts had really begun.  The only thing it does that might still be 
useful is to also accept a string naming an ObjC class as it first 
argument (i.e., (MAKE-OBJC-INSTANCE "NSString" . . .) ), which is 
sometimes convenient.  However, this can also be done using 
(MAKE-INSTANCE (@CLASS "NSString") . . .)

BTW, this raises the issue that the CLOS/ObjC interface really isn't 
fully and consistently documented in any one place. While some aspects 
of CLOS/ObjC integration is documented in Section 9.2 of the online 
docs, the original Cocoa Bridge is only documented in the file 
“ccl:examples;CocoaBridgeDoc.txt".  Some of the CocoaBridge 
documentation is becoming obsolete, but some of it is important for 
understanding aspects of CLOS/ObjC integration (such as the way name 
translation works and the various SEND macros and functions, and 
SLET/SLET*). It would be good if someone (Dan?) could put these two 
sources if info together into a single document. I took a stab at this 
about 6 months ago, and I would be happy to share what I have with 
anyone brave enough to give it a try. It's a bit out of date now, but 
might serve as a good starting point.  I would also be happy to serve 
as a consultant, and I imagine Gary would as well.

Randy





More information about the Openmcl-devel mailing list