[Openmcl-devel] @metaclass type definition

R. Matthew Emerson rme at clozure.com
Mon Apr 27 10:22:40 PDT 2009


Instead of (@class ns-mutable-array), you can just write ns:ns-mutable- 
array, e.g.,

(let* ((my-array (#/arrayWithCapacity: ns:ns-mutable-array 10)))
   (...))

See also:
http://clozure.com/pipermail/openmcl-devel/2009-March/009009.html

This needs to be fixed, obviously, but the @class thing is sort of  
obsolete usage, so nobody's really taken a look.  I will see about  
updating the example as soon as I can.


On Apr 27, 2009, at 12:31 PM, Paul Krueger wrote:

> I recently upgraded to: Clozure Common Lisp Version 1.3-r11966M   
> (DarwinPPC32).
>
> I'm trying to run through the NIB loading examples as described in  
> the file: ".../ccl/examples/cocoa/nib-loading/HOWTO.html". I did NOT  
> try these on any previous release. Part of one of the examples does  
> the following while in the ccl package:
>
> ? (setf *my-dict* (#/dictionaryWithObject:forKey: (@class ns-mutable- 
> dictionary) *my-app* #@"NSNibOwner"))
> When I do this I get the following:
> > Error: Unknown type specifier: (@METACLASS "NSMutableDictionary")
> > While executing: %%TYPEP, in process Listener(6).
> Investigating further I did:
> ? (macroexpand-1 '(@class ns-mutable-dictionary))
> (THE (@METACLASS "NSMutableDictionary") (%OBJC-CLASS-CLASSPTR  
> #S(OBJC-CLASS-DESCRIPTOR :NAME "NSMutableDictionary" :CLASSPTR  
> #<OBJC:OBJC-CLASS NS:NS-MUTABLE-DICTIONARY (#xA015289C)>)))
> T
> So clearly the class was found and it's the @METACLASS type  
> assertion that is causing the problem (just as the first error  
> message said). I just bypassed the type declaration and got the  
> example to work just fine.
> The @class macro seems to be used in several places, so I hunted all  
> over to see if I could discover how (@metaclass  ...) should have  
> been turned into a valid type specifier, but couldn't find it. The  
> closest I came was the function "get-objc-class-from-declaration"  
> which as near as I can tell is only called in one place that didn't  
> seem to be relevant to all the different ways that @class is used,  
> but maybe I missed something there.
> Can anyone clarify for me whether the example should have worked as  
> written and if so what might be wrong? How does the @class macro  
> defined in objc-runtime.lisp ever work?
>
> Thanks, Paul
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20090427/c22aa424/attachment.htm>


More information about the Openmcl-devel mailing list