develooper Front page | perl.perl6.compiler | Postings from March 2018

[perl #126563] [BUG] 'X' meta-operator fails with RHS input fromparenthesized output of another 'X'

Thread Previous
From:
Jan-Olof Hendig via RT
Date:
March 8, 2018 17:53
Subject:
[perl #126563] [BUG] 'X' meta-operator fails with RHS input fromparenthesized output of another 'X'
Message ID:
rt-4.0.24-28612-1520531570-310.126563-80-0@perl.org
On Wed, 04 Nov 2015 12:43:18 -0800, dhoekman@gmail.com wrote:
> In perl6 version 2015.10-158-gbccb16d built on MoarVM version
> 2015.10-46-g5bf7e46:
> 
> Looking at the code for Hamming numbers at Rosetta Code found this problem:
> 
> my @z = <1 2>;
> say  @z X*  @z  X* @z;            # OK
> say (@z X*  @z) X* @z;            # OK
> say  @z X* (@z  X* @z).Array; # OK
> say  @z X* (@z  X* @z);          # fails
> 
> (1 2 2 4 2 4 4 8)
> (1 2 2 4 2 4 4 8)
> (1 2 2 4 2 4 4 8)
> ===SORRY!===
> Cannot invoke this object (REPR: Uninstantiable)
> 
> Likewise fails for other arithmetic operations (+, -, /, **), as well as:
> 
> my @y = <a b>;
> say  @y X~ (@y  X~ @y);          # fails
> 
> But ','  works with both @x and @y.

This was fixed with commit a26f51361bfea213fa59749d7a401e09c8f2ef31. Tests needed.


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About