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

KT-24658 Add downUntil function #5389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trevorhackman
Copy link

I thought https://youtrack.jetbrains.com/issue/KT-24658 would be an easy one for me to do and contribute, first time contributor here.

downUntil feels like a simple but missing stdlib function in my opinion. As said in the issue 6 years ago, "Kotlin has .. for upward closed ranges, downTo for downward closed ranges, and until for upward half-open ranges.", but no downUntil for downward half-open ranges.

@JakeWharton
Copy link
Contributor

These will also need intrinsics so that they don't allocate for simple loops, but that can be tracked/added separately.

@trevorhackman
Copy link
Author

These will also need intrinsics so that they don't allocate for simple loops, but that can be tracked/added separately.

Nice, I wasn't aware of that. Would it be pretty similar to the existing DownToHandler.kt or UntilHandler.kt? I could have a go at adding a DownUntilHandler.kt too unless a separate ticket & PR would be better.

@JakeWharton
Copy link
Contributor

I don't think it matters all that much. I would probably wait, to ensure these are acceptable APIs first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants