53 ms·
An infix language could also require whitespace around operators, so that a-b could be a an identifier. Like in a Lisp infix macro: (infix (a + b * c) / d). T
by kazinator 10y ago
An infix language could also require whitespace around operators, so that a-b could be a an identifier.
Like in a Lisp infix macro: (infix (a + b * c) / d).
This kind of thing is quite habitable: we hardly lose sleep over (3.4) the list of one float versus (3 . 4) the dotted pair of integers.
- brudgers 10y agoI'd say that white space requirements around operators even seems implicitly consistent with the Pythonic idiom of semantic white space and the Pythonic dictum of only one way to do things.
- skrishnamurthi 10y agoPython has many ways to do just about everything (e.g., list comprehensions are completely redundant). It's a nice marketing slogan, though.
- brudgers 10y agoYes, there's even two Pythons.
- skrishnamurthi 10y agoWe're discussing an infix language that does exactly that. In Pyret, binary operators must be surrounded by spaces. Therefore, `a-b` is not ambiguous.