Although I didn't like distinguishing f(...) and f{...}, re-looking at the
factorial example is starting convince me that it's needed. The problem is
that having a function call, with a single infix parameter, is a relatively
common case, and having to embed two different parens to do it is painful to
follow. So it might very well be that accepting f{...} as an abbreviation for
f({...}) is a good idea if I went to the "infix only when surrounded by {}"
model.
Here are some variations, just in terms of looks, of the Common Lisp factorial
function:
* Sweet-expressions version 1 (auto-detection of infix via a pattern):
defun factorial (n)
if (n <= 1)
1
n * factorial(n - 1)
* Infix default (detect with pattern), {..} for grouping, [...] disables infix,
f(...) function call:
defun factorial (n)
if {n <= 1}
1
n * factorial(n - 1)
* Non-Infix default, {..} around all infix:
defun factorial (n)
if {n <= 1}
1
{n * factorial({n - 1})}
* Non-Infix default, {..} around all infix, use f{...} to abbreviate f({...}):
defun factorial (n)
if {n <= 1}
1
{n * factorial{n - 1}}
The last one is odd; as a short example it never shows f(...), which I would
expect to be the COMMON case in most code.
Again, I think that a lot of basics should be done by the READER, since that
way all macros just "automatically work".
--- David A. Wheeler