# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #72790]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=72790 >


<TimToady> rakudo: my $result = 0xdeadbeef.?deadbeef; say $result
<p6eval> rakudo 1d4928: OUTPUT«Undefined value returned by invocation
of undefined method␤␤»
<TimToady> another case where rakudo returns a Failure that should
probably just return Nil
<jnthn> TimToady: Really?
<TimToady> I told it the call was optional
<jnthn> Hmm...true.
<masak> rakudo: my $a; say ($a.?foo).WHAT
<p6eval> rakudo 1d4928: OUTPUT«Failure()␤»
* masak submits rakudobug
<jnthn> The failure is easy to distinguish though. If I expected no
results, it's harder to distinguish that from "nothing was called".
<jnthn> That is, a method that just did return; would return Nil too, no?
<TimToady> sure, though we could distinguish those in slice context, presumably
<jnthn> Or if you were interesteed in the failure I guess use . and a try/CATCH
<jnthn> Since presumably you want to do something on the failure anyway.
<TimToady> I prefer exceptions to be reserved for unexpected things
<jnthn> Yeah, good point.
<TimToady> use of Failure as a normal return value is a design smell
<jnthn> OK, we'll Nil it. :-)
<jnthn> .oO( TimToady 1 - Nil jnthn )
<TimToady> basically, .* and by extension .? should return something
sliceable to get the number of successful returns as subparcels
<jnthn> Parcel of Parcels?
<TimToady> presumably
<jnthn> wfm
<masak> oh, that's an even better explanation.
<masak> it should be Nil because it's an empty list.
<masak> parallel to quantifier ? returning an empty list upon no match.
<TimToady> Parcel(Nil) is a real returned Nil, whille Nil is no parcels
<TimToady> masak: nodnod

Reply via email to