[Q] Newbie - Multiple Return Values
ducasse at iam.unibe.ch
Thu May 1 20:43:26 UTC 2003
This is a really good advice. If you download the ESUG CD there are
article of Erwing
Juanita and she presents exactly this solution to this problem.
> Just my 2 cents...
> It's rarely overkill to create new class, like NetworkRequestResult.
> It could contain a status and any accompanying messages. As far as I
> tell, the only real overhead in creating another class, is the metal
> energy to
> keep track of it...
> ---- Original message ----
>> Date: Thu, 01 May 2003 13:37:34 +0200
>> From: Ingo Hohmann <ingo at 2b1.de>
>> Subject: [Q] Newbie - Multiple Return Values
>> To: The general-purpose Squeak developers list <squeak-
> dev at lists.squeakfoundation.org>
>> Hi to all again,
>> for a network protocol I want to return to values from a function -
>> payload of a message, and wether the message was tagged as being
>> successful or not.
>> What would be the best way to return those values?
>> - I thought about an instance variable for one of these, but there
>> be multiple message pending.
>> - Using Exceptions for the an unsuccessful message would be misusing
>> exception mechanism.
>> - And overloading the returnvalue - either an 'this was an error'
>> _or_ the payload does not particularly please me either.
>> - Creating a new Class for this on the other hand seems to be quite an
>> What's the best SmallTalk way to handle this?
Prof. Dr. Stéphane DUCASSE
"if you knew today was your last day on earth, what would you do
different? ... especially if,
by doing something different, today might not be your last day on
"The best way to predict the future is to invent it..." Alan Kay.
Open Source Smalltalks: http://www.squeak.org,
Free books for Universities at
Free Online Book at
More information about the Squeak-dev