Re: More on Roles, .does(), and .isa() (was Re: Quick OO .isa question)

2005-07-21 Thread TSa (Thomas Sandlaß)
chromatic wrote: On Tue, 2005-07-19 at 18:47 +0200, "TSa (Thomas Sandlaß)" wrote: I strongly agree. They should share the same namespace. Since code objects constitute types they also share this namespace. This means that any two lines of class Foo {...} roleFoo {...} sub Foo {...} me

Re: More on Roles, .does(), and .isa() (was Re: Quick OO .isa question)

2005-07-19 Thread chromatic
On Tue, 2005-07-19 at 18:47 +0200, "TSa (Thomas Sandlaß)" wrote: > I strongly agree. They should share the same namespace. Since > code objects constitute types they also share this namespace. > This means that any two lines of > > class Foo {...} > roleFoo {...} > sub Foo {...} > metho

Re: More on Roles, .does(), and .isa() (was Re: Quick OO .isa question)

2005-07-19 Thread TSa (Thomas Sandlaß)
HaloO chromatic, you wrote: Have I mentioned before that I think you should be able to say: class Foo { method foo { ... } method more_foo { ... } } class Bar does Foo { method foo { ... } } ... probably get a compile-time error that Bar doesn't support more_foo()? W

Re: Quick OO .isa question

2005-07-11 Thread Larry Wall
On Mon, Jul 11, 2005 at 05:35:41PM -0400, Stevan Little wrote: : So going away from philosophy 101 here, and back to CS, it could be : said that a "Class" has-a "MetaClass" (although not in the strict : user-level-OO sense of the word). Yes, though I think of it more as delegation. Of course, d

More on Roles, .does(), and .isa() (was Re: Quick OO .isa question)

2005-07-11 Thread chromatic
On Mon, 2005-07-11 at 17:47 -0400, Stevan Little wrote: > I actually agree with you on that. But I would like to clarify it to > say that: > >Foo.isa(Bar) # Foo.meta.isa(Bar) || Foo.meta.does(Bar) > > ... meaning that the .isa() which is supposed to be aliased into the > class from .meta i

Re: Quick OO .isa question

2005-07-11 Thread Stevan Little
chromatic, On Jul 11, 2005, at 4:26 PM, chromatic wrote: On Mon, 2005-07-11 at 15:16 +0200, Ingo Blechschmidt wrote: Bar.new.isa(Object);# true Bar.new.isa(Class); # false Bar.new.isa(Foo); # true Bar.new.isa(Bar); # true I'd like to go on a tangent to suggest tha

Re: Quick OO .isa question

2005-07-11 Thread Stevan Little
On Jul 11, 2005, at 3:07 PM, Larry Wall wrote: Bar.meta.does(CLASS)# true To me this is just code-reuse on the meta-level. Much like in smalltalk: MetaClass isa ClassDescription isa Behavior isa Object and: Class isa Class

Re: Quick OO .isa question

2005-07-11 Thread Stevan Little
Ingo, On Jul 11, 2005, at 3:14 PM, Ingo Blechschmidt wrote: Hi, Stevan Little wrote: Actually I was thinking that MyClass.isa(...) would work much as it did in Perl 5 (like an instance). But that access to the underlying MyClass class instance would not be as simple. Something like ::MyClass w

Re: Quick OO .isa question

2005-07-11 Thread Stevan Little
Larry , At the risk of essentially signing my own committal papers for the local looney bin, I have to say that this make sense to me. But I have a few questions and requests for clarification :) On Jul 11, 2005, at 3:07 PM, Larry Wall wrote: On Mon, Jul 11, 2005 at 09:46:30AM -0400, Steva

Re: Quick OO .isa question

2005-07-11 Thread Larry Wall
Though, arguably, if one is a true Platonist, one should view roles as Aristotelian, and base classes as Platonic and therefore more "real"...but I'm more of an Aristotelian myself, so I tend to think of the Platonic ideals as less real than reality. Whatever. Both Plato and Aristotle would proba

Re: Quick OO .isa question

2005-07-11 Thread chromatic
On Mon, 2005-07-11 at 15:16 +0200, Ingo Blechschmidt wrote: > Bar.new.isa(Object);# true > Bar.new.isa(Class); # false > Bar.new.isa(Foo); # true > Bar.new.isa(Bar); # true I'd like to go on a tangent to suggest that anyone who uses .isa() in actual real code ought to

Re: Quick OO .isa question

2005-07-11 Thread Ingo Blechschmidt
Hi, Larry Wall wrote: > On Mon, Jul 11, 2005 at 09:46:30AM -0400, Stevan Little wrote: > : On Jul 11, 2005, at 9:16 AM, Ingo Blechschmidt wrote: > : > Bar.isa(Object);# true > : > Bar.isa(Class); # true > : > Bar.isa(Foo); # ? (my guess: false) > : > Bar.isa(Bar);

Re: Quick OO .isa question

2005-07-11 Thread Ingo Blechschmidt
Hi, Stevan Little wrote: > Actually I was thinking that MyClass.isa(...) would work much as it > did in Perl 5 (like an instance). But that access to the underlying > MyClass class instance would not be as simple. Something like > ::MyClass would provide access to the Class instance. > >class

Re: Quick OO .isa question

2005-07-11 Thread Larry Wall
On Mon, Jul 11, 2005 at 09:46:30AM -0400, Stevan Little wrote: : Ingo, : : On Jul 11, 2005, at 9:16 AM, Ingo Blechschmidt wrote: : >Hi, : > : > class Foo {} : > class Bar is Foo {} : > : > Bar.new.isa(Object);# true : > Bar.new.isa(Class); # false : > Bar.new.isa(Foo); # true :

Re: Quick OO .isa question

2005-07-11 Thread Stevan Little
Ingo, On Jul 11, 2005, at 12:30 PM, Ingo Blechschmidt wrote: I am not sure about this. I think that .isa as a class method should behave much as it does for an instance method. If we start supporting things like Bar.isa(Class) then we start exposing the soft underbelly of the meta-model to the o

Re: Quick OO .isa question

2005-07-11 Thread Ingo Blechschmidt
Hi, Stevan Little wrote: > On Jul 11, 2005, at 9:16 AM, Ingo Blechschmidt wrote: >> Bar.isa(Object);# true >> Bar.isa(Class); # true >> Bar.isa(Foo); # ? (my guess: false) >> Bar.isa(Bar); # ? (my guess: false) > > I am not sure about this. I think that

Re: Quick OO .isa question

2005-07-11 Thread Stevan Little
Ingo, On Jul 11, 2005, at 9:16 AM, Ingo Blechschmidt wrote: Hi, class Foo {} class Bar is Foo {} Bar.new.isa(Object);# true Bar.new.isa(Class); # false Bar.new.isa(Foo); # true Bar.new.isa(Bar); # true # These are clear, I think. Yes, these all make sense to

Quick OO .isa question

2005-07-11 Thread Ingo Blechschmidt
Hi, class Foo {} class Bar is Foo {} Bar.new.isa(Object);# true Bar.new.isa(Class); # false Bar.new.isa(Foo); # true Bar.new.isa(Bar); # true # These are clear, I think. Bar.isa(Object);# true Bar.isa(Class); # true Bar.isa(Foo);