MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

please explain why ToExpression[SubscriptBox["x","1"],StandardForm] ...


fails when the definition

MakeExpression[SubscriptBox["x","1"],___]=dog;

is active.


I think it is related to the output of

BoxForm`TopLevelMakeExpression[StripBoxes[SubscriptBox["x","1"]],StandardForm]

being

ErrorBox[dog].


If you can answer that, then I may be able to make my solution to
"[mg71653] Using subscripts in function-parameter names" work... here
is what I have so far:

Unprotect[SubscriptBox];
With[{usc=FromCharacterCode[63316]},
    subscriptAsSymbol[symb_Symbol]:=
      With[{symbStr=ToString@symb},
        SubscriptBox/:
          MakeExpression[SubscriptBox[symbStr,scriptStrs__String],format_]:=
          MakeExpression[SubscriptBox[symbStr,scriptStrs],format]=
            With[{symbWithSub=
                  ToExpression[
                    ToString@
                      BoxForm`Intercalate[SequenceForm[symbStr,scriptStrs],
                        usc],format]},
              MakeBoxes[symbWithSub,_]=SubscriptBox[symbStr,scriptStrs];
              symbWithSub]]];
subscriptAsSymbol@x;
ToExpression[SubscriptBox["x","1"],StandardForm]

-- 
http://chris.chiasson.name/


  • Prev by Date: Re: Strange empty set of solutions
  • Next by Date: something is "wrong" with the Fills option in InequalityGraphics
  • Previous by thread: Help finding x of hypergeometric 2F1[a,b,c,x] ?
  • Next by thread: Re: Graphics--How to plot all functions issued from For loop and