[Openmcl-devel] Sending Variable-Arity Cocoa Messages

Randall Beer beer at eecs.cwru.edu
Sun Apr 17 14:37:53 PDT 2005


I checked a fix for this into the bleeding edge CVS branch.  There was 
a problem with the way some variable arity message sends were being 
parsed.  Now something like the following works:

? (send (find-class 'ns:ns-array) :array-with-objects (:id #@"Hello" 
:id #@"There" :id (%null-ptr)))

#<NS-CF-ARRAY (Hello, There) (#x85414550)>

If you want to try this in your current OpenMCL version, just copy the 
new definitions of %PARSE-MESSAGE and CHECK-MESSAGE-ARG-COUNT from the 
bleeding edge ccl/examples/bridge.lisp to your local copy.

Randy


On Mar 2, 2005, at 1:24 PM, markus64 at gmx.ch wrote:

> Hi. I'm trying to send variable-arity Cocoa messages using OpenMCL 
> 0.14.2-p1 on OS X, but I just don't seem to succeed. I did read 
> section 10.3.3 of the manual, and the stringWithFormat example does 
> work, but I can't seem to get anything else to work :-)
>
> How would I, for example, create a NSArray using +arrayWithObjects? 
> (ccl::send (find-class 'ns:ns-array) :objects (:double-float foo 
> :double-float bar)) gives me "Undefined function :DOUBLE-FLOAT" 
> errors. Using (DEFINE-VARIABLE-ARITY-MESSAGE "arrayWithObjects:") 
> didn't help either (same error), although I would think that shouldn't 
> be necessary anyway, since the manual claims that "The standard 
> variable arity messages in Cocoa are predeclared by the bridge".
>
> I have the same problem when trying to send other variable-arity 
> messages from OpenMCL, e.g. NSDictionary's 
> +dictionaryWithObjectsAndKeys. How am I supposed to do this?
>
> Any help is appreciated,
>
> Regards, Markus
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>




More information about the Openmcl-devel mailing list