[plt-scheme] lisp sans parentheses

From: Srikumar Subramanian (srikumarks at mac.com)
Date: Sun Jul 30 22:05:50 EDT 2006

> Hi,
> <SNIP>
> 2. We use right associative infix operator notation -
>         a * b + c  translates to (* a (+ b c)) in
> lisp.
> </SNIP>
> This clearly violates mathematical convention. Is this
> a typo, or is it intentional?
>
> Regards,
> Nusret

Totally agree. Its intentional and I chose that example to
illustrate that it doesn't agree completely with mathematical
convention and only the infix part is respected.

I program a lot in C/C++ and I'm quite paranoid about
parentheses for mathematical and logical expressions.
Maybe just me, but I can never remember precedence rules
confidently enough so I end up writing
  (a > b) || (c > d)
always instead of
   a > b || c > d
just so I'm saved by habit in case I get the wrong
precedence. Precedence rules complicate the parser with
relatively little extra benefit beyond the infix notation.

A consistent grouping rule for infix operators is, imho,
easier to use when programming.

-Srikumar


Posted on the users mailing list.