Injecting dynamic methods into a class

Hi --

-- 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.

Plan? I'm just being realistic.

Absolutely. As I said in my second or so post about this, the ship
has sailed; it's obvious that, for whatever reason, singleton classes
*are* going to be called all sorts of different things. I just think
it's too bad.

I've been close to a few ill-fated open source projects where the
prevailing attitude was that insisting on anything different from what
the project founder specifies is disrespectful and destructive. That
attitude was deadly.

Again (last time?), I'm not saying that nothing should change -- just
that short-circuiting the discussion/decision process (which does
exist, and which has a track-record of working well for Ruby) is
short-sighted.

I could, for example, set up a web page that described Ruby as an
"item-oriented" language: everything is an "item", the class Object is
misnamed but Matz hasn't stepped in to correct so I have to, etc. I
could probably manage to confuse a few newcomers. But it wouldn't be
good. (It's a hyperbolic example, but still.)

I've also been involved with a few projects (and cofounded one --
Inkscape) which were wildly successful, growing organically and
developing broad communities. People were free to do their own thing,
and yet the project leaders were more respected. Sometimes things do
get messy and confusing, but in my experience, even those messy and
confusing things work out in the end.

[ I'll leave it to others to decide which description better fits
Ruby. ]

I don't think it's necessary to pigeon-hole Ruby philosophically. I
just wish people would let Matz decide what these classes should be
called. (And remember that Matz's style of deciding *includes*
community input; by looking to Matz, I am not subscribing to some
philosophy of centralized power [believe me :-].) It's really a
rather circumscribed point.

It's worth noting that a result of Matz's style of development, as
well as the contributions of the community, there actually aren't very
many things in the language that are vulnerable to this kind of
treatment. Singleton classes seem to be the magnet for it.

I'm not a Taoist, but I think the notion of "striving-without-striving"
describes the necessary ethic nicely. Relax. This is not about control
or respect or disrespect or the Ultimate Fate of Ruby.

Right -- it's about what to call singleton classes, and I wish people
would discuss it and then let Matz decide. Maybe he'll decide that
the best thing is arbitrarily many terms, and then lots of people will
be a little bit happy :slight_smile:

David

···

On Wed, 7 Dec 2005, MenTaLguY wrote:

On Wed, 2005-12-07 at 06:32 +0900, David A. Black wrote:

--
David A. Black
dblack@wobblini.net

"Ruby for Rails", forthcoming from Manning Publications, April 2006!

Hi --

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'.

I think that might change, though (I hope), once a long-term decision
is reached about the name and for that matter the implementation (if
it changes).

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.

Not quite:

   ruby -ve 'class << 3; end'
   ruby 1.9.0 (2005-05-20) [i686-linux]
   -e:1: no singleton class for Fixnum (TypeError)

:slight_smile: 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 :slight_smile:
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.

David

···

On Wed, 7 Dec 2005, Martin DeMello wrote:

David A. Black <dblack@wobblini.net> wrote:

--
David A. Black
dblack@wobblini.net

"Ruby for Rails", forthcoming from Manning Publications, April 2006!

I don't think it's necessary to pigeon-hole Ruby philosophically.

I mainly intended to raise the question of whether bringing social
obligation into the discussion that way was really appropriate. It
tends to be poisonous in technical forums.

It's worth noting that a result of Matz's style of development, as
well as the contributions of the community, there actually aren't very
many things in the language that are vulnerable to this kind of
treatment. Singleton classes seem to be the magnet for it.

There are two reasons for this: one, the name is one of the few aspects
of Ruby which people are fairly consistently unhappy with, and secondly,
it's an issue of human linguistics rather than of the programming
language.

I think we should expect an issue of human language to be resolved in
the fashion natural to it, rather than the more "up-front" and
centralized fashion typical for programming language issues.

(Of course, as noted elsewhere, I am a staunch linguistic descriptivist.
So perhaps that colors my thinking.)

> I'm not a Taoist, but I think the notion of "striving-without-striving"
> describes the necessary ethic nicely. Relax. This is not about control
> or respect or disrespect or the Ultimate Fate of Ruby.

Right -- it's about what to call singleton classes, and I wish people
would discuss it and then let Matz decide.

I think that's what people are doing, basically. That discussion is
simply going to be accomplished a bit differently than it would be for a
feature of the programming language itself. The negotiation of new
human vocabulary involves trying alternatives in the real world and
seeing what sticks.

Based on Matz's most recent post, it sounds like that's what he's
waiting for too.

-mental

···

On Wed, 2005-12-07 at 14:23 +0900, dblack@wobblini.net wrote:

dblack@wobblini.net 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 :slight_smile:

:slight_smile: 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 :slight_smile:
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

···

On Wed, 7 Dec 2005, Martin DeMello wrote:

Here we go again with the endless discussion threads. I guess most of
you know my feelings on these threads based on a post not too long
ago, but I can't help but be sucked into this one too.

Firstly, in general I agree with David that we are on a slippery slope
with everyone using their own favorite singleton class synonym. For
that matter I'll bring my own favorite, shadow class, back into the
fray and muddy the waters more. All these terms will definitely
confuse newcomers and possibly even old hats, and it is sort of
annoying having to "translate" all the time.

But at the same time, I'm not sure how else these terms can be tested
out without actually using them. It seems Matz is sort of just waiting
and seeing what happens, which isn't a bad philosophy, but can
certainly result in some impatience and certain people trying to
impose their own standards on other people.

So with that wishy-washy essay out of the way, let me conclude with
some advice for Trans: I'm not sure if you realize it, but at least
Ruby traitor, trying to subvert it from within. I would say "rebel",
but I don't think that conveys enough negativity. Every week it seems
like there is some thread spawned by you discussing the merits of some
massive change to Ruby. While in general this may not be a bad thing,
with the frequency I see it I can't help but automatically dismiss
much of what you say. Even a lot of the good work you have done on
Facets or Nano or Mega or Calibre or whatever it is called can be
dismissed because of the name changes and disorganization I've just
indicated. As harsh as this paragraph is, I don't mean it as a "screw
you Trans" type of thing, just an indication that is how at least one
person percieves you, and for most people, perception is reality.

Ryan

···

from my perspective (and I'm sure others), I see you as some kind of

Hi --

Right -- it's about what to call singleton classes, and I wish people
would discuss it and then let Matz decide.

I think that's what people are doing, basically. That discussion is
simply going to be accomplished a bit differently than it would be for a
feature of the programming language itself. The negotiation of new
human vocabulary involves trying alternatives in the real world and
seeing what sticks.

Can't we just look at this as what it is, instead of finding a huge,
trans-historical thing that tells us what it "should" be? Let's just
let Matz decide. Sorry to be so pedestrian :slight_smile:

Based on Matz's most recent post, it sounds like that's what he's
waiting for too.

I interpreted it differently; he said, as I read it, that he's
sticking with singleton class for now. But as I've said, this is a
done deal: people are going to use a bunch of different terms, no
matter who says what at this point.

David

···

On Thu, 8 Dec 2005, MenTaLguY wrote:

--
David A. Black
dblack@wobblini.net

"Ruby for Rails", forthcoming from Manning Publications, April 2006!

Hi --

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 :slight_smile:

:slight_smile: 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 :slight_smile:
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.

Or at least a frequently-used one :slight_smile: I know it's possible to discuss
something to death, and it's possible that this has happened with
singleton-class renaming already. But consider that someone just
coming across a reference to "Ruby's eigenclasses" (or whatever) isn't
even going to know that there's any history, discussion, uncertainty
-- basically, isn't going to know that there's any reason to think
about whether the term is or is not a good one. They'll just accept
the term and start propagating it -- which, therefore, doesn't count
as a "vote", so to speak.

Also, the standard that's really emerging is the standard practice of
calling singleton classes by many different names. Maybe we should
just embrace this. It might lead to more publicity than choosing one
name :slight_smile:

David

···

On Thu, 8 Dec 2005, Martin DeMello wrote:

dblack@wobblini.net wrote:

On Wed, 7 Dec 2005, Martin DeMello wrote:

--
David A. Black
dblack@wobblini.net

"Ruby for Rails", forthcoming from Manning Publications, April 2006!

A Ruby TRAITOR? Because I offer up opinions, options and interesting
new ideas that arn't status quo?

Ah forget it. It aint worth it any more. You win Ryan. I repent.

  Adhoc
  Module method inheritance
  Core versioning support
  AOP Cuts
  Using core for tech discussions
  Perfecting the organization of Facets/Calibre
  Yes, the list goes on....

But all terrible terrible things! How evil I am for even mentioning
them, let alone actually trying to do them. Ugh, what a turncoat I have
been, an enemy of the Ruby state! Down witht he evil trans. Kill him.
KILL HIM!!!

You just made a case for sticking to "singleton class". :-)) I for my part stick with the old fashioned but well established term. My 0.02EUR...

Kind regards

    robert

···

Ryan Leavengood <leavengood@gmail.com> wrote:

Firstly, in general I agree with David that we are on a slippery slope
with everyone using their own favorite singleton class synonym. For
that matter I'll bring my own favorite, shadow class, back into the
fray and muddy the waters more. All these terms will definitely
confuse newcomers and possibly even old hats, and it is sort of
annoying having to "translate" all the time.

ROFL. OK maybe traitor was a bit too dramatic. But this response was
worth it. :wink:

Let's just try to find the middle ground between generally useful Ruby
changes and changes just because someone thinks they are cool.

Just so you know since I've been so "anti-Trans" in the past I plan to
look over Calibre and write about some of the gems (pun-intended) in
there.

Ryan

···

On 12/7/05, Trans <transfire@gmail.com> wrote:

A Ruby TRAITOR? Because I offer up opinions, options and interesting
new ideas that arn't status quo?

Ah forget it. It aint worth it any more. You win Ryan. I repent.

  Adhoc
  Module method inheritance
  Core versioning support
  AOP Cuts
  Using core for tech discussions
  Perfecting the organization of Facets/Calibre
  Yes, the list goes on....

But all terrible terrible things! How evil I am for even mentioning
them, let alone actually trying to do them. Ugh, what a turncoat I have
been, an enemy of the Ruby state! Down witht he evil trans. Kill him.
KILL HIM!!!

Just so you know since I've been so "anti-Trans" in the past I plan to
look over Calibre and write about some of the gems (pun-intended) in
there.

Hey, thanks. That would be great! I hope you find some the "gems"
useful.

T.

Just so you know since I've been so "anti-Trans" in the past I plan to
look over Calibre and write about some of the gems (pun-intended) in
there.

Cool thanks. I hope you find a "gem" of use to you.

T.