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

subst doesn't pass $/ to code in assignment (.= subst()) #3204

Closed
p6rt opened this issue Aug 7, 2013 · 4 comments
Closed

subst doesn't pass $/ to code in assignment (.= subst()) #3204

p6rt opened this issue Aug 7, 2013 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Aug 7, 2013

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

Searchable as RT119201$

@p6rt
Copy link
Author

p6rt commented Aug 7, 2013

From @softmoth

Rakudo fails to set $0 correctly when using the "$var .= subst()"
self-assignment form​:

[13​:42​:34] $ perl6 -e 'my $r = "VIIII"; my ($m, $d, $c) = <X V I>; $r .=
subst(rx/ ($d)? $c ** 4 /, { $0 ?? "$c$m" !!
"$c$d" }, :g); $r.say;'
IV

But it works correctly with the longer "$var = $var.subst()" form​:

[13​:43​:39] $ perl6 -e 'my $r = "VIIII"; my ($m, $d, $c) = <X V I>; $r =
$r.subst(rx/ ($d)? $c ** 4 /, { $0 ?? "$c$m"
!! "$c$d" }, :g); $r.say;'
IX

[13​:44​:00] $ perl6 --version
This is perl6 version 2013.07-113-g45e8c45 built on parrot 5.5.0 revision
RELEASE_5_5_0

@p6rt
Copy link
Author

p6rt commented Nov 6, 2013

@p6rt
Copy link
Author

p6rt commented Nov 6, 2013

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

@p6rt
Copy link
Author

p6rt commented Nov 6, 2013

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

@p6rt p6rt closed this as completed Nov 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant