Re: Multisubs and multimethods: what's the difference?

2006-03-02 Thread Jonathan Lang
Stevan Little wrote: > Jonathan Lang wrote: > > Steven Little wrote: > > > $object does unattached_method; > > > ^Object does unattached_method; > > > > (Wouldn't that be "^$object does unattached_method;"?) > > No, I am attaching the method (well role really) to the class ^Object. > There is no su

Re: Multisubs and multimethods: what's the difference?

2006-03-02 Thread Stevan Little
On 3/2/06, Jonathan Lang <[EMAIL PROTECTED]> wrote: > Stevan Little wrote: > > Jonathan Lang wrote: > > > Can subs be declared within classes? Can methods be declared without > > > classes? > > > > I would say "yes". > > > > Having subs inside classes makes creating small utility functions > > eas

Fwd: Multisubs and multimethods: what's the difference?

2006-03-02 Thread Jonathan Lang
Stevan Little wrote: > Jonathan Lang wrote: > > Can subs be declared within classes? Can methods be declared without > > classes? > > I would say "yes". > > Having subs inside classes makes creating small utility functions > easier. You could also use private methods for this, but if I dont > need

Re: Multisubs and multimethods: what's the difference?

2006-03-02 Thread Stevan Little
On 3/2/06, Jonathan Lang <[EMAIL PROTECTED]> wrote: > Can subs be declared within classes? Can methods be declared without > classes? If the answers to both of these questions are "no", then it > occurs to me that you _could_ unify the two under a single name, using > the class boundary as the di

Re: Multisubs and multimethods: what's the difference?

2006-03-02 Thread Jonathan Lang
Larry Wall wrote: > A multi sub presents only an MMD interface, while a multi method presents > both MMD and SMD interfaces. In this case, there's not much point in the > SMD inteface since .. used as infix is always going to call the MMD interface. So: multi method : MMD and SMD multi sub: M

Re: Multisubs and multimethods: what's the difference?

2006-03-01 Thread Larry Wall
On Wed, Mar 01, 2006 at 09:09:30PM -0700, Joshua Choi wrote: : Kudos to all the Perl 6 mailing list. Not to mention all the people on the list... :-) : What's the difference between : multi sub infix:<..> ( Int $min, Int $max ) { ... } : and : multi method infix:<..> ( Int $min, Int $max ) {

Multisubs and multimethods: what's the difference?

2006-03-01 Thread Joshua Choi
Kudos to all the Perl 6 mailing list. What's the difference between multi sub infix:<..> ( Int $min, Int $max ) { ... } and multi method infix:<..> ( Int $min, Int $max ) { ... } ? And in the case there isn't one, what's the point of declaring if it's a "sub" or "method"; why not just "multi"