Hi --

On Fri, 22 Aug 2003, Dan Doel wrote:

> Hal E. Fulton wrote:
>
> >Well, I think that in Java/C++ they're inherited but not shared.
> >In Ruby they're shared.
> >
> >Of course, there's an ugly trick that gets around this... can anyone
> >guess it? David showed it to me once.
> >
>
> Are you referring to the "class << self.class" trick (alluded to by Matz
> and others elsewhere in the thread)?

No, he's referring to this:

  class A
  end

  class B < A
    @@x = 1
  end

  class A
    @@x = 2
  end

  class B
    p @@x       # prints 1, not 2 -- A and B are not sharing @@x
  end

> If you think it's ugly, you can always wrap methods around it to make it
> look more like normal access, or
> at least more normal by Java standards. :)

I *knew* there was some reason I didn't want to learn Java.... :-)

> Code below.

Still scanning it, but one quick comment: I notice you don't use
public/private/protected.  Are there places where that might give you
the same kind of functionality?


David

-- 
David Alan Black
home: dblack / superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav