grabbing value of a variabe by its name?
Jecel Assumpcao Jr
jecel at merlintec.com
Thu Jul 25 15:05:19 UTC 2002
I think what Ragnar is looking for is "deep reflective magic"...
Something like
| foo bar fooValue |
foo _ 'hello'.
bar _ 'world'.
fooValue _ thisContext tempAt: (thisContext tempNames find: 'foo').
^ fooValue
Is this it?
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.
-- Jecel
More information about the Squeak-dev
mailing list
|