From: matz@... (Yukihiro Matsumoto) Date: 2001-04-23T23:16:26+09:00 Subject: [ruby-talk:14078] Re: RCR: getClassFromString method Hi, In message "[ruby-talk:14040] RCR: getClassFromString method" on 01/04/23, Phil Tomson writes: |It would be nice to have a function that returns a class type given a |string that names that class. I realize that this is doable already in at |least a couple of different ways - you can use the each_object method in |ObjectSpace to iterate through all of the classes till you find the one |you need, or you can use const_get in Modules, (at least that's where I |think it is), but none of those ways is intuitive and easy to figure out |for newbies. You are right. None of them is intuitive and easy to fugure out. But think about this: Should this really be encouraged style of programming? Unlike C++ or Java, where Class is treated specially, classes in Ruby are plain objects, which may not need to be retrieved from name. I have to admit I'm not yet sure whether we need this feature or not. matz.