You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Next, if one wants to add metadata to a parameter, it is added in a square bracket afterwards:
@parameters p [description="A parameter"] d [description="Another parameter"]
However, if the number of parameters gets long, this gets hard to read. Here, there is a begin ... end form (with one parameter on each line):
@parametersbegin
p
d
end
However, if we now need to add metadata, this is not possible using the same notation as with a single line, as this:
:(@parametersbegin
p [description="A parameter"]
d [description="Another parameter"]
end)
is not valid Julia notation. Instead, a , is added to make things work:
@parametersbegin
p, [description="A parameter"]
d, [description="Another parameter"]
end
This is still a bit awkward, as the notation in single-line and multi-line declarations are different. Would it be possible to enable
:(@parametersbegin
p [description="A parameter"]
d [description="Another parameter"]
end)
as permitted for metaprogramming? I read someone asking about new notations for metaprogramming on the Slack, and got a reply that adding stuff like this was possible. If this is the case, I think adding this would be useful to a set of packages with a fairly large user base (and if it is not possible, we can definitely manage without!).
Would it be possible to make
valid notation so that it can be used in metaprogramming?
In e.g. ModelingToolkit (https://github.com/SciML/ModelingToolkit.jl) one can declare parameters using
@parameters p d
Next, if one wants to add metadata to a parameter, it is added in a square bracket afterwards:
However, if the number of parameters gets long, this gets hard to read. Here, there is a
begin ... end
form (with one parameter on each line):However, if we now need to add metadata, this is not possible using the same notation as with a single line, as this:
is not valid Julia notation. Instead, a
,
is added to make things work:This is still a bit awkward, as the notation in single-line and multi-line declarations are different. Would it be possible to enable
as permitted for metaprogramming? I read someone asking about new notations for metaprogramming on the Slack, and got a reply that adding stuff like this was possible. If this is the case, I think adding this would be useful to a set of packages with a fairly large user base (and if it is not possible, we can definitely manage without!).
Would this be useful, @ChrisRackauckas?
The text was updated successfully, but these errors were encountered: