When defining packages, can I put parameter values alone or along with functions into a package in subscripted form?
BeginPackage["Myfunction`"];
Subscript[q, 1] = 0;
Subscript[q, 2] = 0.5;
myfunction::usage ="...";
Begin["`Private`"];
myfunction[ak__List] := blablabla...;
End[];
EndPackage[];
Because these global subscripted parameters in the package are needed in many programs, I separated them from the main programs and put them into a single package. In the main programs, I only need to load the package rather than bothering to redefine these parameters again. For plain symbols, it works fine. But whem it comes to subscripted symbols, it fails. And I found that is because I used
Symbolize[ParsedBoxWrapper[SubscriptBox["_", "_"]]];
in the main program. subscripted symbols like
Subscript[q, 1]
are transformed into
q_Subscript_1
I also tried to use Symbolize function in the package, but it fails. The clarity for using subscripted symbols made me reluctant to avoid them.
Symbolize) in the question and esp. question title... – Yves Klett Apr 10 '13 at 08:57Subscript-ed forms, exactly like halirutan did in his anwer, or use functional forms likedq[1]=0; dq[2]=0.5. – István Zachar Apr 10 '13 at 08:58