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
I ran into some unexpected matching behavior in a function definition (see below). I'm not sure if this should be a match or not. However, if it is a match it seems to by swapping xsym and args (e.g., I would expect xsym to get :x rather than args getting that). I'm guessing this can be worked around by using some of the function definition documentation?
This is due to the fact that keyword arguments are stored as if they were the first argument to the function; when you ask for xsym_, you're really just asking for whatever happens to be in the AST in that position, so MacroTools gives you that.
One way around this would be to modify all function expressions (input and templates) so that they always have a parameters slot, even if it's empty; it's an annoying special case to have but it'd make this kind of thing behave a lot more intuitively.
Is there an open issue or PR on the main Julia repository to remove the special case with no parameters? I keep running into the same issue when trying to write & debug macros, with or without macrotools.
I ran into some unexpected matching behavior in a function definition (see below). I'm not sure if this should be a match or not. However, if it is a match it seems to by swapping
xsym
andargs
(e.g., I would expectxsym
to get:x
rather thanargs
getting that). I'm guessing this can be worked around by using some of the function definition documentation?The text was updated successfully, but these errors were encountered: