From: Mathieu Bouchard Date: 2005-02-13T18:03:13+09:00 Subject: Re: Class of the Instance [was Re: Building a Better Functor] On Fri, 11 Feb 2005, Robert Klemme wrote: > "Martin DeMello" schrieb im Newsbeitrag > news:EWKOd.353888$8l.20776@pd7tw1no... > > Gavin Kistner wrote: > > > in a common library they re-use frequently? Is there an RCR (or has > > > there been discussion) about adding a simple method like that to the > > > language, so you can simply do: > > It's been discussed several times, but no one has come up with a good > > name for it yet. (I like proxy_class myself.) > I don't - I prefere singleton_class or instance_class. :-) It seems it's > about time that matz settles this once and forever by choosing a name and > adding a method to Object in the next release. The Module class already has an instance-method called "singleton_methods". I recall that at one point I was beginning to call a singleton class a s-class, a singleton-method a s-method, an instance method an i-method, an instance variable an i-var, especially because that kind of shortcut was being helpful in designing RubyAST (an internal format for ruby compilers i designed a few years ago). In retrospect i like calling them with those short names, because i think the long names are not that well-chosen, or that i think they are just too long :-/ The best/worst offender is: if you define a s-method on a class object x, and you make a class object y that inherits from x, then why the heck would it be callable from y _AND_ called "singleton", at the same time ? proxy_class is *not* a good name. it's already used for something else on a very related topic, in a way that could be confusing (although not that many people would complain). See chapter 19 of Pickaxe-2000. _____________________________________________________________________ Mathieu Bouchard -=- Montr�al QC Canada -=- http://artengine.ca/matju