M2 icon indicating copy to clipboard operation
M2 copied to clipboard

Precedence of subscripts and superscripts

Open mahrud opened this issue 1 year ago • 1 comments

There's a comment in HyperplaneArrangements which I think we should fix by changing the precedence of _ and ^:

Flat ^ Flat := Flat => meet  -- ooh, cool.  But note L_1^L_2 isn't L_1^(L_2) !

-- Initially this issue was the following, but I switched it because I think the above is much more important.

join for posets is called posetJoin, but would be more intuitive if join was available as a method. Similarly, flats in HyperplaneArrangements have meet (or ^) and vee (or |) rather than join.

mahrud avatar May 04 '24 07:05 mahrud

Yes, I think it would make sense if _ and friends had higher precedence than ^ and friends. Subscripting having higher precedence than exponentiation seems to be common in other languages -- I checked R, Python, and Javascript.

d-torrance avatar May 04 '24 13:05 d-torrance