Home | Notifications | New Note | Local | Federated | Search | Logout

Note Detail


Reply to @tonyg@pubsub.leastfixedpoint.com
Tony Garnock-Jones@tonyg@pubsub.leastfixedpoint.com (2026-08-12 14:48:30)
@dthompson (But it only works for Smalltalk. S expressions are fully general and plastic)

---Reply--- Ramin Honary@ramin_hal9001@fe.disroot.org (2026-08-12 15:09:48) @tonyg @dthompson I appreciate the simplicity, and the readability that comes from having a consistent set of rules like that. But it is deceptive, a lot of people expect the “BODMAS” operator precedence they learned in primary school, and I can see Smalltalk ‘s precedence rules leading to bugs coming from people who are caught unaware of these rules.

Although I love Haskell, the idea that they can declare their own infix operators with their own precedence, the “fixity” strength is what they call it, which is between 0 and 9, if I remember correctly — this can be as difficult to read as it sounds. The type checker helps keep you from making mistakes. And if people are careful to follow the most popular rules, for example multiplicative operators (*, .&., &&) have 1-higher fixity than additive operators (+, .|., ||), it turns out to not be that bad. But if you are trying to obfuscate your Haskell code, rewriting all the infix operator precedence rules at the top of your source file is a good way to do it.
Reply

---Replies---
dave@dthompson@toot.cat (2026-08-12 21:33:41)
@ramin_hal9001 @tonyg the very next bit after my screenshot shows this. bonkers stuff!
---Attachments---
image: https://pool.jortage.com/tootcat/media_attachments/files/117/082/551/601/444/681/original/759a95b75c23b310.png