Menu ▾ ▴

#5275 Pretty printer display extent incorrect for multiple subscripts

None
open
nobody
display2d (19)
5
6 days ago
6 days ago
No

Looks like depth is calculated incorrectly for subscripts applied to subscripted expressions. I guess the assumption in the pretty printer code is that the depth needs to be increased for every subscript, but that's not necessarily true, since the second and additional subscripts are placed beside, not beneath, the previous subscripts.

(%i2) box (foo);
                      ╔═══╗
(%o2)                 ║foo║
                      ╚═══╝
(%i3) box (foo[a]);
                      ╔════╗
(%o3)                 ║foo ║
                      ║   a║
                      ╚════╝
(%i4) box (foo[a][b]);
                    ╔═══════╗
(%o4)               ║(foo ) ║
                    ║    a b║
                    ║       ║
                    ╚═══════╝
(%i5) box (foo[a][b][c]);
                   ╔══════════╗
(%o5)              ║((foo ) ) ║
                   ║     a b c║
                   ║          ║
                   ║          ║
                   ╚══════════╝

Discussion


Log in to post a comment.