On Sat Sep 18 10:55:52 2010, moritz wrote:
> Basic tests added to S03-operators/short-circuit.t.
> 
> 19:52 < moritz_> rakudo: my $x; $x &&= 5; say $x
> 19:52 <+p6eval> rakudo a204ba: OUTPUT«5␤»
> 19:52 < moritz_> somebody please confirm that this is wrong
> ...
> 19:53 < jnthn> moritz_: Looks wrong to me.

Rakudo is correct here -- see S03:3979:

  "If you apply an assignment operator to a container containing a
  type object (which is undefined), [...] the operation is defined
  in terms of the corresponding reduction operator, where the type
  object autovivifies to the operator's identity value."

The identity value for [&&] is True, so Rakudo has this correct.

By way of comparison, consider:  "my $x;  $x *= 5;"  which leaves $x
with the value of 5.

Pm

Reply via email to