-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
universal toSeq: works with UFCS; works with inline & closure iterators, and with iterables #8711
Conversation
fc16faf
to
64eda65
Compare
/cc @Araq |
/cc @Araq friendly ping |
Sorry, PRs like these are delayed until finally we got 0.19 out. |
64eda65
to
d2a31fb
Compare
/cc @Araq ping now that 0.19 is out |
968dedb
to
d582a38
Compare
iterators, and also non-iterators
d582a38
to
a974512
Compare
@Araq anything holding this back? there are 7 +1's and I'd really like to have this in |
Generally I have to say, I like it. I think a |
I think it's overly complicated and it will cause regressions. |
not sure what you mean by that; implementation or user-facing API ? if the latter, I have to disagree; I want a toSeq that "just works" in all contexts (or as many contexts as possible) ; and having it work in method call syntax (in all cases except 1 as mention in top msg) is also very valuable if the former, I can try to see whether something can be simplified in implementation
impossible for me to disprove unless we implement (part of) #8638 |
@krux02 ping |
See test cases for more details but here's the skinny:
note
toSeq(myIter5(3))
withiterator myIter5(a:int):auto = ...
fixes
links
for x in myIter(42)(): ...
gives infinite loop; inconsistent withlet it = iterGen(42); for x in it(): ...
for x in myIter(1)(): ...
gives infinite loop; inconsistent withlet it = iterGen(1); for x in it(): ...
#8775