[Tutor] objects becoming pointers

Kent Johnson kent37 at tds.net
Thu Jul 16 04:23:34 CEST 2009

> chris Hynes wrote:
>> Ah, there you go, that's what I want to do, dynamically create variable
>> names. Then I could interactively create as many arrays as I want to, say
>> Chris1, Chris2, Chris3 and each of these would be different array with
>> different results.
>> But based on what you showed me I'm going to have to at least type:
>> print names["Chris"]
>> as opposed to just typing:
>> print Chris

I'm not sure you have really thought this through. The user typed
"Chris", and that value is stored in 'name'. It might just as well
have been "Bob" or "Kent". So you can't really say
  print Chris
you need something like
  print the_thing_called(name)
which you might as well spell as
  print values[name]


More information about the Tutor mailing list