[Q] Newbie - Multiple Return Values

Delbert Murphy dmurphy at infratecture.com
Thu May 1 12:10:02 UTC 2003


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 can 
tell, the only real overhead in creating another class, is the metal energy to 
keep track of it...

Delbert

---- 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 - the 
>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 might 
>be multiple message pending.
>
>- Using Exceptions for the an unsuccessful message would be misusing the 
>exception mechanism.
>
>- And overloading the returnvalue - either an 'this was an error' value 
>_or_ the payload does not particularly please me either.
>
>- Creating a new Class for this on the other hand seems to be quite an 
>overkill.
>
>What's the best SmallTalk way to handle this?
>
>
>Thanks,
>
>Ingo
>
>
>



More information about the Squeak-dev mailing list