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 does not work with $length = Inf #2906

Closed
p6rt opened this issue Sep 30, 2012 · 4 comments
Closed

substr does not work with $length = Inf #2906

p6rt opened this issue Sep 30, 2012 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 30, 2012

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

Searchable as RT115086$

@p6rt
Copy link
Author

p6rt commented Sep 30, 2012

From @edwinst

Passing Inf for the $length parameter of substr does not work​:

"abcd".substr(2,Inf)
This type cannot unbox to a native integer

Rakudo itself suggests that Inf should work in the following error message​:

"abcd".substr(2,-1)
Length argument to substr out of range. Is​: -1, should be in 0..Inf; use *-1 if you want to index relative to the end

$ ./perl6 --version
This is perl6 version 2012.09.1 built on parrot 4.4.0 revision RELEASE_4_4_0

@p6rt
Copy link
Author

p6rt commented Nov 30, 2012

From @FROGGS

rakudo 2012-11​:
<FROGGS> r​: say "abcd".substr(2, Inf)
<p6eval> rakudo 7ede6c​: OUTPUT«cd␤»

Test​:
Raku/roast@0532e2d

@p6rt
Copy link
Author

p6rt commented Nov 30, 2012

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

@p6rt
Copy link
Author

p6rt commented Nov 30, 2012

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

@p6rt p6rt closed this as completed Nov 30, 2012
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant