Totally share the overall goal of making data manipulation more convenient in Julia
But creating a macro for each function one may want to use doesn’t really scale… Even for Iterators.filter you had to create another name that one needs to remember, in addition to the underlying function.
There’s already DataPipes.jl (disclaimer: I’m the author) that’s stable and has been around for ~5 yrs.
DataPipes is specifically designed to be a lightweight code transformation that makes all common data manipulation functions in Julia basically boilerplate-free. Not just Base.xxx, or Iterators.xxx, but all functions that follow the Julian argument order:
With DataPipes.jl:
@p let
1:10
zip(21:30)
collect
filter(_[1] <= 25)
map(_[2])
end
Same with Iterators.filter, of course:
@p let
1:10
zip(21:30)
Iterators.filter(_[1] <= 25)
map(_[2])
end
The transformation is purely syntactic – basically, just two operations, pass the previous step result and transform _ into lambda. No special handling of any functions ever!