On Wed, Jan 02, 2008 at 08:52:09AM -0800, Larry Wall wrote:
> On Tue, Jan 01, 2008 at 04:26:29PM -0600, Patrick R. Michaud wrote:
> : I'm working on S03 tests, and S03 says:
> : 
> :     Perl 6 also supports Str decrement with similar semantics, 
> :     simply by running the cycles the other direction. However,
> :     leftmost characters are never removed, and the decrement 
> :     fails when you reach a string like "aaa" or "000".
> : 
> : Is this "fails" as in "throws an Exception", "mutates into an
> : undef / Failure / Exception object", or something else entirely?
> 
> In the context of normal Perl expressions, "fails" should always be
> read as "returns a Failure object".  Which, of course, is immediately
> fatal under "use fatal".  Otherwise it's lazily fatal.

Ah, you answered my followup question ("Is this meaning of 'fails'
fairly consistent?").  Excellent.

Howeven, "returns a Failure object" in this context (autodecrement)
still seems a bit ambiguous, because the return values of autoincrement
and autodecrement are often ignored, as in:

    my $s = 'A00';
    $s--;
    say $s;

So, what happens in the above?  Does $s become a Failure object?
Does autodecrement recognize that it's in void context and thus
becomes immediately fatal?

> In fact, the places in the spec that say "returns a Failure object"
> should probably be rewritten to say "fails" to keep people from
> thinking that it means something other than "fails".

Agreed -- I'll fix them as I find them (or point them out if I'm uncertain).

Thanks again!

Pm

Reply via email to