Multiple Returns, was Re: Common Lisp style macros in Smalltalk?
demiourgos at smalltalk.org
demiourgos at smalltalk.org
Thu Jan 27 06:25:55 UTC 2000
On Tue, 18 January 2000, agree at carltonfields.com wrote:
>
> > I would think that creating a new class just to return multiple
> > objects is overkill unless the class is also needed to do something
> > more. What's the rationale for doing this rather than just returning
> > an array?
>
> Clarity. Recovering information from an array by indexing can be error-prone, requiring the user to remember what indexes correspond to what pieces of information, perhaps not discovering significant bugs until later in time. One does not need to look at the method code frequently, just to see what data has been returned. In most cases (apart from array constructors for example) it is also conceptually more meaningful to say one is returning a particularized aggregate as an abstraction than to return plural values.
[snip]
I've wondered about this "multiple return" thing in Smalltalk from
time to time. I understand that Smalltalk semantics have the sender
of a message block strictly until the reply is received.
But I have wondered from time to time -- not having deep process-based
experience in Smalltalk (applications instead) -- how one might go about
implementing coroutines or continuations in the manner of Scheme. Or
are these things too far out of the Smalltalk model?
--jtg
>
> Indeed, all objects and message sends can arguably be "overkill," as compared to nice modular coding in C using pointers to global data space, all without the vast overhead compared to straight C code. Likewise garbage collection, with its corresponding overhead.
>
[snip]
______________________________________________________
Jan Theodore Galkowski www.smalltalk.org/
http://www.scguild.com/usr/1707I.html
demiourgos at smalltalk.org www.marssociety.org/
**********************************************
PGP Key Fingerprint: 2757 F86D AA51 677D 38D7
964B 9A8D 7852 A494 3790
**********************************************
Get my Public Key from my home page at:
http://home.stny.rr.com/algebraist/
**********************************************
______________________________________________
Get free e-mail at http://www.britannica.com
More information about the Squeak-dev
mailing list
|