-
Notifications
You must be signed in to change notification settings - Fork 163
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
Unexpected behaviour of options #4631
Comments
Good catch. This is due to how options are handled in the immediate interpreter (used in your second call) vs. the "executor": The former immediately executes code as it encounters it, so it first executes the call But for the executor, first we "compile" the function into a bunch of statements (or expressions; for simplicity, I'll just always say "statement). And function calls involving options are handled in a somewhat peculiar way: they are encoded as Now here's the problem: the arguments to the function are evaluated by the handlers for To fix this, we need to revise how options are handled, and ensure this happens after the arguments are evaluated, but before the actual function call. |
Thanks for the explanation and the quick fix! I can confirm that my original issue does not occur anymore when using the PR :-) |
Consider the following piece of code:
Observed behaviour
The output is:
Expected behaviour
I would expect the output to be
(or at least the same output in both lines) because I do not see a reason why the option should propagate into the call of
myfunc1
in the first case but not in the second.Copy and paste GAP banner (to tell us about your setup)
Also happens with GAP 4.11.1.
The text was updated successfully, but these errors were encountered: