Skip to content
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

@gap and g_str macro call evalstr at parsetime instead of runtime, which is surprising #903

Closed
fingolfin opened this issue Jun 19, 2023 · 0 comments · Fixed by #904
Closed

Comments

@fingolfin
Copy link
Member

As a result, we have this:

julia> f(x)  = @gap (1,2)(3,x)
ERROR: LoadError: Error thrown by GAP: Error, Variable: 'x' must have a value
not in any function at stream:1

while this works

julia> f(x)  = GAP.evalstr("(1,2)(3,$x)")
f (generic function with 1 method)

julia> f(4)
GAP: (1,2)(3,4)

The following options come to my mind:

  1. keep this and just document it (but seems pretty useless)
  2. fix it by returning a properly quoted code snippet
  3. remove one or both offending macros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant