Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6224
| From | Rui <rui.rojo@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Format and MakeBoxes in depth - Part 1 |
| Date | 2011-11-06 10:59 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j95pab$m6v$1@smc.vnet.net> (permalink) |
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?
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Format and MakeBoxes in depth - Part 1 Rui <rui.rojo@gmail.com> - 2011-11-06 10:59 +0000
csiph-web