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

Rakudo doesn't allow declaration of anonymous variables #1525

Closed
p6rt opened this issue Feb 19, 2010 · 6 comments
Closed

Rakudo doesn't allow declaration of anonymous variables #1525

p6rt opened this issue Feb 19, 2010 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 19, 2010

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

Searchable as RT72946$

@p6rt
Copy link
Author

p6rt commented Feb 19, 2010

From @masak

<masak> alpha​: my @​ = 1, 2, 3
<p6eval> alpha 30e0ed​: OUTPUT«Malformed declaration [...]
<masak> rakudo​: my @​ = 1, 2, 3
<p6eval> rakudo 3704a2​: OUTPUT«Malformed my [...]
* masak submits rakudobug
<pausenclown> whad did you expect here, masak? I mean, the array has no name
<masak> pausenclown​: :)
<pmichaud> std​: my @​ = 1, 2, 3
<p6eval> std 29779​: OUTPUT«ok 00​:01 109m␤»
<masak> pausenclown​: what pmichaud/STD.pm said.
<masak> rakudo​: my % = foo => 1, bar => 2
<p6eval> rakudo 3704a2​: OUTPUT«Malformed my [...]
<masak> rakudo​: my $ = 'OH HAI'
<pausenclown> std​: my @​ = 1, 2, 3; say @​[1]
<p6eval> rakudo 3704a2​: OUTPUT«Malformed my [...]

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

[16​:35] <moritz_> rakudo​: say (my @​ = 1, 2, 3 )
[16​:35] <p6eval> rakudo 0a8ef0​: OUTPUT«123␤»
[16​:35] <bbkr> rakudo​: (my % = foo => 1, bar => 2).perl.say
[16​:35] <p6eval> rakudo 0a8ef0​: OUTPUT«{"foo" => 1, "bar" => 2}␤»

taken for tests

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

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

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

tests added in t/spec/S04-declarations/my.t

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

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

@p6rt p6rt closed this as completed Aug 3, 2010
@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S04-declarations/my.t

commit 09af872d08dccd39998758c0ed5ae7e3cd9f37b2
Author​: bbkr <bbkr@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Tue Aug 3 14​:54​:41 2010 +0000

  [t/spec] tests for RT #​72946 Rakudo doesnt allow declaration of anonymous variables
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31897 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S04-declarations/my.t b/t/spec/S04-declarations/my.t
index c02ddac..f671634 100644
--- a/t/spec/S04-declarations/my.t
+++ b/t/spec/S04-declarations/my.t
@@ -1,7 +1,7 @@
 use v6;
 use Test;
 
-plan 65;
+plan 68;
 
 #L<S04/The Relationship of Blocks and Declarations/"declarations, all
 # lexically scoped declarations are visible"> 
@@ -260,4 +260,14 @@ eval_lives_ok 'my $x = 3; class A { has .$y = $x; }; say A.new.y',
     lives_ok {my ::a $a}, 'typing a my-declared variable as ::a works.';    #OK not used
 }
 
+# RT #72946
+{
+    is ( my $ = 'foo' ), 'foo',
+        'declaration of anonymous Scalar';
+    is ( my @ = 'foo', 'bar', 'baz' ), ['foo', 'bar', 'baz'],
+        'declaration of anonymous Array';
+    is ( my % = 'foo' => 1, 'bar' => 2, 'baz' => 3 ), {'foo' => 1, 'bar' => 2, 'baz' => 3},
+        'declaration of anonymous Hash';
+}
+
 # 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