Re: multi method dispatching of optional arguments (further refined)

2006-09-11 Thread Larry Wall
On Mon, Sep 04, 2006 at 10:52:35PM -0700, Trey Harris wrote: : In a message dated Tue, 5 Sep 2006, Ph. Marek writes: : >I now had a look at http://dev.perl.org/perl6/doc/design/syn/S06.html : >but didn't find what I meant. Sorry if I'm just dumb and don't : >understand you (or S06); I'll try to e

Re: multi method dispatching of optional arguments (further refined)

2006-09-05 Thread Ruud H.G. van Tol
Ph. Marek schreef: > [Haskell] > SomeThing a b > | a = 4 : b+2 > | b = 3 : a+1 > | otherwise : a*b > > In Perl5 this looks like > > sub SomeThing > { > my($a, $b)[EMAIL PROTECTED]; > > return b+2 if ($a == 4); > return a+1 if ($b == 3); > return a*b; > } Or like: sub SomeThing

Re: multi method dispatching of optional arguments (further refined)

2006-09-04 Thread Ph. Marek
On Tuesday 05 September 2006 07:52, Trey Harris wrote: > I don't think you're dumb; the Synopses just require that you intuit > certain things from each other, from examples in other Synopses, and so on > in a Perlish sort of way; what you're looking for is not spelled out > explicitly. It can be

Re: multi method dispatching of optional arguments (further refined)

2006-09-04 Thread Trey Harris
In a message dated Tue, 5 Sep 2006, Ph. Marek writes: I now had a look at http://dev.perl.org/perl6/doc/design/syn/S06.html but didn't find what I meant. Sorry if I'm just dumb and don't understand you (or S06); I'll try to explain what I mean. I don't think you're dumb; the Synopses just requ

Re: multi method dispatching of optional arguments (further refined)

2006-09-04 Thread Ph. Marek
On Monday 04 September 2006 16:21, Audrey Tang wrote: > 2006/9/4, Ph. Marek <[EMAIL PROTECTED]>: > > Excuse me for getting into this thread with only minor knowledge about > > perl6, but will there be MMD based on the *value* of parameters? Like > > Haskell has. > > Why, yes, see the various Unpack

Re: multi method dispatching of optional arguments (further refined)

2006-09-04 Thread Audrey Tang
2006/9/4, Ph. Marek <[EMAIL PROTECTED]>: On Sunday 03 September 2006 14:25, Mark Stosberg wrote: > Luke Palmer wrote: > > On 9/3/06, Mark Stosberg <[EMAIL PROTECTED]> wrote: > >> Note that the variant /with/ the parameter can be considered an exact > >> match, but but the variant /without/ it can

Re: multi method dispatching of optional arguments (further refined)

2006-09-03 Thread Ph. Marek
On Sunday 03 September 2006 14:25, Mark Stosberg wrote: > Luke Palmer wrote: > > On 9/3/06, Mark Stosberg <[EMAIL PROTECTED]> wrote: > >> Note that the variant /with/ the parameter can be considered an exact > >> match, but but the variant /without/ it cannot be considered an exact > >> match. Excu

Re: multi method dispatching of optional arguments (further refined)

2006-09-03 Thread Mark Stosberg
Luke Palmer wrote: > I don't follow your examples. What is the logic behind them? > > On 9/3/06, Mark Stosberg <[EMAIL PROTECTED]> wrote: >> Examples: >>Arguments (<1 2>) to signatures 1. (@a?) and 2. (@a) calls 2 > > For example, I would expect this one to be ambiguous, because the 1. > (@a

Re: multi method dispatching of optional arguments (further refined)

2006-09-02 Thread Luke Palmer
I don't follow your examples. What is the logic behind them? On 9/3/06, Mark Stosberg <[EMAIL PROTECTED]> wrote: Examples: Arguments (<1 2>) to signatures 1. (@a?) and 2. (@a) calls 2 For example, I would expect this one to be ambiguous, because the 1. (@a?) sub introduces two different si

Re: multi method dispatching of optional arguments (further refined)

2006-09-02 Thread Mark Stosberg
Mark Stosberg wrote: > Hello, > > I think it would helpful if the spec addressed "who wins" in MMD when > optional arguments are present. > > I just submitted these failing tests for pugs which illustrate the > issue. > > not ok 11 - Arguments (a => 'b') to signatures 1. () and 2. (*%h) calls 2

Re: multi method dispatching of optional arguments

2006-09-02 Thread Mark Stosberg
Mark Stosberg wrote: > Hello, > > I think it would helpful if the spec addressed "who wins" in MMD when > optional arguments are present. > > I just submitted these failing tests for pugs which illustrate the > issue. > > not ok 11 - Arguments (a => 'b') to signatures 1. () and 2. (*%h) calls 2