Skip Menu |
Report information
Id: 126902
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: zefram [at] fysh.org
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] some singleton Slips deparse incorrectly
To: rakudobug [...] perl.org
From: Zefram <zefram [...] fysh.org>
Date: Sun, 13 Dec 2015 21:50:14 +0000
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: Show quoted text
> ([1,2],).Slip.perl
slip([1, 2],) Show quoted text
> ([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: Show quoted text
> 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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org