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
Adding head, skip, tail as subroutines #328
Labels
language
Changes to the Raku Programming Language
Comments
lizmat
added a commit
to rakudo/rakudo
that referenced
this issue
Jun 28, 2022
As requested in Raku/problem-solving#328 There is one biggish issue with this, as the sub "skip" clashes with the "skip" sub as exported by Test. Fixed this by giving the version of "skip" from Test its own proto. Since we added 3 more subs to the core, these tests all needed to be adapted as well.
@Smokemachine Is this related work of Reds respective operators? Do they match? |
I've also created a module to allow for this functionality in older Rakudo versions: https://raku.land/zef:lizmat/head-skip-tail (aka https://github.com/lizmat/head-skip-tail) |
lizmat
added a commit
to rakudo/rakudo
that referenced
this issue
Jul 7, 2022
As requested in Raku/problem-solving#328 There is one biggish issue with this, as the sub "skip" clashes with the "skip" sub as exported by Test. Fixed this by giving the version of "skip" from Test its own proto. Since we added 3 more subs to the core, these tests all needed to be adapted as well.
lizmat
added a commit
that referenced
this issue
Jul 7, 2022
rakudo/rakudo@af31b1df89 made this change.
This has been merged, so closing this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
this has been mentioned on chat a couple of days ago.
It would be nice to have head, skip and tail as subroutines with the iterable as their last parameter, similarly to grep and map.
This would both increase consistency (why shouldn't they work, if grep and map do work?) and the usefulness off the feed operators, since this would allow us to write
1, 3 ... * ==> grep &some-condition ==> head 20
and similar code.
The text was updated successfully, but these errors were encountered: