Object pointers
Chris Becker
chb99 at msn.com
Sat Mar 23 03:47:15 UTC 2002
Thank you Tim for putting it this way ... "the symbol *is* the referent" ...
I was hoping someone would say that, because that was *my* understanding
until I got into this mess!! And truth be told, I have always *hated*
pointers, which is one reason I *love* Smalltalk.
Basically, I'm trying to create relationships between objects using
Association. But I became alarmed today when I did the following:
assoc := Association new.
aKey := 'keystring'.
aValue := 'valuestring'.
assoc key: aKey value: aValue.
aValue := 'new value'.
assoc value ==> 'valuestring'
This made me think that the association was storing a *copy* of aValue in
its own instance.
Exactly what is going on in this situation?
(Hmm ... I think I just realized the answer to that question ... but I'd
love a nice technical description so I can erase all memory of C++ from my
mind.)
Thanks for your help,
Chris
-----Original Message-----
From: squeak-dev-admin at lists.squeakfoundation.org
[mailto:squeak-dev-admin at lists.squeakfoundation.org] On Behalf Of Tim
Rowledge
Sent: Friday, March 22, 2002 9:46 PM
To: squeak-dev at lists.squeakfoundation.org
Subject: Re: Object pointers
"Chris Becker" <chb99 at msn.com> is claimed by the authorities to have
written:
> Is there a way to store an object's *pointer* in a variable?
There's no such concept in Smalltalk. Sort of a world where the symbol _is_
the referent. SO much nicer that way!
tim
--
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- One bit short of a word.
More information about the Squeak-dev
mailing list
|