Lisp syntax, but using whitespace to remove most parentheses.
- Every line is wrapped as a list unless it's prefixed with an
@symbol. - Empty lines are ignored.
- Indented lines are concatenated to their parent lists.
- An inline arrow acts like indentation without wasting whitespace.
- Use square brackets for inline lists.
- Use round parentheses for infix notation (first two items are swapped)
For example, take the following lisp style program:
(print "Hello World")
(for (x 10)
(for (y 10)
(printf "%d + %d = %d" x y (+ x y))
)
)In my modified syntax, this would look like:
print "Hello World"
for [x 10] → for [y 10]
printf "%d + %d = %d" x y (x + y)A recursive Fib function could look like:
def fib → λ [n]
if (n ≤ 2)
@ 1
@ ([fib (n - 1)] + [fib (n - 2)])
Implement it in Racket and see how it works out for real programs. it is easy to make a new reader at the #lang level and just use the rest of Racket syntax. Make sure you read about the history of paren-less LISP though, such as sweet.