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

substr-rw() doesn't handle short strings #2868

Closed
p6rt opened this issue Aug 21, 2012 · 6 comments
Closed

substr-rw() doesn't handle short strings #2868

p6rt opened this issue Aug 21, 2012 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Aug 21, 2012

Migrated from rt.perl.org#114526 (status was 'rejected')

Searchable as RT114526$

@p6rt
Copy link
Author

p6rt commented Aug 21, 2012

From @softmoth

I expect substr-rw to handle end positions that are out of range,
just like substr() itself does. However, it throws an error​:

my $p = 'ab'; substr-rw($p, 0, 3) = '/'; say "​::​:$p​::​:";
Start of substr out of range. Is​: 3, should be in 0..2

@p6rt
Copy link
Author

p6rt commented Jan 25, 2015

From @usev6

This works on Moar and JVM but dies on Parrot​:

$ perl6-m -e 'my $p = "ab"; substr-rw($p, 0, 3) = "/"; say "--$p--"' ## same output with perl6-j
--/--

$ perl6-p -e 'my $p = "ab"; substr-rw($p, 0, 3) = "/"; say "--$p--"'
Cannot take substr outside string
  in sub at gen/parrot/CORE.setting​:7740
  in any at gen/parrot/BOOTSTRAP.nqp​:308
  in block <unit> at -e​:1

I added a test (fudged 'skip') for Parrot with commit Raku/roast@7eb85d9e18.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jan 25, 2015

From @usev6

This works on Moar and JVM but dies on Parrot​:

$ perl6-m -e 'my $p = "ab"; substr-rw($p, 0, 3) = "/"; say "--$p--"' ## same output with perl6-j
--/--

$ perl6-p -e 'my $p = "ab"; substr-rw($p, 0, 3) = "/"; say "--$p--"'
Cannot take substr outside string
  in sub at gen/parrot/CORE.setting​:7740
  in any at gen/parrot/BOOTSTRAP.nqp​:308
  in block <unit> at -e​:1

I added a test (fudged 'skip') for Parrot with commit Raku/roast@7eb85d9e18.

@p6rt
Copy link
Author

p6rt commented Jan 25, 2015

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Feb 27, 2015

From @usev6

Since support for Parrot was suspended with Rakudo Star Release 2015.02, I'm closing this "parrot only" ticket.

I added the ticket to a list of closed ticket living in the Mu repository​: https://github.com/perl6/mu/blob/master/misc/rt.perl.org/tickets_closed_parrot_only.txt.

In case support for Parrot will be restored in some future release the listed tickets can be checked and re-opened as appropriate.

@p6rt
Copy link
Author

p6rt commented Feb 27, 2015

@usev6 - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant