-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Qute: Support iterating by number #6971
Conversation
Also feel free to reject/close this PR if it doesn't make sense @mkouba :) |
For me, it works really well as the only thing I want to do is print the number of stars depending on a rating number. So if it is 4 I just want to add 4 stars. The other thing as you said is the descending order but for now, if this is accepted I can work around the problem with not much effort. Thank you very much. |
Yeah, you can always do a EDIT: It seems like math expressions are not supported yet |
@gastaldi looks good ;-).
Yep, complex expressions are not supported in loops. By the way, you can also use the
|
Can we get this PR approved and merged in time for 1.3.0.Alpha1? |
Just a small comment: let's not put pressure when none is needed. 1.3.0.Alpha1 is released for people to test the new class loading infra. We don't need to hurry to get this sort of fixes in: we can take our time to get a proper design if needed. |
Hm, while reading the docs, I noticed that you could have also used an Eg. public IntStream getMovies() {
return IntStream.rangeClosed(1, getMoviesCount());
} Anyway, I added some docs adding support for plain Integers, let me know what you guys think :) |
@mkouba could you review the doc? |
@gastaldi Yes, extension methods would work too, ie. something like: public static IntStream getMovieStars(Movie movie) {
return IntStream.rangeClosed(1, movie.getStarsCount());
} Anyway, I think it's ok to support this directly. |
Proposing to also support iterating Long numbers: #41679 |
I reused the
for
instruction to iterate by number. Support for descending order is not yet implemented. Let me see how that works for you @lordofthejarsFixes #6963