-
Notifications
You must be signed in to change notification settings - Fork 33
Added some macro iterators #33
Added some macro iterators #33
Conversation
Really beautiful. I made a trivial variable-naming comment simply to prove I had looked at it 😄. I say merge at will. |
I really like the idea here. I'd like to offer a thought on the interface. Having the iterator name out front is necessary (because it's a macro, after all), but somewhat harder to read, in my opinion. What about something like @zip for (x,y) in zip(a,b)
@show x,y
end Or, just using one macro for all iterators @iterate for (x,y) in zip(a,b)
@show x,y
end In the first, the The second would be harder to implement, and may not be worth it, but the syntax is easy (and also makes it easier to switch back to the non-macro version). Thoughts? |
Okay, |
How about |
I like |
Using |
|
LGTM |
Ok I'll squash, clean up a bit and merge. |
Thie adds macro versions of * zip * enumerate * take/takestrict * drop * chain The itr macro dispatches on those
Added some macro iterators
Yay! Really nice to have this in Iterators. Will presumably get much more attention that way. |
Can be merged once JuliaCollections/Iterators.jl#33 makes it into a release
Can be merged once JuliaCollections/Iterators.jl#33 makes it into a release
As per the discussion in 1bbeeee.
This adds macro versions of
which work on for loops. They all follow the same general syntax: whenever one would write
the corresponding macro version is: