[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: injecting dynamic methods into a class

Martin DeMello

12/7/2005 11:52:00 AM

David A. Black <dblack@wobblini.net> wrote:
>
> Natural selection isn't connected to what we're talking about. If you
> mean we should ignore Matz, or find a way to coerce him into changing his
> terminology to match a bunch of Google searches -- while, meanwhile, a lot
> of newcomers to Ruby suffer because of how cool people think their names
> for singleton classes are -- then I don't think you've got a sound or
> respectful plan.

Note that the language itself doesn't call it *anything*. Indeed, there
isn't even an accessor for it, short of opening up its scope and
returning 'self'. So this is not equivalent to, say, suddenly deciding
to call Hashes Dictionaries instead - indeed, it's more a jargon issue
than a ruby-the-language one. Sort of akin to <=> coming to be called
the spaceship operator, or #! the shebang line.

martin
3 Answers

dblack

12/7/2005 1:29:00 PM

0

Martin DeMello

12/7/2005 8:11:00 PM

0

dblack@wobblini.net wrote:
> On Wed, 7 Dec 2005, Martin DeMello wrote:
>
> Not quite:
>
> ruby -ve 'class << 3; end'
> ruby 1.9.0 (2005-05-20) [i686-linux]
> -e:1: no singleton class for Fixnum (TypeError)

A very palpable hit :)

>
> :-) Also, with Matz discussing it so much, I'd put it in the category
> of having official-name status.
>
> But I know what you mean about jargon. Just as people call objects
> "underlying thingies" and so forth, there's no particular reason for
> people not to use a term like "own class" or "eigenclass" (or "class a
> soi", if they want to translate it into yet another language :-)
> descriptively. It's just that the burgeoning usage and positioning of
> some of these terms have been unfortunate, in relation to the process
> already underway.

But IMO this is the only real way to make sure that, when we do
standardise on a term, it's a good one.

martin

dblack

12/7/2005 8:30:00 PM

0