From: "David A. Black" Date: 2004-09-29T07:31:29+09:00 Subject: Re: Best name for "this method" ? Hi -- On Wed, 29 Sep 2004, trans. (T. Onoma) wrote: > On Tuesday 28 September 2004 05:27 pm, David A. Black wrote: > > Hi -- > > > > On Wed, 29 Sep 2004, trans. (T. Onoma) wrote: > > > > And then I start to wonder why we can't just use the class name like a > > > method? > > > > > > Hash(:a=>1, :b=>2) > > > > You can define such methods; for example, there's Integer. A number > > of people (including me :-) aren't big fans of method names that begin > > with uppercase letters, but it can be done. > > Right. Well then, I must propose that all such class names be constructor > methods too. No sense in confusing things otherwise. By default: > > def AClass(*args, &blk) > AClass.new(*args, &blk) > end I'm not getting the point of that. Why do you need a wrapper like that around new? Also, the one somewhat common case of this -- Integer -- isn't a wrapper for new, since there is no Integer.new. So you'd be introducing a constraint that currently doesn't exist. > But for something like Hash, it would be defined like Hash[]. What is "something like Hash" in this context? I'm not following here. David -- David A. Black dblack@wobblini.net