grabbing value of a variabe by its name?
Ragnar Hojland Espinosa
ragnar at linalco.com
Thu Jul 25 15:33:50 UTC 2002
On Thu, Jul 25, 2002 at 12:05:19PM -0300, Jecel Assumpcao Jr wrote:
> I think what Ragnar is looking for is "deep reflective magic"...
Nice name..
> Something like
>
> | foo bar fooValue |
> foo _ 'hello'.
> bar _ 'world'.
> fooValue _ thisContext tempAt: (thisContext tempNames find: 'foo').
> ^ fooValue
>
> Is this it?
Exactly! This is it. Now to figure out how this works :)
> Some languages (Perl, I think, and Logo I am sure) have a trivial
> notation for this kind of thing. But that isn't always a good idea and
> I am glad that Smalltalk makes such a dangerous thing possible yet
> hidden where it is unlikely to be accidently abused.
perl, php and tcl, of the ones I know.
--
Ragnar Hojland - Project Manager
Linalco "Especialistas Linux y en Software Libre"
Tel: +34-91-5970074 Fax: +34-91-5970083
More information about the Squeak-dev
mailing list
|