MMD as an object.

2005-03-08 Thread Rod Adams
It seems to me that there are several advantages to making a group of multi with the same short name a single object, of type MultiSub|MultiMethod, which internally holds references to the all the various routines that share that short name. It would behave like a tied sub (or method), with a .

Re: some misc Perl 6 questions

2005-03-08 Thread Darren Duncan
Thanks for your feedback Larry; much appreciated it is. A few more interesting things happened since then, which can be seen in the current version of Locale::KeyedText in the Pugs version control. At 5:35 PM -0800 3/8/05, Larry Wall wrote: : 8. Is it possible with a sub or method argument signi

Re: Argument Patterns

2005-03-08 Thread Rod Adams
Autrijus Tang wrote: On Tue, Mar 08, 2005 at 04:55:28PM -0600, Rod Adams wrote: I thought Larry already declared that we are not making Perl act like ML (yet). And that was re: type inferencing, not re: pattern matching. :) Thanks, /Autrijus/ Sorry about that. Comcast has decided I only

Re: Argument Patterns

2005-03-08 Thread Autrijus Tang
On Tue, Mar 08, 2005 at 04:55:28PM -0600, Rod Adams wrote: > I thought Larry already declared that we are not making Perl act like ML > (yet). And that was re: type inferencing, not re: pattern matching. :) Thanks, /Autrijus/ pgp3tE8H37UB0.pgp Description: PGP signature

Re: Decorating Objects with Roles (was Re: Optional binding)

2005-03-08 Thread chromatic
On Tue, 2005-03-08 at 17:39 -0800, Larry Wall wrote: > On Tue, Mar 08, 2005 at 03:23:14PM -0800, chromatic wrote: > : I could make the argument that it should be possible to decorate an > : object with a role. If that means generating a new anonymous class just > : to have a vtable to munge, so

Re: Adding linear interpolation to an array

2005-03-08 Thread Larry Wall
On Tue, Mar 08, 2005 at 03:21:42PM -0700, Luke Palmer wrote: : > 3) I guess the distance function is not specified yet, right? : : It was specified as simple manhattan. I've been arguing for the past : year to get this changed (to 'pure', where there is no distance : function; two methods, which

Re: Decorating Objects with Roles (was Re: Optional binding)

2005-03-08 Thread Larry Wall
On Tue, Mar 08, 2005 at 03:23:14PM -0800, chromatic wrote: : I could make the argument that it should be possible to decorate an : object with a role. If that means generating a new anonymous class just : to have a vtable to munge, so be it. Er, how is that different from what we already said? O

Re: some misc Perl 6 questions

2005-03-08 Thread Larry Wall
On Tue, Mar 08, 2005 at 03:50:41PM -0800, Darren Duncan wrote: : Greetings, : : I have just started to write a large amount of Perl 6 code, partly to : help with testing the Pugs (and later Parrot) implementation of the : language. During this process, I discovered a few details about Perl : 6

some misc Perl 6 questions

2005-03-08 Thread Darren Duncan
Greetings, I have just started to write a large amount of Perl 6 code, partly to help with testing the Pugs (and later Parrot) implementation of the language. During this process, I discovered a few details about Perl 6 that I don't yet understand, and haven't yet been able to get answers to i

Decorating Objects with Roles (was Re: Optional binding)

2005-03-08 Thread chromatic
On Mon, 2005-03-07 at 19:40 -0800, Larry Wall wrote: > On Mon, Mar 07, 2005 at 05:56:12PM -0800, David Storrs wrote: > : Actually, I guess they would have to be...can you apply a role to a > : bare type? > : > : my int does SelectOutputFile; # I would expect this to fail > : my Int d

Re: Argument Patterns

2005-03-08 Thread Rod Adams
Luke Palmer wrote: All this Haskell programming has opened my eyes to what our multimethod dispatch could be. As we have seen with C, the dispatch system is a pattern matcher. But it's a pretty terrible one. I think we should replace our multimethod system with a more general pattern matcher, a

Re: Adding linear interpolation to an array

2005-03-08 Thread Luke Palmer
Thomas Sandlaà writes: > Larry Wall wrote: > >One can always mixin a "does LinearInterpolation" at run time in the > >body of the sub to get the effect of a directive, so I think the most > >useful thing is to treat roles in signatures as constraints where > >they can be used to select for MMD. >

Re: Adding linear interpolation to an array

2005-03-08 Thread Juerd
Larry Wall skribis 2005-03-08 9:42 (-0800): > Maybe we need to work in the linguistic notion of "pretends to be" > somehow. If this needs a keyword, I suggest "plays" :) Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajig

Re: Adding linear interpolation to an array

2005-03-08 Thread Thomas Sandlaß
Larry Wall wrote: One can always mixin a "does LinearInterpolation" at run time in the body of the sub to get the effect of a directive, so I think the most useful thing is to treat roles in signatures as constraints where they can be used to select for MMD. Further questions concerning MMD: 1) How

Argument Patterns

2005-03-08 Thread Luke Palmer
All this Haskell programming has opened my eyes to what our multimethod dispatch could be. As we have seen with C, the dispatch system is a pattern matcher. But it's a pretty terrible one. I think we should replace our multimethod system with a more general pattern matcher, a "variadic multimet

Re: Adding linear interpolation to an array

2005-03-08 Thread Larry Wall
On Tue, Mar 08, 2005 at 10:19:10AM +0100, Thomas Sandlaß wrote: : >Or perhaps even : > : >sub foo (Num @in is copy does LinearInterpolation) : >{ : > ... : >} : : This is my big questionmark on roles: is the above a contraint : or merely a directive. In the former case only Arrays of Num that :

Re: Adding linear interpolation to an array

2005-03-08 Thread Dave Whipp
Thomas Sandlaß wrote: Or perhaps even sub foo (Num @in is copy does LinearInterpolation) { ... } This is my big questionmark on roles: is the above a contraint or merely a directive. In the former case only Arrays of Num that do LinearInterpolation are allowed, in the latter case every Array of

Re: Adding linear interpolation to an array

2005-03-08 Thread Thomas Sandlaß
Dave Whipp wrote: I don't see why I need the conditional there. If I'm going to copy the array, I might as well declare up front the that darget does LinearInterpolation: sub foo (Num @raw_in) { my Num @in does LinearInterpolation = @raw_in; ... } This depends on how initialization works.