Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6224 > unrolled thread

Format and MakeBoxes in depth - Part 1

Started byRui <rui.rojo@gmail.com>
First post2011-11-06 10:59 +0000
Last post2011-11-06 10:59 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Format and MakeBoxes in depth - Part 1 Rui <rui.rojo@gmail.com> - 2011-11-06 10:59 +0000

#6224 — Format and MakeBoxes in depth - Part 1

FromRui <rui.rojo@gmail.com>
Date2011-11-06 10:59 +0000
SubjectFormat and MakeBoxes in depth - Part 1
Message-ID<j95pab$m6v$1@smc.vnet.net>
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
In:
MakeBoxes[lo, StandardForm]
Out:
[Empty line... Print[""]'s fault]
RowBox[{"la", "[", "]"}]

However, if I look into the definitions
In:??lo
Out:
la[]/:MakeBoxes[la[],StandardForm]:=Format[Print[];la[],StandardForm]

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
lo/:MakeBoxes[lo,StandardForm]:=Format[Print[];la[],StandardForm]

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?

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web