RE: Multimethod/multisub thought...

2003-01-24 Thread Austin Hastings
--- Brent Dax <[EMAIL PROTECTED]> wrote: > I suggest that we might require a special property to say "dispatch > on return value", which would give us a place to put in some > information to resolve conflicts. In keeping with the notion of "a language for good programmers," I think that the ver

Re: Multimethod/multisub thought...

2003-01-24 Thread Thomas A. Boyer
Dan Sugalski wrote: > There's also the fun of: > > Dog bar(int); > Cat bar(int); > > and > > xyzzy(Dog); > xyzzy(Cat); > > with the call of: > > xyzzy(bar(1)); > > Just one of the many brain-benders that I'm glad Larry has to deal > with, not me. (Though this may be one

RE: Multimethod/multisub thought...

2003-01-24 Thread Brent Dax
Garrett Goebel: # From: Brent Dax [mailto:[EMAIL PROTECTED]] # > Actually, I was thinking C, though a junction of all # > the possible contexts might be good too. Remember, want() # > is more than just scalar/array now. # # sure, sure... # # I was ambiguously referring back to Dan's example, we

RE: Multimethod/multisub thought...

2003-01-24 Thread Garrett Goebel
From: Brent Dax [mailto:[EMAIL PROTECTED]] > Garrett Goebel: > # Brent Dax wrote: > # > > # > This is also a problem with using want(). > # > > # > If we don't provide wants_scalar/wants_list, someone will > # > build it with want(), so we might as well try to address > # > it. I suggest that wan

Re: Multimethod/multisub thought...

2003-01-24 Thread Nicholas Clark
On Fri, Jan 24, 2003 at 10:15:48AM -0800, Brent Dax wrote: > Dan Sugalski: > # Okay, I think I remembered the problem. Assume the following: > # > # list bar(int); # bar takes an int, returns a list > # scalar bar(int); # bar takes an int, returns a scalar > # > # and also assume the f

Re: Multimethod/multisub thought...

2003-01-24 Thread Dan Sugalski
At 10:02 AM -0800 1/24/03, Austin Hastings wrote: --- Dan Sugalski <[EMAIL PROTECTED]> wrote: At 7:30 AM + 1/24/03, Piers Cawley wrote: >In my quest to eliminate as many explicit conditionals from my code as >possible, I found myself wondering if Perl 6's multidispatch mechanism >would

RE: Multimethod/multisub thought... [x-adr]

2003-01-24 Thread Brent Dax
Garrett Goebel: # Brent Dax wrote: # > # > This is also a problem with using want(). # > # > If we don't provide wants_scalar/wants_list, someone will # > build it with want(), so we might as well try to address # > it. I suggest that want() return a special value when # > the calling context is

RE: Multimethod/multisub thought... [x-adr]

2003-01-24 Thread Garrett Goebel
From: Dan Sugalski [mailto:[EMAIL PROTECTED]] > > Okay, I think I remembered the problem. Assume the following: > > list bar(int); # bar takes an int, returns a list > scalar bar(int); # bar takes an int, returns a scalar > > and also assume the following: > > xyzzy(scalar); # xyz

Re: Multimethod/multisub thought...

2003-01-24 Thread Jonathan Scott Duff
On Fri, Jan 24, 2003 at 10:02:13AM -0800, Austin Hastings wrote: > --- Dan Sugalski <[EMAIL PROTECTED]> wrote: > > At 7:30 AM + 1/24/03, Piers Cawley wrote: > > >In my quest to eliminate as many explicit conditionals from my code > > as > > >possible, I found myself wondering if Perl 6's multid

RE: Multimethod/multisub thought...

2003-01-24 Thread Brent Dax
Dan Sugalski: # At 7:30 AM + 1/24/03, Piers Cawley wrote: # >In my quest to eliminate as many explicit conditionals from # my code as # >possible, I found myself wondering if Perl 6's multidispatch # mechanism # >would allow one to write: # # Okay, I think I remembered the problem. Assume

Re: Multimethod/multisub thought...

2003-01-24 Thread Austin Hastings
--- Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 7:30 AM + 1/24/03, Piers Cawley wrote: > >In my quest to eliminate as many explicit conditionals from my code > as > >possible, I found myself wondering if Perl 6's multidispatch > mechanism > >would allow one to write: > > Okay, I think I reme

Re: Multimethod/multisub thought...

2003-01-24 Thread Dan Sugalski
At 7:30 AM + 1/24/03, Piers Cawley wrote: In my quest to eliminate as many explicit conditionals from my code as possible, I found myself wondering if Perl 6's multidispatch mechanism would allow one to write: Okay, I think I remembered the problem. Assume the following: list bar(int);

Re: Multimethod/multisub thought...

2003-01-24 Thread Austin Hastings
--- Piers Cawley <[EMAIL PROTECTED]> wrote: > In my quest to eliminate as many explicit conditionals from my code > as > possible, I found myself wondering if Perl 6's multidispatch > mechanism > would allow one to write: > >sub gmttime ( $time = time() ) is in_scalar_context { > strfti

Re: Multimethod/multisub thought...

2003-01-23 Thread Dan Sugalski
At 7:30 AM + 1/24/03, Piers Cawley wrote: In my quest to eliminate as many explicit conditionals from my code as possible, I found myself wondering if Perl 6's multidispatch mechanism would allow one to write: sub gmttime ( $time = time() ) is in_scalar_context { strftime( $perls_def