MathGroup Archive 2011

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

Search the Archive

Format and MakeBoxes in depth - Part 1

  • To: mathgroup at
  • Subject: [mg122691] Format and MakeBoxes in depth - Part 1
  • From: Rui <rui.rojo at>
  • Date: Sun, 6 Nov 2011 05:55:45 -0500 (EST)
  • Delivered-to:
  • Reply-to: comp.soft-sys.math.mathematica at

I have actually deep doubts about these functions, but I'll try to start with a small concrete one that bugs me...

I define a format for the symbol "lo"
Format[lo, StandardForm]:=(Print[""];la[]);
Now, if I call MakeBoxes on it, result is what I expected
MakeBoxes[lo, StandardForm]
[Empty line... Print[""]'s fault]
RowBox[{"la", "[", "]"}]

However, if I look into the definitions

Those first 2 la[] I'm pretty sure are actually lo's printed out as la[].
The last one after Print[] should be actually la[]. So it actually means

So, if MakeBoxes[lo, StandardForm]:=Format[Print[];la[], StandardForm], how come it returns a box structure when Format[Print[];la[], StandardForm] by itself returns unevaluated?

  • Prev by Date: What gets put in ~/.Mathematica and why?
  • Next by Date: Re: How to evaluate parts of an expression, but not other parts?
  • Previous by thread: Re: What gets put in ~/.Mathematica and why?
  • Next by thread: Delayed symbol resolution