4 ms·
The notation for avoiding parentheses is interesting, and I've thought that it might be useful in programming languages. To illustrate, suppose you have a non-
by radford-neal 2mo ago
The notation for avoiding parentheses is interesting, and I've thought that it might be useful in programming languages.
To illustrate, suppose you have a non-associative operator $. Rather than write a$(b$c), you can write a$.b$c - the . makes the $ before it be lower precedence on the right side. More dots make things be even lower precedence.
So, for example,
a$b .$: x$y .$. p$q
means
(a$b) $ ((x$y) $ (p$q))
At least, that's my recollection. It's been over fifty years since I read (significant parts of) it...
- layer8 2mo agoIn what way do you think this is useful over parentheses?
- radford-neal 2mo agoIt's better visually. No dot, ., :, :., ::, ::., :::, etc. have increasing visual weight, which shows which are the more top-level operators without having to match up parentheses.
- layer8 2mo agoI see. It’s not clear how it would interact with operator precedence, however. For example, what would a * . b + c . + d * e do?
- radford-neal 2mo agoYeah. I'm not sure how one would handle that. (Can't remember if Whitehead & Russell had any inherent operator precedence.) So may be most useful if you don't have inherent precedence, as might be the case if you're not dealing with the standard math operators. Alternatively, one might say the dots override inherent precedence. So a *. b*c+d*e means a * (b*c+d*e) with the inherent precedence disambiguating the right operand of *.