Lisp syntax, but using whitespace to remove most parentheses.
- Every line is wrapped as a list. Use
do
to get just the value. - Empty lines are ignored.
- Indented lines are concatenated to their parent lists.
- A pipe (
|
) 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:
let fib | λ [n]
if (n ≤ 2)
do 1
do ([fib (n - 1)] + [fib (n - 2)])
@jeapostrophe you mean like? http://readable.sourceforge.net/
I've read that and it's where I got the idea of an infix syntax using a different bracket. I decided I prefer round parens for infix and square for regular lists.