Allowing Infix Notation in Lisp

 

 

One of the most aggravating features of the Lisp and Scheme family of programming languages for programmers new to the language is that of prefix notation.  For centuries, the world has used infix notation to designate mathematical expressions, and almost all programmers have always used the infix notation.  The Lisp and Scheme family of languages use the prefix notation, which, while understandable, makes the language much harder to learn.

With the addition of this change, a simple expression, 1 plus 1, would go from looking like:

From:

(+ 1 1)

To:

(1 + 1)

With a more complex expression:

From:

(+ (* 3 4) (* 6 7))

To:

(3 * 4) + (6 * 7)

While not a monumental change, allowing the infix notation in Lisp would not be backwards compatible, unless there would be a way to notify the compiler which notation you will be using, either at the beginning of the program, or at the point of the expression, which itself would be tedious.  The addition of a switch that would toggle between prefix and infix notation would be the most sensible solution, which would also allow for an easy conversion to backwards compatibility, by simply adding one or two lines of code to existing programs.

This change would be unique among programming languages, if only for the reason that almost every other programming language already uses the infix notation.  This change will be easily adapted to by programmers, as everyone will already have the necessary experience with infix notation, as it is the standard.

Allowing infix notation in Lisp will not in any way hinder the language, but it will also not benefit the language in many ways, the change is primarily cosmetic, to allow for much easier programming.