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

Junctions in array and hash indices don't work in Rakudo #688

Closed
p6rt opened this issue Feb 9, 2009 · 6 comments
Closed

Junctions in array and hash indices don't work in Rakudo #688

p6rt opened this issue Feb 9, 2009 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Feb 9, 2009

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

Searchable as RT63126$

@p6rt
Copy link
Author

p6rt commented Feb 9, 2009

From @masak

<moritz_> rakudo​: my @​a = "foo", "foot"; if @​a[all(0,1)] ~~ /^ foo/ {
say "OH MY!" }
<p6eval> rakudo 577566​: OUTPUT«get_integer() not implemented in class
'Junction [...]
<masak> so, does the fact that junctions are not handled in array and
hash indices reside somewhere in the long list of new or open bug
tickets on RT? :)
<moritz_> I don't know, I just know it's on rakudo.org somewhere
<masak> oh, what the heck. we can clean up duplicates later.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jun 30, 2010

From @bbkr

on Kiev build

[13​:23] <bbkr> rakudo​: my @​a = "foo", "foot"; if @​a[all(0,1)] ~~ /^ foo/
{ say "OH MY!" }
[13​:23] <p6eval> rakudo 261eb2​: OUTPUT«OH MY!␤»
[13​:23] <bbkr> yay

Taken for tests

@p6rt
Copy link
Author

p6rt commented Jun 30, 2010

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

@p6rt
Copy link
Author

p6rt commented Jun 30, 2010

From @bbkr

[13​:24] <bbkr> this test belongs more to array indexing or junctions or
smartmatch?
[13​:26] <masak> bbkr​: junctions, I'd say.

So tests added in t/spec/S03-junctions/misc.t (also for Hash).

@p6rt
Copy link
Author

p6rt commented Jun 30, 2010

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

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

p6rt commented Jun 30, 2010

From @kyleha

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

commit a583bfa22919ece174a30fb011d5fafbd155af1b
Author​: bbkr <bbkr@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Wed Jun 30 11​:35​:53 2010 +0000

  [t/spec] tests for RT #​63126 Junctions in array and hash indices dont work in Rakudo
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31511 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S03-junctions/misc.t b/t/spec/S03-junctions/misc.t
index c579844..d06a97e 100644
--- a/t/spec/S03-junctions/misc.t
+++ b/t/spec/S03-junctions/misc.t
@@ -400,6 +400,21 @@ ok Mu & Mu ~~ Mu, 'Mu & Mu ~~ Mu works';
     my @x = (6,7,8);
     jok(5 < @x.all, '.all method works on array objects');
 }
+
+# RT #63126
+{
+    my @a = "foo", "foot";
+    ok @a[all(0,1)] ~~ /^foo/,
+        'junction can be used to index Array';
+
+    my %h = (
+        "0" => "foo",
+        "1" => "foot"
+    );
+    ok %h{all(0,1)} ~~ /^foo/,
+        'junction can be used to index Hash';
+}
+
 done_testing();
 
 # vim: ft=perl6

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