`QQ.structs.list.shifted` Functionality Not Supporting Tuple Element Skipping
Would be nice to have a way to turn a tuple into a new one, without a few upfront elements:
shifted. > x
QQ.structs.list
* "banana" "apple" "orange"
2
Here, x equals to * "orange" (since two elements skipped).
Hello @yegor256 , I am a new open source contributor and interested in helping to resolve this issue. Can I take this up?
@pratyushkumar211 sure, please help us
Hi, I am working on this issue and was thinking that we can add a shifted function by leveraging the existing slice function and adding the following piece of code to list.eo file:
[shift] > shifted
^.slice > @
shift
origin.length
Does this make sense? If so, could someone let me know how could I test my changes? When I simply make the update to list.eo in my local repository, my testing scripts don't seem to recognize the changes.
Thank you!
@pratyushkumar211 the implementation seems to be correct, just need to check what will happen if the list has fewer elements than shift.
You can test your changes with mvn clean install. If something doesn't work as expected, submit a new issue. Read this: https://www.yegor256.com/2025/05/25/bug-driven-development.html
Thank you @yegor256 ! I have opened PR https://github.com/objectionary/eo/pull/4596.
I think the case of shift being greater than the list size is already taken care by the slice function, and we'd get an empty list in that case.