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

.assuming ignores anything from the second argument onwards in Rakudo #4641

Closed
p6rt opened this issue Oct 12, 2015 · 5 comments
Closed

.assuming ignores anything from the second argument onwards in Rakudo #4641

p6rt opened this issue Oct 12, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Oct 12, 2015

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

Searchable as RT126332$

@p6rt
Copy link
Author

p6rt commented Oct 12, 2015

From @masak

<loren> m​: my &f := &substr.assuming('hello world'); say f(0, 2);
<camelia> rakudo-moar 70a94d​: OUTPUT«hello world␤»
<moritz> m​: say &substr.assuming('hello world')(0, 2)
<camelia> rakudo-moar 70a94d​: OUTPUT«hello world␤»
<moritz> wtf (the "w" stands for "weird", here)
* moritz would have thought we had tests for assuming
<moritz> m​: sub my-substr(*@​a) { substr |@​a }; say
&my-substr.assuming('hello, world')(1, 3)
<camelia> rakudo-moar 70a94d​: OUTPUT«ello, world␤»
<moritz> so it only passes one more argument on to the original function?
<FROGGS> maybe assuming does not work well with multies?
<moritz> m​: sub d(*@​x) { say @​x.perl }; &d.assuming('a', 'b')('c', 'd', 'e')
<camelia> rakudo-moar 70a94d​: OUTPUT«["a", "b", "c"]␤»
<moritz> FROGGS​: no
<moritz> FROGGS​: it ignores anything from the second argument onwards
<FROGGS> m​: multi f(1) {'a'}; multi f(1, 2) {'b'}; multi f(1, 2, 3)
{'c'}; say &f.assuming(1)(2, 3)
<camelia> rakudo-moar 70a94d​: OUTPUT«b␤»
<FROGGS> m​: multi f(1) {'a'}; multi f(1, 2) {'b'}; multi f(1, 2, 3)
{'c'}; say &f.assuming(1)(2, 3, 4)
<camelia> rakudo-moar 70a94d​: OUTPUT«b␤»
<FROGGS> wow
<moritz> who wants to write the bug report?
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Sep 12, 2017

From @smls

On Mon, 12 Oct 2015 05​:33​:13 -0700, masak wrote​:

<loren> m​: my &f := &substr.assuming('hello world'); say f(0, 2);
<camelia> rakudo-moar 70a94d​: OUTPUT«hello world␤»
<moritz> m​: say &substr.assuming('hello world')(0, 2)
<camelia> rakudo-moar 70a94d​: OUTPUT«hello world␤»
[...]

It works fine now​:

  ➜ say &substr.assuming("hello world")(0, 2);
  he

  ➜ say { @​_ }.assuming(1, 2)(3, 4, 5);
  [1 2 3 4 5]

According to committable¹ and bisectable², this was a regression introduced near the start of the GLR around Sept 2015, and fixed again by a GLR-related commit³ in Dec 2015.

Can be closed with tests.


[1] https://gist.github.com/Whateverable/47d41dd4ca8092815ba0449f8a8ee518
[2] https://gist.github.com/Whateverable/8212d24ae0b3498ca53cdd46471db402
[3] rakudo/rakudo@88a8a00

@p6rt
Copy link
Author

p6rt commented Sep 12, 2017

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

@p6rt
Copy link
Author

p6rt commented Sep 13, 2017

From @skids

On Tue, 12 Sep 2017 08​:55​:37 -0700, smls75@​gmail.com wrote​:

On Mon, 12 Oct 2015 05​:33​:13 -0700, masak wrote​:

<loren> m​: my &f := &substr.assuming('hello world'); say f(0, 2);
<camelia> rakudo-moar 70a94d​: OUTPUT«hello world␤»
<moritz> m​: say &substr.assuming('hello world')(0, 2)
<camelia> rakudo-moar 70a94d​: OUTPUT«hello world␤»
[...]

It works fine now​:

➜ say &substr.assuming("hello world")(0, 2);
he

➜ say { @​_ }.assuming(1, 2)(3, 4, 5);
[1 2 3 4 5]

According to committable¹ and bisectable², this was a regression
introduced near the start of the GLR around Sept 2015, and fixed again
by a GLR-related commit³ in Dec 2015.

Can be closed with tests.
---
[1]
https://gist.github.com/Whateverable/47d41dd4ca8092815ba0449f8a8ee518
[2]
https://gist.github.com/Whateverable/8212d24ae0b3498ca53cdd46471db402
[3] rakudo/rakudo@88a8a00

Tests added in roast b2142be76, so resolving.

@p6rt
Copy link
Author

p6rt commented Sep 13, 2017

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

@p6rt p6rt closed this as completed Sep 13, 2017
@p6rt p6rt added the testneeded 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
Development

No branches or pull requests

1 participant