-
Notifications
You must be signed in to change notification settings - Fork 219
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
@VarName can be replaced with a function #514
Comments
With a combination of the |
|
@mohamed82008 @willtebbutt Is this already fixed? |
@mohamed82008 have you sorted this in #660 ? |
No, |
My main objection to nested macros is that they make the code harder to read. If there were some additional utility gained by keeping the macro (i.e. we used |
How about making Edit: the |
I would be pro this. |
So now after #965, we can do |
This issue pertains to the
@VarName
macro incompiler.jl
, which I don't believe needs to be a macro. This issue was previously discussed on #513, but it was felt that it should be dealt with in a separate PR.In particular, replacing
@VarName
with a functionmake_varname
, defined as follows:and changing the
@~
macro method that handles expressions on the lhs toappears to yield roughly the correct results. Only difference with code on #513 is about halfway down, the line
is new, and the first line of the
assume_ex
has also changed.For example, running this MWE:
produces
The point being that the first line is as required, but the rather unreadable
@VarName
code has been replaced with something more readable, and has removed the need to nest macro invocations. I would argue that this is a significant readability improvement.The text was updated successfully, but these errors were encountered: