[Openmcl-devel] Core Animation demo

Gary Byers gb at clozure.com
Wed Jul 8 07:56:40 UTC 2009


Chapter 13 of the CCL manual describes features of the ObjC bridge that
for the most part have been supplanted by newer features.  Those older
things really should be deprecated; the only reason that they aren't
is that Chapter 13 refers to them.

At one point in the past, MAKE-OBJC-INSTANCE was a somewhat lispy way
to allocate and initialize and instance of an ObjC class; at the point
that it was first introduced, ObjC and CLOS weren't integrated (even)
well enough to allow MAKE-INSTANCE to be used with ObjC classes.  That
eventually changed, but for a while it was true that MAKE-INSTANCE did
something fairly expensive (I don't remember the exact details, but the
expensive operation had something to do with handling lisp slots and
it was performed even in cases where the class had no lisp slots) that
MAKE-OBJC-INSTANCE didn't try to handle, so there was an argument to
favor MAKE-OBJC-INSTANCE in most cases.  3 or 4 years ago, MAKE-INSTANCE
stopped doing that more expensive thing (whatever it was exactly ...) when
it didn't need to, and MAKE-OBJC-INSTANCE has been redundant since then.

I think that in practice OBJC:MAKE-OBJC-INSTANCE will probably be around
for a while: it's redundant and doesn't handle some things that MAKE-INSTANCE
does, but it does what it does reasonably well and there aren't any compelling
reasons to avoid using it.  (I'd say that it's probably clearer to use
MAKE-INSTANCE, but that position would be more defensible if the behavior
of MAKE-INSTANCE/ALLOCATE-INSTANCE/INITIALIZE-INSTANCE/SHARED-INITIALIZE
on ObjC classes was documented.)





On Tue, 7 Jul 2009, Neil Baylis wrote:

>
> On Jul 7, 2009, at 9:39 PM, Gary Byers wrote:
>
>>
>> OBJC:MAKE-OBJC-INSTANCE (or that there newfangled CL:MAKE-INSTANCE
>> thing,
>> which is entirely equivalent) is basically
>> (#/init (#/alloc class)) ; allocate an instance of class, call #/
>> init to initialize
>>                         ; that instance.
>
> So can I take it from this that there's never a reason to use the
> objc:make-objc-instance form? Is it deprecated?
>
> Neil (.. becoming more confused by the minute ..)
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list