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

Capture.perl doesn't show arg mutability #5588

Open
p6rt opened this issue Aug 17, 2016 · 3 comments
Open

Capture.perl doesn't show arg mutability #5588

p6rt opened this issue Aug 17, 2016 · 3 comments
Labels
LTA

Comments

@p6rt
Copy link

@p6rt p6rt commented Aug 17, 2016

Migrated from rt.perl.org#128978 (status was 'open')

Searchable as RT128978$

@p6rt
Copy link
Author

@p6rt p6rt commented Aug 17, 2016

From zefram@fysh.org

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

@p6rt
Copy link
Author

@p6rt p6rt commented Aug 18, 2016

From @dwarring

Same can also be said of other containers, including lists and pairs​:

my $l = (10, my $ = 20); $l[1]++; say $l.perl;
$(10, 21)
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​:

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

@p6rt
Copy link
Author

@p6rt p6rt commented Aug 18, 2016

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

@p6rt p6rt added the LTA label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.