ModelingToolkit.jl
ModelingToolkit.jl copied to clipboard
Unintuitive behavior for including metadata in @parameters/@variables begin end
When declaring parameters using the new @mtkmodel DSL, one can either write:
@parameters tau A
or
@parameters begin
tau
A
end
Adding metadata to the parameters using begin end feels unintuitive:
Here is what is in the documentation (seems intuitive)
@parameters tau [tunable=true] A
I would have expected to write the following:
@parameters begin
tau [tunable=true]
A
end
but this does not work.
Instead, these two versions work:
@parameters begin
tau, [tunable=true]
A
end
@parameters begin
tau
[tunable=true]
A
end
This syntax should at least be included in the documentation, but I would prefer the intuitive syntax if possible.