From: "ara.t.howard" Date: 2007-11-06T06:20:43+09:00 Subject: Re: Reading a class-file and calling it at runtime. On Nov 5, 2007, at 12:45 PM, Phrogz wrote: > For me personally, having someone write Module.const_get versus > Class.const_get implies that the former will only return a Module > instance, and the latter would only return a Class instance. By using > Object.const_get you are clearly stating that there is no guarantee as > to what type of object the supplied constant points to. > i prefer Object.const_get too, although for different reasons: it *should* be well known by ruby programmers that the 'top' context is the Object instances called 'main'. another approach, suitable for some limited situations is simply object = eval name, Binding::Top BEGIN{ Binding::Top = binding } which is less safe, of course, but works with effort for cases like object = eval 'File::Stat', Binding::Top which, for some reason, routinely confounds people on the list... 2 cts. a @ http://codeforpeople.com/ -- it is not enough to be compassionate. you must act. h.h. the 14th dalai lama