swarm-support
[Top][All Lists]
Advanced

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

Re: My code


From: Marcus G. Daniels
Subject: Re: My code
Date: 05 Jun 2001 11:35:53 -0600
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.7

>>>>> "KR" == Katherine Roberts <address@hidden> writes:

KR> Have the latest w32 dlls and jar files changed some of the simple
KR> raster methods such as "fillrectangleX0$Y0$X1$Y1(int x0, int y0,
KR> int x1, int y1, byte color)"? Some of my earlier simple
KR> simulations get "No match found for method" errors now, though
KR> they worked before...

A change in the last few months was to remove the return type of Using
phase methods, such as that one.

The problem with Object return for those Objective C Swarm methods is
that constantly associating the (useless) return values from the
native Objective C objects with their Java counterparts wastes
significant time and space.  It's also strange and confusing to Java users.

For common things like putting dots on a Raster, I found these
associations were often bottlenecks in profiles...  In models that
are Objective C only that cost doesn't exist, and for better or worse
it is common practice to have implicit object returns on methods.

The rule in the Swarm API is to have return values for Creating and
Setting phase methods, so that intermediate variables aren't needed to
make instances, e.g. you can send the result of one setter to the next
and createEnd to the last one, but most normal Using phase methods
won't have a return value unless there is a meaningful value to
return.

The fix is to drop the "return this" and make the return type void
when you've got a overridden method in a subclass for a such a method

                  ==================================
   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]