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

Can't use the >> hyperoperator with my-scoped user-defined operators in Rakudo #2017

Closed
p6rt opened this issue Aug 5, 2010 · 7 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 5, 2010

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

Searchable as RT77010$

@p6rt
Copy link
Author

p6rt commented Aug 5, 2010

From @masak

<masak> rakudo​: sub postfix​:<!>($n) { [*] 1..$n }; say (1, 2, 3)>>!
<p6eval> rakudo 19931f​: OUTPUT«===SORRY!===␤Could not find sub &postfix​:<!>␤»
* masak submits rakudobug
<masak> rakudo​: sub infix​:<+++>($a, $b) { ($a + $b) div 2 }; say 10 >>+++<< 14
<p6eval> rakudo 19931f​: OUTPUT«===SORRY!===␤Could not find sub &infix​:<+++>␤»
<masak> alester​: officially, it's in a repo.

@p6rt
Copy link
Author

p6rt commented Aug 5, 2010

From @masak

On Thu Aug 05 10​:33​:35 2010, masak wrote​:

<masak> rakudo​: sub postfix​:<!>($n) { [*] 1..$n }; say (1, 2, 3)>>!
<p6eval> rakudo 19931f​: OUTPUT«===SORRY!===␤Could not find sub
&postfix​:<!>␤»
* masak submits rakudobug
<masak> rakudo​: sub infix​:<+++>($a, $b) { ($a + $b) div 2 }; say 10

+++<< 14
<p6eval> rakudo 19931f​: OUTPUT«===SORRY!===␤Could not find sub
&infix​:<+++>␤»
<masak> alester​: officially, it's in a repo.

<TiMBuS> rakudo​: our sub infix​:<+++>($a, $b) { ($a + $b) div 2 }; say 10 >>+++<< 14
<p6eval> rakudo 19931f​: OUTPUT«12␤»
<masak> oh :/
<masak> should that be necessary?
<masak> I mean, I'm only using the +++ in the current scope.
<TiMBuS> nope. the bug has something to do with the dispatcher not looking in the scope
* masak adds TiMBuS' discovery to the ticket.

@p6rt
Copy link
Author

p6rt commented Aug 5, 2010

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

@p6rt
Copy link
Author

p6rt commented Aug 7, 2010

From @kyleha

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

commit 48c239ec94925a836af68bc090f38378cb3b4f4b
Author​: radus <radus@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sat Aug 7 17​:31​:04 2010 +0000

  [t/spec] Added test for RT 77010 use hypers with local scoped user defined operators.
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31921 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S03-metaops/hyper.t b/t/spec/S03-metaops/hyper.t
index 076a726..0d09abd 100644
--- a/t/spec/S03-metaops/hyper.t
+++ b/t/spec/S03-metaops/hyper.t
@@ -708,6 +708,14 @@ my @e;
     is ~@r, ~@e, 'dwimmy hyper extends lists ending with * by copying the last element';
 }
 
+# RT #77010
+
+#?rakudo skip 'RT 77010 - use hypers with local scoped user-defined operators'
+{
+    sub infix:<+++>($a, $b) { ($a + $b) div 2 };
+    eval_lives_ok '10 >>+++<< 14', 'can use hypers with local scoped user-defined operators';
+} 
+
 done_testing;
 
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Jan 11, 2012

From @coke

On Thu Aug 05 10​:33​:35 2010, masak wrote​:

<masak> rakudo​: sub postfix​:<!>($n) { [*] 1..$n }; say (1, 2, 3)>>!
<p6eval> rakudo 19931f​: OUTPUT«===SORRY!===␤Could not find sub
&postfix​:<!>␤»
* masak submits rakudobug
<masak> rakudo​: sub infix​:<+++>($a, $b) { ($a + $b) div 2 }; say 10

+++<< 14
<p6eval> rakudo 19931f​: OUTPUT«===SORRY!===␤Could not find sub
&infix​:<+++>␤»
<masak> alester​: officially, it's in a repo.

The first one now works​:

10​:21 < [Coke]> rakudo​: sub postfix​:<!>($n) { [*] 1..$n }; say (1, 2,
3)>>!
10​:21 <+p6eval> rakudo 38165a​: OUTPUT«1 2 6␤»

But the second does not​:

10​:21 < [Coke]> rakudo​: sub infix​:<+++>($a, $b) { ($a + $b) div 2 }; say
10
  >>+++<< 14
10​:21 <+p6eval> rakudo 38165a​: OUTPUT«===SORRY!===␤Missing << or >> at
line 1,
  near "++<< 14"␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 28, 2012

From @moritz

The tests pass now, closing ticket.

@p6rt
Copy link
Author

p6rt commented May 28, 2012

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

@p6rt p6rt closed this as completed May 28, 2012
@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