[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Singleton class terminology

flaig

5/10/2005 9:45:00 AM

Yes, I think Hal's remark is quite interesting -- if I am not mistaken, "class" is derived from the Latin word for "fleet" (classis), which in turn is derived from "callare", to put under one common designation. There is always the implicit connotation of multiplicity. Getting rid of the word "class" in this instance (no pun in10ded) could been advantageous. OK, it *is* a class, but an atypical one. (<= Suggestion *g*!)

Indeed, I think that "pouch" is not so bad a name, considering that the expressions "shelf" and "bag" have already been occupied by other languages. Admittedly it has a somewhat funny sound at first, but it's a brief and expressive term.

Maybe "collection" would do?

Or what about "museum"? :-)

Thinking of it, "gallery" might even be suitable... a place where unique valuables are kept and traded...

-- Ruediger Marcus

Am Dienstag, den 10.05.2005, 00:03 +0900 schrieb ruby-talk-admin@ruby-lang.org:
Le 8/5/2005, "Hal Fulton" <hal9000@hypermetrics.com> a =E9crit:
>
> >Just expressing my opinion here.
> >
> >I don't like the term "idioclass" because "idio" doesn't
> >remind me of "idiom" at all, and even if it did, it would
> >be meaningless to me.
> >
> >I don't mind the term "singleton class." I'm used to it.
> >
> >If it must be changed, though, I question whether even the
> >word "class" is appropriate.
> >
> >Consider the traditional meaning of "class" in OOP -- consider
> >the *reason* that word was chosen. A "class" is a category.
> >It is like a template that characterizes the members of that
> >category -- in real life, we expect the "class" of Ford automobiles
> >to have certain things in common, or there would be no reason to
> >"class" them (or categorize them) together.
> >
> >But in that sense, a "singleton class" is not a class at all.
> >It is just a "place" where we store information on unique methods
> >and attributes and such. A class also has a "place" associated
> >with it -- whether you think of it as a place in memory, or in
> >the interpreter's code, or in the programmer's brain.
> >
> >But the class and the "place where the class's stuff is stored"
> >are not really the same thing, are they? I submit they are not.
> >
> >I further submit that what we call a "singleton class" is a
> >(or has a) "place" but isn't a class at all really; whereas a
> >real class IS a class and also has a "place" to store its stuff.
> >
> >So we've been concentrating on changing the first word of the
> >phrase "singleton class." Could we perhaps change the second
> >word instead, making it a "singleton [whatsis]"?
> >
> >Is my thinking here of any value at all?
>
> Yes, excellent question! I was thinking about just giving it
> a nonsense name since there really is no direct correspondence
> to any existing, if you will excuse me, idiom.
>
> Could we call it #pouch? :)
>
> >Hal
>
> E
> ===
Chevalier Dr. Dr. Don Rüdiger Marcus Flaig MSc ScD PhD KCHT KSR CSM KEL MLJ MOC
Langgewann 28
D-69121 Heidelberg
Germany
Mail: <flaig@cirith-ungol.sanctacaris.net>

A prediction is worth twenty explanations. -- K. Brecher




--
Diese E-Mail wurde mit http://www.mail-in... verschickt
Mail Inspector ist ein kostenloser Service von http://www....
Der Absender dieser E-Mail hatte die IP: 129.206.124.135



1 Answer

Daniel Amelang

5/10/2005 10:29:00 PM

0

I'm still a sucker for selfclass.

(class << obj; self; end) becomes obj.selfclass

And when we discuss it, it sounds cool: 'Yea, so that method only
exists in the selfclass of the object, ya know?'

Although I like the point that maybe it shouldn't even be called a class...

Ever wonder where they got the name 'functor' that is used in other
languages? Maybe we should make up something just as original for
Ruby's own very original concept. So +1 for the nonsense word idea.

Dan