Bug fixed in version 11
In adapting some plotting functions to utilize the PlotLegends
option of version 9, I came across the following errors:
f[x_] := Legended[Plot[Sin[t], {t, 0, Pi}], x]
f[1];
Information[f]
TextForm[First::first: StandardForm[Short[Shallow[HoldForm[{}], {10, 50}], 5]] has a length of zero and no first element. >>]
This is just a toy example for a more complex situation where I can't directly use the PlotLegends
option but have to use Legended
explicitly.
What is the best way to catch this error when a user invokes the above or types ?f
to see the code for this function. It seems the output of Definition
works as expected (it formats the Legended
contents, and that happens for other constructs such as Framed
too).
?f
, specifyingusage
message is enoughf::usage = "bla";
. $\endgroup$f
introduced something to box functions. Check this:System`Dump`makeusageboxes[f[x_] := Legended["123", x]]
. $\endgroup$