Arc Forumnew | comments | leaders | submitlogin
1 point by mdemare 6158 days ago | link | parent

How about a much simpler and less intrusive method? Add a reader method for curly brackets that switches the first and the second argument around. So:

    (a b c) = {b a c}
That means you can write a C-style expression such as this one:

    (f(x) + g(y)) * h(z)
either prefix-wise:

    (* (+ (f x) (g y)) (h z))
or infix-wise:

    {{(f x) + (g y)} * (h z)}
It doesn't give you precedence; worse, you cannot omit any brackets. But it does give you infix, and it's completely optional, and trivial to understand or implement.