From: Eli Bendersky Date: 2006-05-13T00:20:52+09:00 Subject: Re: An inherent mismatch when creating dynamic classes >> This looks like a mismatch between two unrelated features (true, >> assigning to constants dynamically is fishy, but creating new classes >> isn't !), right ? > > I don't see the problem. How can unrelated features mismatch? Also: > Constant assignments are simply not allowed in method bodies. IMHO it's a mismatch because when I want to create a class dynamically in some method, I just want to give it a Name like any other class, beginning with an uppercase letter. But I can't, because it is considered a dynamic constant assignment. So I'm forced to name it against the Ruby convention (or use const_set) >>> c = Class.new > => # >>> c.name > => "" >>> Foo = c > => Foo >>> c.name > => "Foo" > > Classes do not have a proper name until assigned a constance. But > otherwise they are fully functional. No problem with that. If that's the only difference, it's OK I guess. -- Posted via http://www.ruby-forum.com/.