On Wed Oct 21 06:34:47 2015, lloyd.fo...@gmail.com wrote:
> lizmat++
> Fail is a good word. I didn't want to have to write throws an
> exception :o|
> 
> I don't totally get the concept of { * } so I won't comment whether
> defaults working makes sense or not but it's interesting to note that
> coercions don't work in a similar fashion:
> 
> class A {
> 
> proto method foo(Int() $x) {*}
> multi method foo($x) {
> 
> $x.WHAT.say; #-> Str
> 
> }
> }
> 
> A.foo('1');
> $x gets coerced but the coerced value doesn't travel downstream.
> 
I wouldn't expect it, nor defaults, to do so; the multis are still subs with 
their own signatures. Further, we rely on the ability to not have to really 
call an onlystar proto at all for optimization, and since all operators are 
multi-dispatch, that's important. Arguably, the use of certain features in an 
onlystar proto could add a note to the "potential difficulties", since it's 
very likely a thinko.

/jnthn

Reply via email to