[Newbies] Re: Should all methods return a value?

Jeroen van Hilst jeroen at keizerrijk.net
Tue May 9 05:20:37 UTC 2006


Charles,

Im a beginner myself, but i think i know the answer to this one... ;)

As far as i know every method returns a value.
If you do not explicitly return a value ^self is returned.

BTW i love this list, and ive learned very much already from it.
Keep up the good work all!

    - Jeroen



"Charles D Hixson" <charleshixsn at earthlink.net> wrote in message
news:446025AD.1010407 at earthlink.net...
> I know that in some languages this matters, and in others it doesn't.
> E.g., in C if you return a value, the temporary must always be stored
> when the function is called, but in other languages it can be ignored,
> and in some languages if you don't intentionally return a value, the
> system will automatically create a value (usually nil) to return for you.
>
> Eiffel make a big deal about separating Commands from Queries, with very
> strict rules about which kinds of routines can do what kind of things.
>
> Presumably Squeak (and Smalltalk) is flexible here...but I haven't seen
> it documented anywhere.  (Also, can anyone recommend a good tutorial
> that isn't graphics based?  What I want to do right now is really more
> text oriented.)  I got the two Mark Guzdial books, but that doesn't
> really cover much in any depth.





More information about the Beginners mailing list