On Fri, Mar 22, 2013 at 03:31:57PM -0700, Carl Mäsak wrote:
> 
> <masak> rn: say .[*-1] given "perl" ... { 3 == ++state $ }
> <p6eval> rakudo 221a95: OUTPUT«perj␤»
> <p6eval> ..niecza v24-35-g5c06e28: OUTPUT«pern␤»
> * masak submits rakudobug
> 
> I'm just assuming this isn't spec'd behavior. I like Niecza's
> semantics better: use .succ if nothing else is indicated.

S03 has:

    For functions deduced when there is only one value on the left, 
    the final value is used to determine whether *.succ or *.pred is 
    more appropriate.  The two values are compared with C<cmp> to 
    determine the direction of the progression.

Rakudo evaluates C< "perl" cmp { ... } >   as C<Order::Decrease>,
therefore it's using the .pred/decreasing progression.

So, one of the following:
  a) &infix:<cmp> should produce a different result for Str vs Code
     (if so, what?),
  b) &infix:<...> should assume .succ if the final value is a Code object,
  c) Rakudo is correct, or
  d) Some other spec clarification or change needs to be made.

Pm

Reply via email to