Re: Objects, classes, metaclasses, and other things that go bump in the night

2004-12-16 Thread Piers Cawley
Dan Sugalski [EMAIL PROTECTED] writes: At 11:13 AM +0100 12/14/04, Leopold Toetsch wrote: Dan Sugalski [EMAIL PROTECTED] wrote: subclass - To create a subclass of a class object Is existing and used. Right. I was listing the things we need in the protocol. Some of them we've got,

Re: Objects, classes, metaclasses, and other things that go bump in the night

2004-12-14 Thread Leopold Toetsch
Dan Sugalski [EMAIL PROTECTED] wrote: subclass - To create a subclass of a class object Is existing and used. add_parent - To add a parent to the class this is invoked on become_parent - Called on the class passed as a parameter to add_parent What is the latter used for?

Re: Objects, classes, metaclasses, and other things that go bump in the night

2004-12-14 Thread Dan Sugalski
At 11:13 AM +0100 12/14/04, Leopold Toetsch wrote: Dan Sugalski [EMAIL PROTECTED] wrote: subclass - To create a subclass of a class object Is existing and used. Right. I was listing the things we need in the protocol. Some of them we've got, some we don't, and some of the stuff we have we

MMD dispatch (was: Objects, classes, metaclasses, and other things that go bump in the night)

2004-12-04 Thread Leopold Toetsch
Dan Sugalski [EMAIL PROTECTED] wrote: Now, there is one big gotcha here -- multimethod dispatch. I'm not entirely sure that we can do this properly and still give classes full control over how methods are looked for and where they go. Thinking about MMD a bit more, I can imagine the following

Re: Objects, classes, metaclasses, and other things that go bump in the night

2004-12-02 Thread Sam Ruby
Leopold Toetsch wrote: Dan Sugalski [EMAIL PROTECTED] wrote: Anyway, so much for the 'outside world' view of objects as black box things that have properties and methods. [ ... ] Almost everything we do here is going to be with method calls. There's very little that I can see that requires any

Objects, classes, metaclasses, and other things that go bump in the night

2004-11-29 Thread Dan Sugalski
Right, so with at least a basic rework of the string stuff in, it's time to turn our attention to objects and all the stuff that goes with them. I'd originally thought that the bits we'd put in place would be sufficient to do everyone's object system (well, all the languages that we

Metaclasses

2004-10-04 Thread Dan Sugalski
Okay, color me officially confused. I'm working on the assumption that metaclasses are needed, but I don't, as yet, understand them. So, with this bit of ignorance exposed, could someone point me to a good explanation of what they are and how they work? Theory's fine (possibly better than fine

Re: Metaclasses

2004-10-04 Thread Michael Walter
http://members.rogers.com/mcfletch/programming/metaclasses.pdf On Mon, 4 Oct 2004 11:45:50 -0400, Dan Sugalski [EMAIL PROTECTED] wrote: Okay, color me officially confused. I'm working on the assumption that metaclasses are needed, but I don't, as yet, understand them. So, with this bit

Re: Metaclasses

2004-10-04 Thread Dan Sugalski
. On Mon, 4 Oct 2004 11:45:50 -0400, Dan Sugalski [EMAIL PROTECTED] wrote: Okay, color me officially confused. I'm working on the assumption that metaclasses are needed, but I don't, as yet, understand them. So, with this bit of ignorance exposed, could someone point me to a good explanation

Re: Metaclasses

2004-10-04 Thread Sam Ruby
Dan Sugalski wrote: At 12:09 PM -0400 10/4/04, Michael Walter wrote: http://members.rogers.com/mcfletch/programming/metaclasses.pdf I do have that one. Unfortunately it's the PDF of slides and, while it looks like if I was at the talk it'd all make sense, without the talk that goes with 'em...

Re: Metaclasses

2004-10-04 Thread Aaron Sherman
On Mon, 4 Oct 2004 13:24:58 -0400, Dan Sugalski [EMAIL PROTECTED] wrote: On Mon, 4 Oct 2004 11:45:50 -0400, Dan Sugalski [EMAIL PROTECTED] wrote: Okay, color me officially confused. I'm working on the assumption that metaclasses are needed, but I don't, as yet, understand them. At 12:09

Re: Classes and metaclasses

2004-03-23 Thread Dan Sugalski
At 6:17 PM -0800 3/22/04, chromatic wrote: On Tue, 2004-03-16 at 11:57, Dan Sugalski wrote: (I forgot to reply to this last week) At 11:51 AM -0800 3/16/04, chromatic wrote: Just to be sure, if Class Y inherits from Class X, is X on Y's does list? If class X does X, then yes. (I *really*

Re: Classes and metaclasses

2004-03-22 Thread chromatic
On Tue, 2004-03-16 at 11:57, Dan Sugalski wrote: (I forgot to reply to this last week) At 11:51 AM -0800 3/16/04, chromatic wrote: Just to be sure, if Class Y inherits from Class X, is X on Y's does list? If class X does X, then yes. (I *really* should've picked better names) Classes

Re: Classes and metaclasses

2004-03-17 Thread Dan Sugalski
At 4:12 PM -0800 3/16/04, Larry Wall wrote: On Tue, Mar 16, 2004 at 02:57:07PM -0500, Dan Sugalski wrote: : Classes and roles don't automatically share the same namespace. I think they do. I want to be able to tell the moment I compile it whether Foo is a class or a role or (a bareword that will

Re: Classes and metaclasses

2004-03-16 Thread Dan Sugalski
At 7:53 PM -0800 3/15/04, Larry Wall wrote: On Sun, Mar 14, 2004 at 02:32:44PM +0100, Leopold Toetsch wrote: : Why? A ParrotClass is responsible for the method dispatch. The ParrotObject : inherits that behavior. In Perl 6 terms we'd prefer to say that ParrotClass does the Dispatch role, and so

Re: Classes and metaclasses

2004-03-16 Thread chromatic
On Tue, 2004-03-16 at 06:42, Dan Sugalski wrote: Roles are going to get implemented as inheritance--so far I've seen no technical reason not to, and quite a number of reasons to do so. People can cope, if they're looking this deeply. Out of curiosity, what are those reasons? I'm not sure

Re: Classes and metaclasses

2004-03-16 Thread Dan Sugalski
At 10:14 AM -0800 3/16/04, chromatic wrote: On Tue, 2004-03-16 at 06:42, Dan Sugalski wrote: Roles are going to get implemented as inheritance--so far I've seen no technical reason not to, and quite a number of reasons to do so. People can cope, if they're looking this deeply. Out of

Re: Classes and metaclasses

2004-03-16 Thread chromatic
On Tue, 2004-03-16 at 10:25, Dan Sugalski wrote: Unless I missed something, child classes inherit parent class roles, so if I have Foo with a role of X, and Bar inherits from Foo, Bar does the X role. Looks like inheritance to me... That's normal inheritance and that's fine. Consider

Re: Classes and metaclasses

2004-03-16 Thread Dan Sugalski
At 11:05 AM -0800 3/16/04, chromatic wrote: On Tue, 2004-03-16 at 10:25, Dan Sugalski wrote: Unless I missed something, child classes inherit parent class roles, so if I have Foo with a role of X, and Bar inherits from Foo, Bar does the X role. Looks like inheritance to me... That's normal

Re: Classes and metaclasses

2004-03-16 Thread chromatic
On Tue, 2004-03-16 at 11:46, Dan Sugalski wrote: A class does X if X is on the does list of the class or any of the parents of the class. This class then does the role X. A class isa X if X in on the isa list of the class or any of the parents of the class. Alternately, your class can

Re: Classes and metaclasses

2004-03-16 Thread Dan Sugalski
At 11:51 AM -0800 3/16/04, chromatic wrote: On Tue, 2004-03-16 at 11:46, Dan Sugalski wrote: A class does X if X is on the does list of the class or any of the parents of the class. This class then does the role X. A class isa X if X in on the isa list of the class or any of the parents of

Re: Classes and metaclasses

