From: ara.t.howard@... Date: 2006-01-13T00:06:39+09:00 Subject: Re: how can I give a name to an anonymous class On Thu, 12 Jan 2006, David Vallner wrote: > On Thu, 12 Jan 2006 14:15:38 +0100, Christian Neukirchen > wrote: > >> David Vallner writes: >> >>> Christian Neukirchen wrote: >>> >>>> gwtmp01@mac.com writes: >>>> >>>> Object.const_set(className.to_s, genClass) >>>> >>>> I think we should have "useless use of #{}"-awards. ;-) >>>> >>>> >>>> >>> And useless #to_s awards. If anything, #to_str is somewhat useful to >>> get a type check, but coercing types with reckless abandon you'll >>> shoot yourself in the foot when you least expect it. >> >> ...except Symbol doesn't have #to_str. >> > > Oh, joy. Not like that matters in this specific case, but I can well imagine > that use. I guess it's time to dig out the metaprogramming helmets to prevent > severe trauma when banging heads against walls. it's why i __always__ use "#{ obj }" # no useless after all instead of obj.to_s or obj.to_str. it works - forget about it. same goes for [ obj ].flatten when a list is needed. -a -- strong and healthy, who thinks of sickness until it strikes like lightning? preoccupied with the world, who thinks of death, until it arrives like thunder? -- milarepa