[Newbies] Re: Re: perform withArguments

Dawson abu_joseph at yahoo.com
Tue Apr 24 18:24:38 UTC 2012


Hi Louis,

thanks for your very helpful posts, particularly the most recent one ...

On 24/04/12 6:49 PM, Louis LaBrunda wrote:
> Hi Dawson and Dawson's 15 year old son,
> 
>>From your code below, I assume that somewhere in your program you have
> created (instantiated) nine cells in instance variables named cell1-cell9.

Yes, you are right .. these are instantiations of a class (more info in
my other reply to Randal)
> This is fine but you should realize that they (cell1-cell9) are variables
> that hold pointers to the objects and not really the objects themselves. It
> is okay to think of them as the objects because for the most part it is

Yes, I was using inexact language here (back to everything is an object
... are pointers in Squeak considered objects then? or is this a case of
something that isn't an object in Squeak?)
> easier than thinking of them as pointers to objects.  The real point is to
> realize that more than one variable can point to the same instance of an
> object.  For example, if I were to write:
> 
> cell10 := cell1.
> 
Point taken.

SNIP

> Back to your program.  I assume that you have a good reason for putting the
> cells in variables named (cell1-cell9) and again that is fine but there is
> no reason why you can't have the same objects addressable or accessible
> from a collection.
> 
Yeah .. I suppose with very little context it looks like we haven't got
a clue what we are doing. (Maybe we don't, but what we've written so far
works even if there is a bit of brute force kind of stuff in there). To
be honest, it is why we started asking questions, as a trained engineer,
and as an artist, I like elegant solutions, perhaps that is what drew me
to Squeak after my son began enquiring if we could learn it together.
But our program right now is certainly not very elegant yet. As we learn
more we can tweak it though.
> Smalltalk's collection classes are one of its many unknown treasures.  They
> are a big part of why Smalltalk code is shorter and more understandable
> than code of other languages.  Check them out.  And please keep asking
> questions.

Excellent. We have read the "Squeak by Example" book, but we don't
always know how to use the stuff we've read about even after following
the examples. We figured after we wrote this program, that we'd re-read
the book, and get more out of it the next time through.

Thanks again for taking the time to write your advice and suggestions,
we appreciate it.

Dawson


More information about the Beginners mailing list