Storing and Retrieving Point
raymondasselin at sympatico.ca
raymondasselin at sympatico.ca
Sat Sep 29 03:52:10 UTC 2001
Bob Arning <arning at charm.net> wrote:
> Ken,
>
> The literal array syntax "#()" only handles literals - symbols, strings, numbers, characters. Thus it interprets pt as #pt. Either
>
> dict at: 'first' put: {'text'. pt}.
>
> or
>
> dict at: 'first' put: (Array with: 'text' with: pt).
>
> will do what you want.
>
> Cheers,
> Bob
>
>
> On Thu, 27 Sep 2001 14:08:53 -0600 "Ken G. Brown" <kbrown at tnc.com> wrote:
> >I'm having trouble storing and retrieving Points. What am I doing wrong?
> >
> >pt _ Point new.
> >pt _ 25 at 125.
> >dict _ Dictionary new.
> >dict at: 'first' put: #('text' pt).
> >readPt _ ((dict at: 'first') at: 2). "readPt is now a Symbol"
Hi Bob can you explain a little bit the construct {'text'. pt} what is
the semantic of these accolades '{ }' I did'nt find them in the
Smalltalk books I get. What they means and for which uses were they
made? Same for the meaning of the '.' between 'text' and pt.
Raymond
More information about the Squeak-dev
mailing list
|