-
Notifications
You must be signed in to change notification settings - Fork 16
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
expression blocks #89
Comments
Allowing only temporary variables and nothing else there seems a little odd and would probably be very confusing. When implementing macros, I initially tried to have them as close to "usual" functions as possible: A bunch of statements that can return a value. While this did work somehow, the generated code was usually pretty bad and it led quite often to unexpected results. Thats why I decided to have multiple types (expr, line, block) of macros. This way it is always relatively clear to users of macros how to compiler will handle the code. No magic, no suprises. I am not saying it can't be done properly. But I didn't get it working in a satisfying way. However, I thing there are some other (planned) features that can help here: So in the end it would look like this:
And the result should look pretty similar to what you described. Also: I don't think having to use a block-macro for something that complicated as a proper atan is too bad. It's only minimally more inconvenient and at least makes it clear to users that the macro they are using will result in a lot of code and should not be used light-heartedly inside some expression. |
Closed as won't/can't fix. |
Is your feature request related to a problem? Please describe.
allow temporary variables inside expression-like block
Describe the solution you'd like
is equvilent to
finally
Describe alternatives you've considered
macro math_atan2(out, y, x) block
is uglyAdditional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: