swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: return type for a method parameter & assigning probe buttons


From: William S. Shu
Subject: Re: return type for a method parameter & assigning probe buttons
Date: Tue, 07 Sep 1999 20:36:39 +0100

Thanks for the insight, Marcus

William.

"Marcus G. Daniels" wrote:

> >>>>> "WS" == William S Shu <address@hidden> writes:
>
> WS> Problem 1: Objective-C) How can one pass a method as an argument
> WS> as well as the type of its return value?
> [ ... deleted..]Generic return typing is hairy problem.  If you really want to
> be
> able to return generic types you need to use GCC builtins and the
> performv: method.  Something like this:
>
> - (double)call: (SEL)sel
> {
>   __builtin_return ([self performv: sel : __builtin_apply_args ()]);
> }
>
> Unfortunately the __builtin_{return/apply_args} are deprecated in GCC
> and actually fail on some platforms (e.g. Sparc).  (For Java things,
> we take care of argument frame packing and unpacking by hand, using platform
> specific code.)
> [... deleted ...]
>
> WS>        val += [obj valueOf]    <====== **** return type assumed to be id
>
> This is actually invalid syntax.  You'd have to say [obj perform: valueOf].

sorry: retyped code at that level.

> WS>     How do I get to probe both objects (in fact any object) on the
> WS> raster by using the same mouse button.
>
> WS>  [worldRaster setButton: ButtonRight   // use Right button
> WS>               Client: personDisplay
> WS>               Message: M(makeProbeAtX:Y:)];
>
> Send a different message, one that has the effect of calling
> makeProbeAtX:Y: twice.


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]