Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'X' meta-operator fails with RHS input from parenthesized output of another 'X' #4729

Closed
p6rt opened this issue Nov 4, 2015 · 5 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Nov 4, 2015

Migrated from rt.perl.org#126563 (status was 'resolved')

Searchable as RT126563$

@p6rt
Copy link
Author

p6rt commented Nov 4, 2015

From dhoekman@gmail.com

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.

@p6rt
Copy link
Author

p6rt commented Mar 8, 2018

From @dogbert17

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.

@p6rt
Copy link
Author

p6rt commented Mar 8, 2018

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 10, 2018

From @dogbert17

On Thu, 08 Mar 2018 09​:52​:50 -0800, jan-olof.hendig@​bredband.net wrote​:

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.

Tests added with roast commit Raku/roast@b68073aa15

@p6rt
Copy link
Author

p6rt commented Mar 10, 2018

@dogbert17 - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant