New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntactic Sugar for And #40
Comments
I understand but this is how postfix languages typically work. What concerns me is that in case of infix notation you'd probably want parenthesis for precedence in logical operators as well, right? and that wouldn't be too easy to implement in this case. Could you provide some examples of how you'd expect this to work in min? |
I've just been thinking this week about how a stack based language could handle math-friendly syntax without opening up a can of worms, by coincidence saw this issue just now, unfortunately I never came up with any clever solutions... Apparently some lisp varieties get around the problem with infix macros. E.g. this example for Common Lisp. In a language without macros, you could perhaps lazily evaluate a quotation for infixes.
would become
(then something like ... but that's obviously adding its own sort of noise. This doesn't address the precedence problem at all though; just seems like a possible hacky way to introduce the functionality without changing how the language is interpreted/compiled. |
Uhhh well, I may have just added an infix-dequote symbol after all: 78dad59 It lets you write things like:
BUT of course it doesn't have any concept of operator precedence:
I'd have to teach it that, but I don't think I'll bother (you can use parentheses to clarify precedence anyway). |
Can
and
be made infix? Postfixand
is highly noisy for complex code.The text was updated successfully, but these errors were encountered: