-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add a..b syntax #121
Conversation
|
||
for i in 1:length(qe) | ||
qe[i] = postwalk(qe[i]) do x | ||
if x isa Expr && x.head==:call && x.args[1]==:(..) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ;)
added example and test for a..b
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
This reverts commit 8358384.
This translates any
a..b
in a query intomap(i->i.b, a)
.Needs