-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add Enum.slice_before/2 and Stream.slice_before/2 #3016
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
Conversation
Thank you! Do you have a use case for this particular function or other languages that provide it? |
Sure, currently I work on slim and ast for it, and I need many other enums also, this is first one. I have structure like this:
and I need something like this:
With plain recursion it's tricky for me to go back for more than 1 level of nesting.
Ruby for example http://ruby-doc.org/core-2.2.0/Enumerable.html#method-i-slice_before |
Thanks. I am not a fan of the name |
Yep, I renamed it couple of times =) split also was in my list, and chunk was prototype of this function, but as I know English split is slice of 2 pieces. Also it's close to |
@josevalim what do you think about |
I think naming it |
I think
|
@lexmag as you said, |
I see, then it definitely looks like a |
@josevalim do you have any ideas about name? |
No, sorry. :( |
I am closing this unfortunately due to lack of progress in naming. :( Thanks @igas! |
No description provided.