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

Add a..b syntax #121

Merged
merged 10 commits into from
Jul 22, 2017
Merged

Add a..b syntax #121

merged 10 commits into from
Jul 22, 2017

Conversation

davidanthoff
Copy link
Member

@davidanthoff davidanthoff commented Jun 7, 2017

This translates any a..b in a query into map(i->i.b, a).

Needs

  • Tests
  • Docs


for i in 1:length(qe)
qe[i] = postwalk(qe[i]) do x
if x isa Expr && x.head==:call && x.args[1]==:(..)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be written

if @capture(x, x_..y_)
    :(map(i->i.$y, x))
else 
    x
end

My MacroTools.jl foo isn't that strong so maybe I am wrong about this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might well be, but my MacroTools.jl foo is almost non-existent and I know the current formulation works, so I'm tempted to just leave as is ;)

@codecov-io
Copy link

codecov-io commented Jun 23, 2017

Codecov Report

Merging #121 into master will increase coverage by 0.49%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #121      +/-   ##
==========================================
+ Coverage   82.15%   82.64%   +0.49%     
==========================================
  Files          21       21              
  Lines         807      801       -6     
==========================================
- Hits          663      662       -1     
+ Misses        144      139       -5
Impacted Files Coverage Δ
src/Query.jl 91.66% <ø> (+13.09%) ⬆️
src/query_translation.jl 96.46% <80%> (+1.51%) ⬆️
src/enumerable/enumerable_orderby.jl 82.08% <0%> (-1.48%) ⬇️
src/enumerable/enumerable_join.jl 94.28% <0%> (-0.59%) ⬇️
src/enumerable/enumerable_groupjoin.jl 94.44% <0%> (-0.56%) ⬇️
src/enumerable/enumerable_groupby.jl 94% <0%> (-0.55%) ⬇️
src/enumerable/enumerable_select.jl 90.9% <0%> (-0.4%) ⬇️
src/enumerable/enumerable_where.jl 93.75% <0%> (-0.19%) ⬇️
src/enumerable/enumerable_selectmany.jl 97.43% <0%> (-0.19%) ⬇️
src/sources/source_iterable.jl 93.75% <0%> (+0.89%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95d8136...083e115. Read the comment docs.

@davidanthoff davidanthoff changed the title WIP Add a..b syntax Add a..b syntax Jul 22, 2017
@davidanthoff davidanthoff merged commit d93b21f into master Jul 22, 2017
@davidanthoff davidanthoff deleted the simple-map-syntax branch January 19, 2019 20:31
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.

4 participants