Is there Mathematica analogue of Python _
(underscore) or Matlab ~
, a special variable, that can be used when a function returns a list and only some of the list elements are needed while others just ignored. E.g.:
f[x_] = {x^ 2, x^ 3};
{a1, _} = f[2]
a1 = f[2][[1]]
. $\endgroup$Part
orExtract
. Part would be shorter code. Both can select multiple items from the returned list. $\endgroup$a /: Set[a, _] := Null
? No value can be set to a, but can beSetDelayed
etc. $\endgroup$