Skip to content

Can't use splat to expand arguments in @variable #391

@stillyslalom

Description

@stillyslalom

From Discourse,

julia> ε = @variables ε_xx, ε_yy, ε_xy
3-element Vector{Num}:
 ε_xx
 ε_yy
 ε_xy

julia> @variables η(ε...) # can't use splat to expand
ERROR: MethodError: no method matching value(::Num, ::Num, ::Num)
Closest candidates are:
  value(::Num) at C:\Users\alexa\.julia\packages\Symbolics\mFWWM\src\num.jl:19
  value(::Any) at C:\Users\alexa\.julia\packages\Symbolics\mFWWM\src\num.jl:18
Stacktrace:
 [1] top-level scope
   @ REPL[24]:1

julia> @variables η(ε[1], ε[2], ε[3]) # have to manually expand
1-element Vector{Num}:
 η(ε_xx, ε_yy, ε_xy)

┆Issue is synchronized with this Trello card by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions