Re: Multimethod Dispatch

2002-09-03 Thread Dan Sugalski
At 5:41 PM -0700 9/3/02, David Wheeler wrote: >On Tuesday, September 3, 2002, at 05:08 PM, Dan Sugalski wrote: > >>We call that concept "multimethod dispatch". That's what you're asking for. > >Dan, can you explain what "multimethod dispatch" is? Damian can explain it better than I can, but it's

Re: Multimethod Dispatch

2002-09-03 Thread David Wheeler
On Tuesday, September 3, 2002, at 06:12 PM, Dan Sugalski wrote: > Damian can explain it better than I can, but it's essentially when you > dispatch based on sub or method signature. You're allowed to have > multiple versions of a single sub as long as they differ in their > parameter signatur

Re: Multimethod Dispatch

2002-09-04 Thread Ken Fox
David Wheeler wrote: > Ah, yes, the same thing exists in Java. I remember, now. I thought Java only has over loading? Over loading is what C++ has. It is not the same as multi-dispatch. The trouble with over loading is that the compiler uses static (compile-time) type information to select the o

Re: Multimethod Dispatch

2002-09-04 Thread [EMAIL PROTECTED]
From: Ken Fox [EMAIL PROTECTED] > Over loading is what C++ has. It is not the same as > multi-dispatch. The trouble with over loading is that the > compiler uses static (compile-time) type information to > select the over loaded method. This can create subtle > bugs when people try to re-use code

Re: Multimethod Dispatch

2002-09-04 Thread Dan Sugalski
At 9:10 AM -0400 9/4/02, [EMAIL PROTECTED] wrote: > >From: Ken Fox [EMAIL PROTECTED] >> Over loading is what C++ has. It is not the same as >> multi-dispatch. The trouble with over loading is that the >> compiler uses static (compile-time) type information to >> select the over loaded method.

Re: Multimethod Dispatch

2002-09-04 Thread David Wheeler
On Wednesday, September 4, 2002, at 06:58 AM, Dan Sugalski wrote: > No. They can be both compile time things or runtime things, depending > on the characteristics of the language. So if it's compile-time for a given language, how is it different from the Java concept of overloading? And will

Re: Multimethod Dispatch

2002-09-04 Thread Dan Sugalski
At 7:31 AM -0700 9/4/02, David Wheeler wrote: >On Wednesday, September 4, 2002, at 06:58 AM, Dan Sugalski wrote: > >>No. They can be both compile time things or runtime things, >>depending on the characteristics of the language. > >So if it's compile-time for a given language, how is it differen

Re: Multimethod Dispatch

2002-09-04 Thread Florian Haeglsperger
Just some thoughts (and an idea): I have found the whole context thing in Perl5 easier to understand when I regard it as overloading based on the return type. We all know that languages like C, C++ and Java throw a compile-time error if two function definitions differ in their return type only

Re: Multimethod Dispatch

2002-09-04 Thread Mark J. Reed
The specific definitions of these terms vary from language to language. In Java, for instance, a method is said to be "overloaded" and/or "overridden". An "overloaded" method is actually two or more methods with the same name but differing numbers/types of parameters (which Java calls the "signa

Re: Multimethod Dispatch

2002-09-04 Thread Damian Conway
Dan Sugalski wrote: >> Dan, can you explain what "multimethod dispatch" is? > > Damian can explain it better than I can, I thought you did a great job! However, anyone who wants to know more about multiple dispatch might also like to read: http://www.samag.com/documents/s=1274/sam050

Re: Multimethod Dispatch

2002-09-04 Thread Ken Fox
Dan Sugalski wrote: > At 9:10 AM -0400 9/4/02, [EMAIL PROTECTED] wrote: >> So, just to clarify, does that mean that multi-dispatch is (by >> definition) >> a run-time thing, and overloading is (by def) a compile time thing? > > No. They can be both compile time things or runtime things, dependin

Re: Multimethod Dispatch

2002-09-05 Thread Dan Sugalski
At 9:27 PM -0400 9/4/02, Ken Fox wrote: >Dan Sugalski wrote: >>At 9:10 AM -0400 9/4/02, [EMAIL PROTECTED] wrote: >>>So, just to clarify, does that mean that multi-dispatch is (by definition) >>>a run-time thing, and overloading is (by def) a compile time thing? >> >>No. They can be both compile ti

Re: Multimethod dispatch?

2003-06-02 Thread Luke Palmer
> Apologies if I've missed some earlier discussions on multimethods. The > apocolypses, exegesises and synopses don't seem to say much other than > (a) they will exist and (b) wait for apocolypse 12 for more information. > > Looking over RFC 256[*] and Class::Multimethods[**] it sounds like the >

Re: Multimethod dispatch?

2003-06-02 Thread Simon Cozens
[EMAIL PROTECTED] (Luke Palmer) writes: > It will still have a lot of power in text processing, and still be a > powerful "quicky" language, but that's no longer its primary focus -- > not to say that highly structured programming is. So, uh, what is? > And you can still do it the Perl 5 way in P

Re: Multimethod dispatch?

2003-06-02 Thread Adam Turoff
On Sun, Jun 01, 2003 at 10:44:02PM -0600, Luke Palmer wrote: > You must not be following Perl 6 closely enough, then. Perl 6 is a > "real" programming language now, as opposed to a "scripting" language. Um, I've followed Perl6 closely enough to know that the distinction between "real langauge" an

Re: Multimethod dispatch?

2003-06-03 Thread Luke Palmer
Adam Turoff writes: > On Sun, Jun 01, 2003 at 10:44:02PM -0600, Luke Palmer wrote: > > It will still have a lot of power in text processing, and still be a > > powerful "quicky" language, but that's no longer its primary focus -- > > not to say that highly structured programming is. Some applicati

Re: Multimethod dispatch?

2003-06-03 Thread Graham Barr
On Mon, Jun 02, 2003 at 10:34:14AM -0600, Luke Palmer wrote: > What it seems you're wanting is it to be in the core. And I'm saying > that's irrelavent. There are thousands of great ideas out there, and > they can't all fit into Perl's core. That's why there's thousands of > modules on CPAN. H

Re: Multimethod dispatch?

2003-06-03 Thread Adam Turoff
On Mon, Jun 02, 2003 at 10:34:14AM -0600, Luke Palmer wrote: > And I don't see what's stopping someone from writing Dispatch::Value. > > use Dispatch::Value; > sub foo($param is value('param1')) {...} > sub foo($param is value('param2')) {...} > > What it seems you're wanting is it to

Re: Multimethod dispatch?

2003-06-03 Thread Me
> A better fitting solution wouldn't focus on classic > MMD, but simply "Dispatch", where type- and value-based > dispatching are two of many kinds of dispatching supported. I've always liked the sound of Linda's tuple spaces and view that as a nice generalized dispatch approach. Procedure calls

Re: Multimethod dispatch?

2003-06-03 Thread Me
> A better fitting solution wouldn't focus on classic > MMD, but simply "Dispatch", where type- and value-based > dispatching are two of many kinds of dispatching supported. I've always liked the sound of Linda's tuple spaces and view that as a nice generalized dispatch approach. Procedure calls