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

some singleton Slips deparse incorrectly #4863

Open
p6rt opened this issue Dec 13, 2015 · 1 comment
Open

some singleton Slips deparse incorrectly #4863

p6rt opened this issue Dec 13, 2015 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 13, 2015

Migrated from rt.perl.org#126902 (status was 'new')

Searchable as RT126902$

@p6rt
Copy link
Author

p6rt commented Dec 13, 2015

From zefram@fysh.org

The fix for [perl #​126897] assumes that a slip(...) constructor expression
parses equivalently to (...) list construction, at least in cases where
the expression in the parens does construct a list. This turns out not to
be the case for some singleton lists, leading to some round-trip failures​:

([1,2],).Slip.perl
slip([1, 2],)
([1,2],).Slip.perl.EVAL.perl
slip(1, 2)

I think the array unwrapping when evaluating the slip([1,2],) expression
is intentional, and thus the .perl method on Slip is erroneous in not
taking account of that effect when generating a slip(...) expression.
Incidentally, there's a related LTA​:

slip(2).perl
slip(2,)

For list construction that comma is necessary, but it's not required
(but is legal) in the slip() argument list. It would be preferable to
omit it in this output.

A simple fix would be for the .perl method to postfix ".Slip" to the list
constructor expression rather than prefix "slip". This would actually
use the list constructor expression in its intended syntactic environment.

-zefram

@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