> Why have I never seen...
> ...a Lisp that can drop nested parentheses when the meaning is clear from context?
I once wrote a Lisp that dropped closing parentheses for one and zero-argument functions. This was done by introducing simple syntax sugar:
foo | bar
would be equivalent to foo[bar]
in my Lisp -- this would be equivalent to the S-exp: (foo bar)
My implementation used a syntax inbetween S- and M- expressions with brackets instead of parens and the first list element placed before the opening bracket, i.e. `f[x y z]` would mean `(f x y z)`.For zero-arg functions the syntax was:
foo!
same as: foo[]
same as: (foo)
This worked pretty well and in combination with currying would substantially reduce the overall amount of parens in the code.The `f[x]` syntax by itself also has the advantage of removing nesting for curried functions, i.e `(((f x) y) z)` becomes `f[x][y][z]`. In fact in this syntax two consecutive brackets `[[` were illegal.
So it both eliminated consecutive opening parens and substantially reduced consecutive closing parens. This was an effort to fix the major readability problems for people coming into Lisp.
For the curious, both the syntax and the language overall is described here (my master's thesis): https://djedr.github.io/masters_thesis.pdf (Chapter 2 in particular).