Skip Menu |
Report information
Id: 128978
Status: open
Priority: 0/
Queue: perl6

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

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



Date: Wed, 17 Aug 2016 23:53:49 +0100
Subject: [LTA] Capture.perl doesn't show arg mutability
To: rakudobug [...] perl.org
From: Zefram <zefram [...] fysh.org>
Download (untitled) / with headers
text/plain 501b
Show quoted text
> my $a = 3; my $c = \($a); $c.perl
\(3) The fact that the argument in the Capture is mutable is a rather important aspect of the Capture, and the .perl isn't representing it. It's showing code for a quite different Capture of an immutable argument. This is less than awesome. Obviously .perl can't be expected to preserve the specific identity of the mutable argument, but it could at least preserve the fact that it's mutable, by emitting something like `\(my $ = 3)` in place of `\(3)`. -zefram
Download (untitled) / with headers
text/plain 853b
Same can also be said of other containers, including lists and pairs: Show quoted text
> my $l = (10, my $ = 20); $l[1]++; say $l.perl;
$(10, 21) Show quoted text
> my $p = (10 => my $ = 20); $p.value++; say $p.perl;
10 => 21 These also don't attempt to show mutability. On Wed Aug 17 15:54:05 2016, zefram@fysh.org wrote: Show quoted text
> > my $a = 3; my $c = \($a); $c.perl
> \(3) > > The fact that the argument in the Capture is mutable is a rather > important aspect of the Capture, and the .perl isn't representing it. > It's showing code for a quite different Capture of an immutable argument. > This is less than awesome. Obviously .perl can't be expected to preserve > the specific identity of the mutable argument, but it could at least > preserve the fact that it's mutable, by emitting something like `\(my $ > = 3)` in place of `\(3)`. > > -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