Storing and Retrieving Point

Bijan Parsia bparsia at email.unc.edu
Thu Sep 27 20:35:30 UTC 2001


On Thu, 27 Sep 2001, Ken G. Brown wrote:

> I'm having trouble storing and retrieving Points. What am I doing wrong?

You're using a variable in a literal array. literal arrays only take
literal contents. So 'pt' is read as a symbol (i.e., it's not
dereferenced).

> pt _ Point new.
> pt _ 25 at 125. 
> dict _ Dictionary new.
> dict at: 'first' put: #('text' pt).

Replace this with:

  dict at: 'first' put: (Array with: 'text' with: pt).

> readPt _ ((dict at: 'first') at: 2). "readPt is now a Symbol"

Hope this helps.

Cheers,
Bijan Parsia.





More information about the Squeak-dev mailing list