develooper Front page | perl.perl6.language | Postings from February 2005

Re: Slurpy nullary vs nonslurpy nullary

Thread Previous | Thread Next
From:
Damian Conway
Date:
February 22, 2005 03:37
Subject:
Re: Slurpy nullary vs nonslurpy nullary
Message ID:
421B199C.1050205@conway.org
Autrijus wrote:

>>Personally, I think the only reasonable way of resolving this is to
>>assume (as in the last paragraph above) that function calls in these
>>kinds of indeterminate contexts are always in list context.
> 
> So, even if the clash is Num vs Str context, we still run it
> under List context?  Or is it their common ancestor, "Scalar"?

Yes. When I said "indeterminate contexts" I meant List vs Scalar. After all, 
the whole point of multimethods is to cope polymorphically with Num-vs-Str 
type clashes.


>>The dispatch resolution process is described in A12, under "Calling via
>>Multiple Dispatch". It's close to what you describe above, except the
>>"local vs global" distinction is a little more complex, and the
>>final discrimination is via C<is default>, not via C<Code> object
>>creation sequence.
> 
> Okay, I'll drop the Code creation order thing and make it raise a
> fatal error on ambiguity, then.  

But only if there isn't a variant marked C<is default>.

Damian

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About