(This is from Alan Manuel Gloria, presumably it was meant to go to the list 
instead of just me.)

On Dec 4, 2007 3:50 AM, David A. Wheeler <[EMAIL PROTECTED]> wrote:
> 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.
Yeah, the {} to denote infix looks rather horrid.  Maybe it's better
to Just default it back to always-infix....

>
> Again, I think that a lot of basics should be done by the READER, since that 
> way all macros just "automatically work".
Hmm.  Looks like macros are really gonna be a nasty problem.


Reply via email to