Re: Can foo("123") dispatch to foo(Int) (was: Mutil Method Questions)

2006-06-27 Thread TSa
HaloO, Paul Hodges wrote: so back to foo("bar"). What's the default behavior? String doesn't Num, does it? though is does convert if the value is good I think that Str and Num are disjoint mutually exclusive types. If you want to get coercive behaviour you need an overloaded &foo:(Str|Num

Re: Can foo("123") dispatch to foo(Int) (was: Mutil Method Questions)

2006-06-24 Thread Paul Hodges
so back to foo("bar"). What's the default behavior? String doesn't Num, does it? though is does convert if the value is good Does that mean foo("123") should or should not dispatch to foo(Int)? Or even foo(Num), for that matter Oy, I could see some headaches around setting these rules in

Re: Can foo("123") dispatch to foo(Int) (was: Mutil Method Questions)

2006-06-23 Thread Jonathan Scott Duff
On Fri, Jun 23, 2006 at 09:11:44PM +0300, Markus Laire wrote: > And what about other types? > e.g. if String can't ever be "best candidate" for Int, then does that > mean that neither can Int ever be "best candidate" for Num, because > they are different types? Well, I think Num and Int *aren't* d

Can foo("123") dispatch to foo(Int) (was: Mutil Method Questions)

2006-06-23 Thread Markus Laire
I'm sending this also to perl6-language, in case someone there knows an answer to this. On 6/23/06, Jonathan Scott Duff <[EMAIL PROTECTED]> wrote: I don't think so. I think the "best candidate" prose is about choosing from types that have been specified, not autoconverting between types such tha