Re: Something to ponder

2004-08-18 Thread Felix Gallo
Aaron writes: > COME FROM is very different, and (as with much of Intercal) was created > specifically to be obtuse. Discussing it as if it's a useful feature > tends to creep me out because I get the feeling someone might actually > put it in a language I care about. I feel the same way about

Re: Something to ponder

2004-08-18 Thread Aaron Sherman
Felix Gallo wrote: Aaron writes: Ok, this is starting to look like people speaking seriously about using Intercal's COME FROM (http://c2.com/cgi/wiki?ComeFrom)... can we just step back and take a deep breath of AIR please? Seriously, this is starting to creep me out. Aspect Oriented Program

Re: Something to ponder

2004-08-18 Thread Dan Sugalski
At 3:57 PM -0400 8/18/04, Felix Gallo wrote: Dan writes: sub foo :come_from('+', int, int) {} One problem with MMD in general, and return specifically, is 'what happens if multiple M match the same D requirements? Well... usually what happens is that an ambiguous function error is thrown. I c

Re: Something to ponder

2004-08-18 Thread Felix Gallo
Aaron writes: > Ok, this is starting to look like people speaking seriously about using > Intercal's COME FROM (http://c2.com/cgi/wiki?ComeFrom)... can we just > step back and take a deep breath of AIR please? Seriously, this is > starting to creep me out. In case anyone reading this is getting co

Re: Something to ponder

2004-08-18 Thread Aaron Sherman
On Wed, 2004-08-18 at 15:57, Felix Gallo wrote: > Dan writes: > > sub foo :come_from('+', int, int) {} > > One problem with MMD in general, and return specifically, is > 'what happens if multiple M match the same D requirements? > i.e., That's a question, not a problem. It's easy to answer q

Re: Something to ponder

2004-08-18 Thread Felix Gallo
Dan writes: > sub foo :come_from('+', int, int) {} One problem with MMD in general, and return specifically, is 'what happens if multiple M match the same D requirements? i.e., sub foo :come_from('+', int, int) { shift; shift builtin::+ shift }; sub bar :come_from('+', int, int) { shift; shi

Re: Something to ponder

2004-08-18 Thread Dan Sugalski
At 11:33 AM -0400 8/18/04, Aaron Sherman wrote: On Wed, 2004-08-18 at 10:06, Dan Sugalski wrote: Yep, though the error dispatch case is definitely the easy one. Where it gets fun is: sub foo :come_from('bar', int) { You've created an MMD come-from Uh... that hurts. Yes, but imagine the p

Re: [Fwd: Re: Something to ponder]

2004-08-18 Thread Larry Wall
I think this is something the optimizer could use to eliminate an "ordinary" return that happens to be followed by a call to a known set of something elses. So it might well help things like switch statements and cascaded function calls and tail recursion (and maybe invocation of autoloaded functi

Re: [Fwd: Re: Something to ponder]

2004-08-18 Thread Dan Hursh
Aaron Sherman wrote: This bit comes from the p6i list, and I just thought I'd ask those in-the-know if my suggested "returntype" role/property would make sense here, or if there's another way to do it that makes more sense? For that matter, does MMD on return type map into Perl6's gestalt at all, o

[Fwd: Re: Something to ponder]

2004-08-18 Thread Aaron Sherman
This bit comes from the p6i list, and I just thought I'd ask those in-the-know if my suggested "returntype" role/property would make sense here, or if there's another way to do it that makes more sense? For that matter, does MMD on return type map into Perl6's gestalt at all, or would it be tumoro

Re: Something to ponder

2004-08-18 Thread Aaron Sherman
On Wed, 2004-08-18 at 10:06, Dan Sugalski wrote: > Yep, though the error dispatch case is definitely the easy one. Where > it gets fun is: > > sub foo :come_from('bar', int) { You've created an MMD come-from Uh... that hurts. I think using it for type-based, switch-like dispatch would

Re: Something to ponder

2004-08-18 Thread Dan Sugalski
At 6:20 PM -0400 8/17/04, Aaron Sherman wrote: On Tue, 2004-08-17 at 16:22, Felix Gallo wrote: On Tue, Aug 17, 2004 at 04:08:34PM -0400, Dan Sugalski wrote: > 1) We're going to have MMD for functions soon > 2) Function invocation and return continuation invocation's > essentially identical > 3

Re: Something to ponder

2004-08-17 Thread Aaron Sherman
On Tue, 2004-08-17 at 16:22, Felix Gallo wrote: > On Tue, Aug 17, 2004 at 04:08:34PM -0400, Dan Sugalski wrote: > > 1) We're going to have MMD for functions soon > > 2) Function invocation and return continuation invocation's > > essentially identical > > 3) Therefore returning from a sub/method c

Re: Something to ponder

2004-08-17 Thread Matt Fowles
Dan~ This is the coolest things I have heard all day. I am not sure that my brain is entirely around what situations it would be useful in yet. But it is really cool. It seems to me that it would probably be most useful in the tail call setting where you are just passing the result from one fun

Re: Something to ponder

2004-08-17 Thread Felix Gallo
On Tue, Aug 17, 2004 at 04:08:34PM -0400, Dan Sugalski wrote: > 1) We're going to have MMD for functions soon > 2) Function invocation and return continuation invocation's > essentially identical > 3) Therefore returning from a sub/method can do MMD return based on > the return values > > Someon