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

@_ doesn't get the first argument #798

Closed
p6rt opened this issue Mar 18, 2009 · 9 comments
Closed

@_ doesn't get the first argument #798

p6rt opened this issue Mar 18, 2009 · 9 comments

Comments

@p6rt
Copy link

p6rt commented Mar 18, 2009

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

Searchable as RT63974$

@p6rt
Copy link
Author

p6rt commented Mar 18, 2009

From @moritz

00​:01 < moritz_> rakudo​: my $c = { say $_; say @​_.perl }; $c(2, 3, 4, 5)
00​:01 < p6eval> rakudo f8b6ae​: OUTPUT«2␤[3, 4, 5]␤»

It's probably right that $_ gets 2, but @​_[0] should also be 2.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Jul 28, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S06-signature/sub-ref.t

commit 5083fd82fecfbb1a527f1891758cc3c507c1816b
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Tue Jul 28 03​:14​:02 2009 +0000

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

Inline Patch
diff --git a/t/spec/S06-signature/sub-ref.t b/t/spec/S06-signature/sub-ref.t
index 570048d..60b81c0 100644
--- a/t/spec/S06-signature/sub-ref.t
+++ b/t/spec/S06-signature/sub-ref.t
@@ -4,7 +4,7 @@ use Test;
 
 # L<S02/"Built-In Data Types"> 
 
-plan 33;
+plan 35;
 
 =begin description
 
@@ -50,6 +50,19 @@ See L<S02/"Built-in Data Types"> for more information about Code, Routine, Sub,
     dies_ok { $foo.() }, "invocation of an parameterized block expecting a param without a param dies";
 }
 
+# RT #63974
+{
+    my $topic = 'topic unchanged';
+    my @topic_array = <topic array unchanged>;
+    my $c = { $topic = $_; @topic_array = @_ };
+
+    $c( 2, 3, 4, 5 );
+
+    is $topic, 2, '$_ got right value for code ref';
+    #?rakudo todo 'RT #63974'
+    is @topic_array, ( 2, 3, 4, 5 ), '@_ got right value in code ref';
+}
+
 {
     my $foo = sub { 100 + (@_[0] // -1) };
     isa_ok($foo, Code);

@p6rt
Copy link
Author

p6rt commented Jul 28, 2009

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

@p6rt
Copy link
Author

p6rt commented Oct 20, 2009

From @moritz

Tests pass, jnthn++.

@p6rt
Copy link
Author

p6rt commented Oct 20, 2009

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

@p6rt
Copy link
Author

p6rt commented Feb 23, 2010

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

@p6rt
Copy link
Author

p6rt commented Feb 23, 2010

From @moritz

After the 'ng' merge the tests are failing again (though they have been
changed in the mean time). Reopening ticket.

@p6rt
Copy link
Author

p6rt commented Jun 23, 2010

From @bbkr

They pass again on Kiev build.

perl t/harness --fudge --keep-exit-code --icu=0 --jobs
~/pugs/t/spec/S06-signature/sub-ref.t
/home/ppabian/pugs/t/spec/S06-signature/sub-ref....ok
  4/35 skipped​: various reasons
All tests successful, 4 subtests skipped.
Files=1, Tests=35, 3 wallclock secs ( 2.56 cusr + 0.10 csys = 2.66 CPU)

@p6rt
Copy link
Author

p6rt commented Jun 23, 2010

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

@p6rt p6rt closed this as completed Jun 23, 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