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

<<->> returns Bool::False rather than a list of subtraction results in Rakudo #2158

Closed
p6rt opened this issue Sep 12, 2010 · 5 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 12, 2010

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

Searchable as RT77800$

@p6rt
Copy link
Author

p6rt commented Sep 12, 2010

From @masak

<LoRe> rakudo​: print ([1..3] <<->> [1..3]).perl
<p6eval> rakudo fdae00​: OUTPUT«Bool​::False»
<LoRe> rakudo​: print ([1..3] <<+>> -<< [1..3]).perl
<p6eval> rakudo fdae00​: OUTPUT«[0, 0, 0]»
<masak> LoRe​: huh.
<masak> rakudo​: say ((1, 2, 3) <<->> (1, 2, 3)).perl
<p6eval> rakudo fdae00​: OUTPUT«Bool​::False␤»
<masak> rakudo​: say ((1, 2, 3) >>-<< (1, 2, 3)).perl
<p6eval> rakudo fdae00​: OUTPUT«[0, 0, 0]␤»
<masak> should those two differ? the arrays are of the same length.
<LoRe> rakudo​: print ([1..3] <<[-]>> [1..3]).perl
<p6eval> rakudo fdae00​: OUTPUT«[0, 0, 0]»
<LoRe> ok
<masak> oh!
<masak> it parses as either < or > and something.
<masak> I'm not sure how it manages to do that.
* masak submits rakudobug
<masak> LoRe++

@p6rt
Copy link
Author

p6rt commented Sep 30, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in S03-metaops/hyper.t

commit 71fdf1d837b6869d9826d6f4d058678eb62c668a
Author​: Kodi Arfer <hippo@​Thoth.(none)>
Date​: Wed Sep 29 20​:06​:05 2010 -0400

  [hyper.t] Added tests for RT #​77800.

Inline Patch
diff --git a/S03-metaops/hyper.t b/S03-metaops/hyper.t
index fbfc5bd..b9a2780 100644
--- a/S03-metaops/hyper.t
+++ b/S03-metaops/hyper.t
@@ -8,7 +8,7 @@ use Test;
 
 =end pod
 
-plan 265;
+plan 269;
 
 # L<S03/Hyper operators>
  # binary infix
@@ -717,7 +717,16 @@ my @e;
 
 # RT #74530
 {
-    is ~(-<<(1..3)), '-1 -2 -3', 'ranges and hyper ops mix';;
+    is ~(-<<(1..3)), '-1 -2 -3', 'ranges and hyper ops mix';
+}
+
+# RT #77800
+# Parsing hyper-subtraction
+{
+    is ((9, 8) <<-<< (1, 2, 3, 4)), (8, 6, 6, 4), '<<-<<';
+    is ((9, 8, 10, 12) >>->> (1, 2)), (8, 6, 9, 10), '>>->>';
+    is ((9, 8) >>-<< (1, 2)), (8, 6), '>>-<<';
+    is ((9, 8) <<->> (1, 2, 5)), (8, 6, 4), '<<->>';
 }
 
 done_testing;

@p6rt
Copy link
Author

p6rt commented Sep 30, 2010

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

@p6rt
Copy link
Author

p6rt commented Sep 30, 2010

From @Kodiologist

Fixed in fb57ef1. The culprit was an assertion in Grammar.pm that was
intended to prevent the "-" in "if $a -> { ... }" from parsing as
subtraction.

@p6rt
Copy link
Author

p6rt commented Sep 30, 2010

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

@p6rt p6rt closed this as completed Sep 30, 2010
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant