You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Here is an example, but it would be nice to have a syntax to (ex = :{P,pattern}) to have the matched part of the expression.
@metafunctioncollectwheres(member1 where*{params1}) begin
member2, params2 =collectwheres(member1)
(member2, (params1..., params2...))
end@metafunctioncollectwheres(other) begin
(other,())
end@metafunctionparse_fn(function(*{args},) where w; *{stmts} end) beginend
for me to use collectwheres method, i need to assign the matched part of the expression by "function(*{args},) where w;" pattern. So is there a way to assign the matched part to a variable so that i can pass it to collectwheres?
Thanks
The text was updated successfully, but these errors were encountered:
I think I understand, but unfortunately julia's syntax rules makes implementing the new syntax difficult. If they were more permissive, we could just do this:
@metafunctionparse_fn(function expr; *{stms} end) begin
fn, wheres =collectwheres(expr)
#...end
We can do this somewhat clumsily with :R.
@metafunctionparse_fn(:R{:function, expr, begin*{stms} end}) begin
fn, wheres =collectwheres(expr)
#...end
"Named matches" seem worth implementing anyway, even if it's not useful for this particular case.
Hi,
Here is an example, but it would be nice to have a syntax to (ex = :{P,pattern}) to have the matched part of the expression.
for me to use collectwheres method, i need to assign the matched part of the expression by "function(*{args},) where w;" pattern. So is there a way to assign the matched part to a variable so that i can pass it to collectwheres?
Thanks
The text was updated successfully, but these errors were encountered: