Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71818] please explain why ToExpression[SubscriptBox["x","1"],StandardForm] ...
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Thu, 30 Nov 2006 06:05:12 -0500 (EST)

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