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

Double zero when infix:<...> proceeds from -5 to ^5 #1830

Closed
p6rt opened this issue Jun 12, 2010 · 6 comments
Closed

Double zero when infix:<...> proceeds from -5 to ^5 #1830

p6rt opened this issue Jun 12, 2010 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 12, 2010

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

Searchable as RT75698$

@p6rt
Copy link
Author

p6rt commented Jun 12, 2010

From @masak

<masak> rakudo​: say (-5 ... ^5).perl
<p6eval> rakudo ae1300​: OUTPUT«(-5, -4, -3, -2, -1, 0, 0, 1, 2, 3, 4)␤»
<diakopter> std is rebuilding, I think
* masak submits rakudobug
<masak> rakudo​: say (-5 ... 5).perl
<p6eval> rakudo ae1300​: OUTPUT«(-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5)␤»
<masak> aha!

So it's the prefix​:<^> that does it. The infix​:<...> operator probably
steps up from -5 to 0, and then includes 0 again as the first value of
C<^5>.

@p6rt
Copy link
Author

p6rt commented Jun 28, 2010

From @pmichaud

This appears to be working in current master trunk; assigning to
moritz++ for spectest coverage and ticket closing.

Pm

@p6rt
Copy link
Author

p6rt commented Jun 28, 2010

@pmichaud - Status changed from 'new' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Jun 28, 2010

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

@p6rt
Copy link
Author

p6rt commented Jun 29, 2010

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

@p6rt p6rt closed this as completed Jun 29, 2010
@p6rt
Copy link
Author

p6rt commented Jun 29, 2010

From @kyleha

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

commit b0f602506f06761e471735595b380b601c30178a
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Tue Jun 29 09​:57​:00 2010 +0000

  [t/spec] test for RT #​75698, -5 ... ^5 should contain only one 0
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31496 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S03-operators/series.t b/t/spec/S03-operators/series.t
index 000a487..0e09041 100644
--- a/t/spec/S03-operators/series.t
+++ b/t/spec/S03-operators/series.t
@@ -138,6 +138,10 @@ is (1, -1, 1 ... -2), Nil, 'empty alternating series (2)';
     is ~(1 ...^ 0), '1', 'singleton exclusive series';
 }
 
+
+# RT #75698
+ok ?(one((-5 ... ^5).flat) == 0), '-5 ... ^5 produces just one zero';
+
 done_testing;
 
 # vim: ft=perl6

@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