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

Change to List.perl #757

Closed
p6rt opened this issue Mar 8, 2009 · 5 comments
Closed

Change to List.perl #757

p6rt opened this issue Mar 8, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Mar 8, 2009

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

Searchable as RT63724$

@p6rt
Copy link
Author

p6rt commented Mar 8, 2009

From @pmichaud

For someone looking for something to do -- the recent change to
evaluating List objects in item context means that List.perl
likely needs to change also.

In particular, currently List.perl produces square brackets in its
output; it should probably now produce either parentheses or a Capture
constructor. The spectests may need some updating as well.

Some examples​:

  (1,2,3).perl; # old​: "[1,2,3]" new​: "(1,2,3)" or "\(1,2,3)"
  (1,).perl; # old​: "[1]" new​: "(1,)" or "\(1)"

Thanks,

Pm

@p6rt
Copy link
Author

p6rt commented Jul 24, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S02-names_and_variables/perl.t

commit 7a029f8dfbb76deae6424164fc8e500b14879ee2
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Fri Jul 24 21​:22​:30 2009 +0000

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

Inline Patch
diff --git a/t/spec/S02-names_and_variables/perl.t b/t/spec/S02-names_and_variables/perl.t
index 36fa24e..2cad9ea 100644
--- a/t/spec/S02-names_and_variables/perl.t
+++ b/t/spec/S02-names_and_variables/perl.t
@@ -55,7 +55,7 @@ my @tests = (
     [ { :a(1) }, { :b(2), :c(3) } ],
 );
 
-plan 12 + 2*@tests;
+plan 16 + 2*@tests;
 #?pugs emit force_todo 8, 45..50, 94, 96;
 
 #?pugs emit unless $?PUGS_BACKEND eq "BACKEND_PUGS" {
@@ -168,3 +168,24 @@ plan 12 + 2*@tests;
 
     # TODO: more tests that show eval($t1_init) has the same guts as $t1.
 }
+
+# RT #63724
+{
+    my @original      = (1,2,3);
+    my $dehydrated    = @original.perl;
+    my @reconstituted = eval $dehydrated;
+
+    is @reconstituted, @original,
+       "eval of .perl returns original for '$dehydrated'";
+    #?rakudo todo 'RT #63724'
+    ok $dehydrated ~~ / '(' .* ',' .* ')' /, 'List.perl has parens and comma';
+
+    @original = (1,);
+    $dehydrated    = @original.perl;
+    @reconstituted = eval $dehydrated;
+
+    is @reconstituted, @original,
+       "eval of .perl returns original for '$dehydrated'";
+    #?rakudo todo 'RT #63724'
+    ok $dehydrated ~~ / '(' .* ',' .* ')' /, 'List.perl has parens and comma';
+}

@p6rt
Copy link
Author

p6rt commented Jul 24, 2009

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

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

From @moritz

Seq.perl (the new List.perl) now properly produces (1, 2, 3)

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

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

@p6rt p6rt closed this as completed Mar 9, 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