2004-03-16 Thread Larry Wall
On Tue, Mar 16, 2004 at 02:57:07PM -0500, Dan Sugalski wrote: : Classes and roles don't automatically share the same namespace. I think they do. I want to be able to tell the moment I compile it whether Foo is a class or a role or (a bareword that will not succeed in being either). Roles are

Re: Classes and metaclasses

2004-03-15 Thread Leopold Toetsch
Piers Cawley [EMAIL PROTECTED] wrote: Leopold Toetsch [EMAIL PROTECTED] writes: Piers Cawley [EMAIL PROTECTED] wrote: Leopold Toetsch [EMAIL PROTECTED] writes: The terms are misleading a bit here. - a ParrotClass isa delegate PMC - a ParrotObject isa ParrotClass

Re: Classes and metaclasses

2004-03-15 Thread Malte Ubl
if metaclasses are objects, but it seems to lack a certain amount of egregious symmetry if it doesn't. Meta classes break the every class has a super class-chain by inheriting from themselves. A natural meta class is the word noun. It describes a class of words and it is an instance of that class. bye

RE: Classes and metaclasses

2004-03-15 Thread Solinski, Mark
not entirely sure if metaclasses are objects, but it seems to lack a certain amount of egregious symmetry if it doesn't. Meta classes break the every class has a super class-chain by inheriting from themselves. A natural meta class is the word noun. It describes a class of words

Re: Classes and metaclasses

2004-03-15 Thread Larry Wall
On Sun, Mar 14, 2004 at 02:32:44PM +0100, Leopold Toetsch wrote: : Why? A ParrotClass is responsible for the method dispatch. The ParrotObject : inherits that behavior. In Perl 6 terms we'd prefer to say that ParrotClass does the Dispatch role, and so does ParrotObject, but to call it inheritance

Re: Classes and metaclasses

2004-03-14 Thread Paolo Molaro
On 03/13/04 Mark Sparshatt wrote: One difficulty is when calling class methods some languages require that you provide the class object as the receiver (Ruby and c# do this) while some languages let you use an instance of the class as the receiver (Java does this) I think you're confusing

Re: Classes and metaclasses

2004-03-14 Thread Piers Cawley
Leopold Toetsch [EMAIL PROTECTED] writes: Dan Sugalski [EMAIL PROTECTED] wrote: The one question I have is whether we need to have a call class method operation that, when you invoke it, looks up the class of the object and redispatches to it, or whether class methods are just methods

Re: Classes and metaclasses

2004-03-14 Thread Leopold Toetsch
Piers Cawley [EMAIL PROTECTED] wrote: Leopold Toetsch [EMAIL PROTECTED] writes: Dan Sugalski [EMAIL PROTECTED] wrote: The one question I have is whether we need to have a call class method operation that, when you invoke it, looks up the class of the object and redispatches to it, or

Re: Classes and metaclasses

2004-03-14 Thread Piers Cawley
Leopold Toetsch [EMAIL PROTECTED] writes: Piers Cawley [EMAIL PROTECTED] wrote: Leopold Toetsch [EMAIL PROTECTED] writes: Dan Sugalski [EMAIL PROTECTED] wrote: The one question I have is whether we need to have a call class method operation that, when you invoke it, looks up the class of

Classes and metaclasses

2004-03-13 Thread Dan Sugalski
So, if I understand this right (and I may well not), when you instantiate a metaclass you get a class, and when you instantiate a class you get an object, and since anything you instantiate is an object anyway that means classes are objects. I'm not entirely sure if metaclasses are objects

Re: Classes and metaclasses

2004-03-13 Thread Mark Sparshatt
if metaclasses are objects, but it seems to lack a certain amount of egregious symmetry if it doesn't. metaclasses are objects as well. That means, I think, that you ought to be able to call methods on classes, which since you can I think we're mostly OK, though I expect some reworking of base behaviour

Re: Classes and metaclasses

2004-03-13 Thread Leopold Toetsch
Dan Sugalski [EMAIL PROTECTED] wrote: The one question I have is whether we need to have a call class method operation that, when you invoke it, looks up the class of the object and redispatches to it, or whether class methods are just methods called on class objects. The terms are