Re: CLOS multiple dispatch

2001-09-06 Thread David L. Nicol
Hong Zhang wrote: How do you define the currently loaded? If things are lazy loaded, the stuff you expect has been loaded may not have been loaded. We could load placeholders that go and load the bigger methods as needed, for instance. -- David

RE: CLOS multiple dispatch

2001-09-01 Thread Dan Sugalski
At 06:34 PM 8/30/2001 -0700, Hong Zhang wrote: With optimized C compiler, we can achieve similar performace with obviously more code. Let's say C is only 80% of Fortran on math, I still don't see the reason to put math into C language for the last 20% of speed. It may be my personal preference.

Re: CLOS multiple dispatch

2001-08-31 Thread Me
If the dispatcher is drop-in replacable, what does its interface look like? I'm thinking this is either deep in mop territory, or a probably quite straightforward set of decisions about dispatch tables, depending on how you look at things. I found just one relevant occurence of 'mop' in

Re: CLOS multiple dispatch

2001-08-30 Thread Me
What is the need for CLOS? Are we trying to build a kitchen sink here? To echo Michael, CLOS != multiple dispatch. http://dev.perl.org/rfc/256.html The usefulness of multiple dispatch depends on how intelligently the dispatcher decides which variant of a multimethod is nearest to a given

RE: CLOS multiple dispatch

2001-08-30 Thread Hong Zhang
For example, here is an event handler for a GUI: sub handle (Window $w, Event $e) : multi { log(Unknown event $($e-desc) called on window $($w-name)); } sub handle (Window $w, CloseEvent $e) : multi { $w-close; } sub handle

Re: CLOS multiple dispatch

2001-08-30 Thread David L. Nicol
Me wrote: I can imagine plausibly useful dispatch rulesets that do not involve comparing sums of inheritance distances. (Though this *is* all imagining as I haven't used multimethods/clos in about 10 years.) I would also imagine that others see that summing inheritance distances may not

Re: CLOS multiple dispatch

2001-08-30 Thread David L. Nicol
Hong Zhang wrote: 3) The multi dispatch is generally slow and complicated. Since it does not fit well with OO concept, it will just cause more confusion. Typically we use different solution for OO language vs procedure language. In other words, how much do we want our language to set up for

Re: CLOS multiple dispatch

2001-08-30 Thread Damian Conway
Dan observed: I hadn't considered having it as a global thing, just because I can see class Foo wanting multimethods, and class Bar being fine with 'normal' class hierarchy walking, and class Baz deciding it wants the automatic redispatch form of method calling. We

RE: CLOS multiple dispatch

2001-08-30 Thread Damian Conway
Hong wrote: Note that the handler that is selected depends on the *combination* of the types of the two arguments. And that the dispatcher understands the argument/parameter inheritance relationships and selects the most specific handler for each combination. For example, a

RE: CLOS multiple dispatch

2001-08-30 Thread Hong Zhang
Because multimethods are inherently an OO technique. You can say so, but I am not buying it very much. It doesn't. The multimethod consists of those variants that are currently loaded. How do you define the currently loaded? If things are lazy loaded, the stuff you expect has been

Re: CLOS multiple dispatch

2001-08-30 Thread Michael G Schwern
On Thu, Aug 30, 2001 at 06:34:31PM -0700, Hong Zhang wrote: None of them. That's why Class::Multimethods doesn't use CLOS's awful left-most argument first resolution mechanism. So what is the next step. How do you define the next most-matched methods. Please look at how Class::Multimethods

Re: CLOS multiple dispatch

2001-08-29 Thread Damian Conway
I sure miss multi-dispatch. http://dev.perl.org/rfc/256.html Damian

Re: CLOS multiple dispatch

2001-08-29 Thread Damian Conway
Schwern explained: # Following RFC 256 sub name (Foo $self) : multi { return $self-{name}; } sub name (Foo $self, STRING $name) : multi { $self-{name} = $name; return $self-{name}; } which is quite a bit