@@'s are not inherited?

please correct me if i’m wrong but i beleive i just discovered something i did
not realize before: class and module variables (@@) are not inherited by
subclasses. ugh…

···


tom sawyer, aka transami
transami@transami.net

well, i’ll correct myself:

@@'s are inherited by subclasses IF they are pre-defined in the parent. that’s
important to know and i did not see any mention of it in my pick-axe.

···

On Thursday 09 January 2003 05:48 am, Tom Sawyer wrote:

please correct me if i’m wrong but i beleive i just discovered something i
did not realize before: class and module variables (@@) are not inherited
by subclasses. ugh…


tom sawyer, aka transami
Ruby Miner
transami@transami.net

@@'s are inherited by subclasses IF they are pre-defined in the parent. that's
important to know and i did not see any mention of it in my pick-axe.

"Class variables must be initialized before use. [...] Class variables
belong to the innermost enclosing class or module"

p. 214

Guy Decoux

Hi,

It is Item #19 in the “Things That Newcomers to Ruby Should Know”:

http://www.glue.umd.edu/~billtj/ruby.html#classvars

Regards,

Bill

···

Tom Sawyer transami@transami.net wrote:

On Thursday 09 January 2003 05:48 am, Tom Sawyer wrote:

please correct me if i’m wrong but i beleive i just discovered something i
did not realize before: class and module variables (@@) are not inherited
by subclasses. ugh…

well, i’ll correct myself:

@@'s are inherited by subclasses IF they are pre-defined in the parent. that’s
important to know and i did not see any mention of it in my pick-axe.

my that was a fast reply with an exact quote. you know you pick-axe well! :slight_smile:

i did read that, but i don’t think it clearly states the case for subclassing.
it could just as well mean that class variables are only available to the
class they’re initialized in, a subclass thus having its own independent set.

···

On Thursday 09 January 2003 06:21 am, ts wrote:

@@'s are inherited by subclasses IF they are pre-defined in the parent.
that’s T> important to know and i did not see any mention of it in my
pick-axe.

“Class variables must be initialized before use. […] Class variables
belong to the innermost enclosing class or module”

p. 214


tom sawyer, aka transami
transami@transami.net

Item #0 in the “Things That Newcomers to Ruby Should Know”:
They should know “Things That Newcomers to Ruby Should Know” exists! :slight_smile:

···

On Saturday 11 January 2003 01:42 pm, William Djaja Tjokroaminata wrote:

Tom Sawyer transami@transami.net wrote:

On Thursday 09 January 2003 05:48 am, Tom Sawyer wrote:

please correct me if i’m wrong but i beleive i just discovered something
i did not realize before: class and module variables (@@) are not
inherited by subclasses. ugh…

well, i’ll correct myself:

@@'s are inherited by subclasses IF they are pre-defined in the parent.
that’s important to know and i did not see any mention of it in my
pick-axe.

Hi,

It is Item #19 in the “Things That Newcomers to Ruby Should Know”:

http://www.glue.umd.edu/~billtj/ruby.html#classvars


tom sawyer, aka transami
transami@transami.net

                               .''.
   .''.      .        *''*    :_\/_:     .
  :_\/_:   _\(/_  .:.*_\/_*   : /\ :  .'.:.'.

.‘’.: /\ : ./)\ ‘:’* /\ * : ‘…’. -=:o:=-
:/:‘.:::. | ’ ‘’ * ‘.'/.’ (/’.‘:’.’
: /\ : ::::: = / -= o =- /)\ ’ *
‘…’ ‘:::’ === * /\ * .‘/.'. ‘._____
* | : |. |’ .—"|
* | _ .–’| || | _| |
* | .-‘| __ | | | || |
.-----. | |’ | || | | | | | || |
__’ ’ /“\ | '-.”". ‘-’ ‘-.’ '` |.

it could just as well mean that class variables are only available to the
class they're initialized in, a subclass thus having its own independent set.

I'm agree with you, english is a bad language for the documentation :-)))

Guy Decoux

“Tom Sawyer” transami@transami.net wrote in message

my that was a fast reply with an exact quote. you know you pick-axe well!
:slight_smile:

Just Pick-axe ?
Hang on for a while and you will find out how much Ruby related stuff this
Guy knows well :wink:

… and thus mimicking Godel’s Incompleteness Theorem? :slight_smile:

Cheers,

Bill

···

Tom Sawyer transami@transami.net wrote:

Item #0 in the “Things That Newcomers to Ruby Should Know”:
They should know “Things That Newcomers to Ruby Should Know” exists! :slight_smile:

We should go on writing in Japanese then :wink:

···

On Thu, Jan 09, 2003 at 10:37:05PM +0900, ts wrote:

it could just as well mean that class variables are only available to the
class they’re initialized in, a subclass thus having its own independent set.

I’m agree with you, english is a bad language for the documentation :-)))


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Beeping is cute, if you are in the office :wink:
– Alan Cox

Scripsit ille aut illa Mauricio Fernández batsman.geo@yahoo.com:

···

On Thu, Jan 09, 2003 at 10:37:05PM +0900, ts wrote:

it could just as well mean that class variables are only available to the
class they’re initialized in, a subclass thus having its own independent set.

I’m agree with you, english is a bad language for the documentation :-)))

We should go on writing in Japanese then :wink:

That would be too hard to understand for some people like me (aren’t
they called ‘gaijin’?).

Why not write the documentation in Ruby? Together with the already
existing English documentation, it might be enough.

SCNR


this will all happen when your sleeping, and you wont notice a thing because
your titanic fat arse is already so fucked open by your private assortment of
giant sized dildos that the trip up your anus for the anal monkeys will be like
taking a stroll through the grand canyon. [MBVA in japan.anime.evangelion]

From: Rudolf Polzer [mailto:AntiATField_adsgohere@durchnull.de]
Sent: Saturday, January 11, 2003 3:44 PM
To: ruby-talk ML
Subject: Re: @@'s are not inherited?


this will all happen when your sleeping, and you wont notice a thing because
your titanic fat …

With all due respect, your .sig is just a tad much, however funny or clever you
might think it.

···

-----Original Message-----