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

[**] has the wrong associativity in Rakudo #706

Closed
p6rt opened this issue Feb 18, 2009 · 11 comments
Closed

[**] has the wrong associativity in Rakudo #706

p6rt opened this issue Feb 18, 2009 · 11 comments

Comments

@p6rt
Copy link

p6rt commented Feb 18, 2009

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

Searchable as RT63306$

@p6rt
Copy link
Author

p6rt commented Feb 18, 2009

From @masak

<moritz_> pugs​: say [**] 2, 3, 4
<p6eval> pugs​: OUTPUT«2417851639229258349412352␤»
<moritz_> pugs​: say 2 ** 3 ** 4
<p6eval> pugs​: OUTPUT«2417851639229258349412352␤»
<moritz_> pugs​: say (2 ** 3) ** 4
<p6eval> pugs​: OUTPUT«4096␤»
<moritz_> bacek​: see? it does
<bacek> rakudo​: say [**] 2,3,4
<p6eval> rakudo 842ef3​: OUTPUT«4096␤»
<bacek> heh :)
<moritz_> care to submit a bug report? ;-)
* bacek summon masak :)
* masak submits a but report for bacek

@p6rt
Copy link
Author

p6rt commented Feb 19, 2009

From @masak

jonthan++ applied bacek++'s patch, so everything's fine now. resolving.

@p6rt
Copy link
Author

p6rt commented Feb 19, 2009

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

@p6rt
Copy link
Author

p6rt commented Feb 19, 2009

From @moritz

Hi,

Carl MXXsak (via RT) wrote​:

# New Ticket Created by "Carl Mäsak"
# Please include the string​: [perl #​63306]
# in the subject line of all future correspondence about this issue.
# <URL​: http://rt.perl.org/rt3/Ticket/Display.html?id=63306 >

<moritz_> pugs​: say [**] 2, 3, 4
<p6eval> pugs​: OUTPUT«2417851639229258349412352␤»
<moritz_> pugs​: say 2 ** 3 ** 4
<p6eval> pugs​: OUTPUT«2417851639229258349412352␤»
<moritz_> pugs​: say (2 ** 3) ** 4
<p6eval> pugs​: OUTPUT«4096␤»
<moritz_> bacek​: see? it does
<bacek> rakudo​: say [**] 2,3,4
<p6eval> rakudo 842ef3​: OUTPUT«4096␤»
<bacek> heh :)
<moritz_> care to submit a bug report? ;-)
* bacek summon masak :)
* masak submits a but report for bacek

It turned out that even infix​:<**> was erroneously left-associative,
which was fixed earlier (in parallel from bacek++ and me). The
associativity of the infix op still needs fixing.

Cheers,
Moritz
--
Moritz Lenz
http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/

@p6rt
Copy link
Author

p6rt commented Aug 1, 2009

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

@p6rt
Copy link
Author

p6rt commented Aug 1, 2009

From @kyleha

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

commit cdb7a947cead6a237dd2ce44551bcc555bb38168
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sat Aug 1 12​:02​:10 2009 +0000

  [t/spec] label test for RT #​63306
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;27829 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S03-operators/reduce-metaop.t b/t/spec/S03-operators/reduce-metaop.t
index 7e5a61e..adae355 100644
--- a/t/spec/S03-operators/reduce-metaop.t
+++ b/t/spec/S03-operators/reduce-metaop.t
@@ -25,7 +25,7 @@ L<"http://groups.google.de/group/perl.perl6.language/msg/bd9eb275d5da2eda">
   is(([*]  1,2,3),    (1*2*3), "[*] works");
   is(([-]  1,2,3),    (1-2-3), "[-] works");
   is(([/]  12,4,3),  (12/4/3), "[/] works");
-  #?rakudo todo 'associativity in reduce-metaop'
+  #?rakudo todo 'associativity in reduce-metaop (RT #63306)'
   is(([**] 2,2,3),  (2**2**3), "[**] works");
   is(([%]  13,7,4), (13%7%4),  "[%] works");
 

@p6rt
Copy link
Author

p6rt commented Aug 2, 2009

From ben@petering.net

This code​:

  say [**] 4,3,2

produces​:

  4096

But according to S03, ** is right associative, and (I think) the
reduction op is supposed to associate the same way. In other words,
the output should be​:

  262144

(The next line in S03/"Reduction operators" even has this exact
example that isn't matched by Rakudo's current behaviour​:

  [**] 4, 3, 2; # 4**3**2 = 4**(3**2) = 262144

Thanks to JimmyZ in #perl6 - submitted on his behalf as RT doesn't
like China. :(

@p6rt
Copy link
Author

p6rt commented Apr 3, 2010

From @jnthn

On Sun Aug 02 00​:07​:25 2009, missingthepoint wrote​:

This code​:

say [**] 4,3,2

produces​:

4096

But according to S03, ** is right associative, and (I think) the
reduction op is supposed to associate the same way. In other words,
the output should be​:

262144

This works now; assigning to moritz++ for tests.

Jonathan

1 similar comment
@p6rt
Copy link
Author

p6rt commented Apr 3, 2010

From @jnthn

On Sun Aug 02 00​:07​:25 2009, missingthepoint wrote​:

This code​:

say [**] 4,3,2

produces​:

4096

But according to S03, ** is right associative, and (I think) the
reduction op is supposed to associate the same way. In other words,
the output should be​:

262144

This works now; assigning to moritz++ for tests.

Jonathan

@p6rt
Copy link
Author

p6rt commented Apr 3, 2010

From @moritz

A test can be found in S03-metaops/reduce.t.

@p6rt
Copy link
Author

p6rt commented Apr 3, 2010

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

@p6rt p6rt closed this as completed Apr 3, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant