Control@{h[3], 0, 1}
It is puzzling. (The motive for h[i]
is to build a list of controls.)
It seems that Control
is just a wrapper for Manipulate`Control
, and that function expects a Symbol as its first argument:
Control[]; (*preload*)
ClearAttributes[Manipulate`Control, {Protected, ReadProtected}]
Block[{$Context = "Manipulate`Dump`"},
Definition[Manipulate`Control] // Print;
]
Manipulate`Control[var_, Manipulate`Dump`opts___Rule, ControlType -> type_, opts2___Rule] := Manipulate`Control[var, type, Manipulate`Dump`opts, opts2] Manipulate`Control[var_Symbol, Manipulate`Dump`opts : OptionsPattern[]] := Manipulate`Control[var, Automatic, Manipulate`Dump`opts] Manipulate`Control[{var_Symbol, args___}, Manipulate`Dump`opts : OptionsPattern[]] := Manipulate`Control[{var, args}, Automatic, Manipulate`Dump`opts] . . .
All but the first definition use _Symbol
which requires that the Head
of the expression be Symbol
, and the first definition just calls one of the others.
This seems like an oversight as one can easily configure a slider with h[3]
:
Dynamic[h[3]]
Slider[Dynamic[h[3]], {0, 1}]
Manipulate
too allows h[3]
. But what is Manipulate`Control?
$\endgroup$
Manipulate`Control
seems to be the internal function that Control
is transformed into the course of evaluation and Front End formatting. I am attempting to follow internal definitions to arrive at this conclusion. The point is that if I am correct and Control
relies upon Manipulate`Control
, and the latter only works with Symbols, then the observed behavior is expected if disappointing.
$\endgroup$
Commented
Mar 1, 2016 at 17:05
Manipulate`Control
is an internal, behind-the-scenes function and I would not expect to find documentation for it. The use of the backtick here is for Context; this Control
is in the context Manipulate`
. The regular Control
is in the System`
context. See: reference.wolfram.com/language/tutorial/Contexts.html
$\endgroup$
Commented
Mar 2, 2016 at 11:34