Re: SEND + MORE = MONEY (works now in pugs with junctions!)

2005-03-11 Thread Rod Adams
Sam Vilain wrote: I've changed examples/sendmoremoney.p6 in the pugs distribution to use junctions correctly to demonstrate that they *can* be used to solve these sorts of problems, and that it is just a matter of semantics and writing code correctly. However, poor semantics can make the task of wr

Re: MMD as an object.

2005-03-11 Thread Rod Adams
Leopold Toetsch wrote: Rod Adams <[EMAIL PROTECTED]> wrote: If I were to need a different policy for a given method .bar, I would likely create something called .bar much like your "run_random_bar", which then dispatches amongst methods I name something like ._bar . I see some detractions t

Re: Adding linear interpolation to an array

2005-03-11 Thread Juerd
Larry Wall skribis 2005-03-11 8:45 (-0800): > On Fri, Mar 11, 2005 at 03:58:13PM +0100, Thomas Sandlaß wrote: > : Int @i; > : Num @n = @i; # type error? > I think the naive user is going to expect that to work, and I also > suspect the naive user is right to expect it, because it makes sense. > Th

Re: SEND + MORE = MONEY (works now in pugs with junctions!)

2005-03-11 Thread Luke Palmer
Larry Wall writes: > There's no doubt that the QM view of extended entanglement is very > useful. After all, that's what the whole universe runs on. But most > mortals will want the classical view to be the default, so we'll > require some kind of explicit markup or pragma if you want to extend >

Re: SEND + MORE = MONEY (works now in pugs with junctions!)

2005-03-11 Thread Larry Wall
There's no doubt that the QM view of extended entanglement is very useful. After all, that's what the whole universe runs on. But most mortals will want the classical view to be the default, so we'll require some kind of explicit markup or pragma if you want to extend entanglement further out tha

Re: Adding linear interpolation to an array

2005-03-11 Thread Larry Wall
On Fri, Mar 11, 2005 at 03:58:13PM +0100, Thomas Sandlaß wrote: : Int @i; : Num @n = @i; # type error? I think the naive user is going to expect that to work, and I also suspect the naive user is right to expect it, because it makes sense. This may be one of those areas where we can successfully h

Re: MMD as an object.

2005-03-11 Thread Leopold Toetsch
Rod Adams <[EMAIL PROTECTED]> wrote: > If I were to need a different policy for a given method .bar, I would > likely create something called .bar much like your "run_random_bar", > which then dispatches amongst methods I name something like ._bar . > I see some detractions to this approach: > 1)

Re: Adding linear interpolation to an array

2005-03-11 Thread Thomas Sandlaß
HaloO David, you wrote: I appreciate you attempting to explain this, but it remains clear as mud, at least to me. Could you please try again, using very short, very non-technical words and not assuming a mathematical or scientific background on the part of your reader? Ok, second attempt! The <: i

Re: Adding linear interpolation to an array

2005-03-11 Thread Thomas Sandlaß
Doug McNutt wrote: A word of caution: Just as in "vector operators" had their names changed to pacify the > mathematicians - thank you - there is a conflict in terms. Covariant and > contravariant tensors are the meat of Einstein's formulation of relativity. > It all has to do with transformation

Re: MMD as an object.

2005-03-11 Thread Rod Adams
Leopold Toetsch wrote: Ok. If you'd really need such random dispatch, it could be done like this, when I interpret A12 correctly: sub run_random_bar($x) { my @meths = WALKMETH($x, :method('bar')); my $meth = @meths[rand(@meths.elems)]; $meth($x); } or even with my sub bar($x) {...} #

Re: Junctions - feedback and desires

2005-03-11 Thread Rod Adams
Leopold Toetsch wrote: Rod Adams <[EMAIL PROTECTED]> wrote: Well if 10 < $j < 1 { ... } if 10 < $j { if $j < 1 { ... }} Could easily wind up with the same opcodes. No. In the first case $j is evaluated just once. In the second case it's evaluated twice. You're right. I just di

Re: MMD as an object.

2005-03-11 Thread Miroslav Silovic
[EMAIL PROTECTED] wrote: Ok. If you'd really need such random dispatch, it could be done like this, when I interpret A12 correctly: sub run_random_bar($x) { my @meths = WALKMETH($x, :method('bar')); my $meth = @meths[rand(@meths.elems)]; $meth($x); } or even with my sub bar($x) {...}

Re: MMD as an object.

2005-03-11 Thread Bob Rogers
From: Leopold Toetsch <[EMAIL PROTECTED]> Date: Thu, 10 Mar 2005 10:53:11 +0100 Rod Adams <[EMAIL PROTECTED]> wrote: > 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 int

Re: Junctions - feedback and desires

2005-03-11 Thread Leopold Toetsch
Rod Adams <[EMAIL PROTECTED]> wrote: > Well > if 10 < $j < 1 { ... } > if 10 < $j { if $j < 1 { ... }} > Could easily wind up with the same opcodes. No. In the first case $j is evaluated just once. In the second case it's evaluated twice. leo

Re: MMD as an object.

2005-03-11 Thread Leopold Toetsch
Rod Adams <[EMAIL PROTECTED]> wrote: > Leopold Toetsch wrote: >>Discussion seems to have went off into esoteric cases of locally >>overriden dispatcher policies and what not. > I don't think it's as esoteric as you might think. Consider: > package Foo; > use MMD::Random; > our &bar

Re: MMD as an object.

2005-03-11 Thread Leopold Toetsch
Bob Rogers <[EMAIL PROTECTED]> wrote: >From: Leopold Toetsch <[EMAIL PROTECTED]> >1) is there a MultiSub object with one short name that holds all >possible long names (and function references)? >If yes, who is creating it: the Perl6 compiler emits code to do so or >it's up to