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

Match objects don't roundtrip through .perl #4282

Closed
p6rt opened this issue May 30, 2015 · 10 comments
Closed

Match objects don't roundtrip through .perl #4282

p6rt opened this issue May 30, 2015 · 10 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 30, 2015

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

Searchable as RT125293$

@p6rt
Copy link
Author

p6rt commented May 30, 2015

From @coke

There's a failing test in S05-match/perl.t for this.

Looks like the topmost "hash" attribute isn't the same.

# expected​: Match.new(ast => Any, list => (), hash =>
EnumMap.new(​:operator([Match.new(ast => Any, list => (), hash =>
EnumMap.new(), orig => "2 + 4", to => 3, from => 2)])), orig => "2 +
4", to => 5, from => 0)
# got​: Match.new(ast => Any, list => (), hash => EnumMap.new(),
orig => "2 + 4", to => 5, from => 0)

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 30, 2015

From @coke

Additionally, there's a test that refers to <operator> on the match object, which dies with​:

This representation (Null) does not support associative access
  in block <unit> at t/spec/S05-match/perl.rakudo.moar​:23

That is skipped.

--
Will "Coke" Coleda

1 similar comment
@p6rt
Copy link
Author

p6rt commented May 30, 2015

From @coke

Additionally, there's a test that refers to <operator> on the match object, which dies with​:

This representation (Null) does not support associative access
  in block <unit> at t/spec/S05-match/perl.rakudo.moar​:23

That is skipped.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jun 6, 2015

From @usev6

As far as I understand it, the problem can be golfed to the following​:

$ perl6 -e 'say EnumMap.new("a", 42).perl'
EnumMap.new(​:a(42))

$ perl6 -e 'say EnumMap.new("a", 42).perl.perl'
"EnumMap.new(​:a(42))"

$ perl6 -e 'say EnumMap.new("a", 42).perl.EVAL'
EnumMap.new()

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 6, 2015

From @usev6

As far as I understand it, the problem can be golfed to the following​:

$ perl6 -e 'say EnumMap.new("a", 42).perl'
EnumMap.new(​:a(42))

$ perl6 -e 'say EnumMap.new("a", 42).perl.perl'
"EnumMap.new(​:a(42))"

$ perl6 -e 'say EnumMap.new("a", 42).perl.EVAL'
EnumMap.new()

@p6rt
Copy link
Author

p6rt commented Jun 6, 2015

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

@p6rt
Copy link
Author

p6rt commented Jun 7, 2015

From @lizmat

On 06 Jun 2015, at 13​:45, Christian Bartolomaeus via RT <bugs-comment@​bugs6.perl.org> wrote​:

As far as I understand it, the problem can be golfed to the following​:

$ perl6 -e 'say EnumMap.new("a", 42).perl'
EnumMap.new(​:a(42))

$ perl6 -e 'say EnumMap.new("a", 42).perl.perl'
"EnumMap.new(​:a(42))"

$ perl6 -e 'say EnumMap.new("a", 42).perl.EVAL'
EnumMap.new()

FWIW, PairMap currently suffers the same issue. And Hash would as well, if TimToday hadn’t implemented the new <> decont notation and then change the .perl output to using {}.

:-(

Not sure whether to fix .new on these, the underlying STORE, or .perl.

Liz

@p6rt
Copy link
Author

p6rt commented Sep 12, 2017

From @usev6

The tests in question have been unfudged with roast commit Raku/roast@6db316eaae. (This was probably fixed with merging the 'uncurse' branch.)

The last example from the last comment (using EVAL) works as expected, too​:

$ ./perl6-m -e 'say Map.new("a", 42).perl.EVAL'
Map.new((​:a(42)))

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Sep 12, 2017

From @usev6

The tests in question have been unfudged with roast commit Raku/roast@6db316eaae. (This was probably fixed with merging the 'uncurse' branch.)

The last example from the last comment (using EVAL) works as expected, too​:

$ ./perl6-m -e 'say Map.new("a", 42).perl.EVAL'
Map.new((​:a(42)))

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Sep 12, 2017

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

@p6rt p6rt closed this as completed Sep 12, 2017
@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