Is there any way to have the same syntax coloring with SyntaxInformation
that Block
has?
SyntaxInformation[func] = {"ArgumentsPattern" -> {{__}, _},
"LocalVariables" -> {"Solve", {1, Infinity}}};
func[vars : {__}, body_] := {};
After evaluating the above definition, the following two lines have different coloring:
func[{parameter, variable, constant = 0}, parameter + variable + constant]
Block[{parameter, variable, constant = 0}, parameter + variable + constant]
As you can notice, any local variable with an initial value is not highlighted as local. I use the default syntax coloring, no changes were applied. SyntaxInformation
accepts the following values: {"Table", "Solve", "Integrate", "Limit", "Plot", "Manipulate"}
none of which produces the same behaviour as Block
does. Perhaps someone knows about an undocumented option value?
HoldAll
or similar. See for example Leonid'sLetL
here which is a scoping construct similar toWith
. $\endgroup$