[Q] Newbie - Multiple Return Values
Ingo Hohmann
ingo at 2b1.de
Thu May 1 11:37:34 UTC 2003
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
|