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

Inconsistent interface among .substr/.substr-eq/.substr-rw #1720

Open
zoffixznet opened this issue Apr 9, 2018 · 0 comments
Open

Inconsistent interface among .substr/.substr-eq/.substr-rw #1720

zoffixznet opened this issue Apr 9, 2018 · 0 comments

Comments

@zoffixznet
Copy link
Contributor

zoffixznet commented Apr 9, 2018

I'd imagine these routines are similar enough that they'd be able to take the same args, but non-.substr candidates don't seem to be able to take Callables and don't coerce non-Int args to Ints.

<Zoffix__> m: say "Long string".substr: 3, {6}
<camelia> rakudo-moar 404f30217: OUTPUT: «g stri␤»
<Zoffix__> m: say "Long string".substr-eq: 3, {6}
<camelia> rakudo-moar 404f30217: OUTPUT: «Cannot resolve caller substr-eq(Str: Int, Block); none of these signatures match:␤    (Str:D $: Cool:D $needle, *%_)␤    (Str:D $: Str:D $needle, *%_)␤    (Str:D $: Cool:D $needle, Int:D $pos, *%_)␤    (Str:D $: Str:D $needle, Int:D $pos, *%_)…»
<Zoffix__> m: say "Long string".substr-rw: 3, {6}
<camelia> rakudo-moar 404f30217: OUTPUT: «Cannot resolve caller Numeric(Block: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in block <unit> at <tmp> line 1␤␤»
<Zoffix__> m: say "Long string".substr-rw: {6}, 3
<camelia> rakudo-moar 404f30217: OUTPUT: «tri␤»
<Zoffix__> m: say "Long string".substr-eq: {6}, 3
<camelia> rakudo-moar 404f30217: OUTPUT: «Cannot resolve caller substr-eq(Str: Block, Int); none of these signatures match:␤    (Str:D $: Cool:D $needle, *%_)␤    (Str:D $: Str:D $needle, *%_)␤    (Str:D $: Cool:D $needle, Int:D $pos, *%_)␤    (Str:D $: Str:D $needle, Int:D $pos, *%_)…»

<Zoffix__> m: say "Long string".substr-eq: 3.3, 3.3
<camelia> rakudo-moar 404f30217: OUTPUT: «Cannot resolve caller substr-eq(Str: Rat, Rat); none of these signatures match:␤    (Str:D $: Cool:D $needle, *%_)␤    (Str:D $: Str:D $needle, *%_)␤    (Str:D $: Cool:D $needle, Int:D $pos, *%_)␤    (Str:D $: Str:D $needle, Int:D $pos, *%_)…»
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