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

get_assignees tries to read macro input #17

Closed
schillic opened this issue Feb 8, 2024 · 3 comments
Closed

get_assignees tries to read macro input #17

schillic opened this issue Feb 8, 2024 · 3 comments

Comments

@schillic
Copy link

schillic commented Feb 8, 2024

I get hit by this warning:

@warn "unknown use of `=`. Assignee is unrecognised." ex

┌ Warning: unknown use of `=`. Assignee is unrecognised.
│   ex = :(X')
└ @ ExpressionExplorer ~/.julia/packages/ExpressionExplorer/BGoGa/src/explore.jl:177

The corresponding expression is:

p = @ivp(X' = AX, X(0)  X0)

I presume this means that the parser tries to read X' = AX. But this is inside a macro (from MathematicalSystems), which handles this expression already and returns a result for p. So I think the parser should just let the macro do its job and parse the result instead. Is there a way to say "please execute the macro first"?

@fonsp
Copy link
Member

fonsp commented Feb 8, 2024

Hey! The function get_assignees is not public API, you can find the public API on our README :)

But I also get the warning when computing assignees the usual way:

julia> ExpressionExplorer.compute_reactive_node(:(p = @ivp(X' = AX, X(0)  X0))).definitions
┌ Warning: unknown use of `=`. Assignee is unrecognised.
│   ex = :(X')
└ @ ExpressionExplorer ~/Documents/ExpressionExplorer.jl/src/explore.jl:177
Set{Symbol} with 1 element:
  :p

The warning is safe to ignore (although I am not sure why you're seeing it, @Pangoraw might know), because contents of macros are always ignored:

julia> ExpressionExplorer.compute_reactive_node(:(p = @ivp(X = AX, X(0)  X0))).definitions
Set{Symbol} with 1 element:
  :p

If you want macros to be handled, you have the option to macroexpand before using ExpressionExplorer: https://github.com/JuliaPluto/ExpressionExplorer.jl#macro-calls

Let me know if this helps!

@fonsp fonsp closed this as completed Feb 8, 2024
@schillic
Copy link
Author

I forgot to mention that I do not use this package directly but saw the warning in Pluto, and narrowed it down to land here.
Thanks for the reply and pointer!

@fonsp
Copy link
Member

fonsp commented Feb 11, 2024

Alright! Try to always write down what steps you took to get to an issue 👍

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

No branches or pull requests

2 participants