[plt-scheme] Re: Paren Paralysis Sufferers Unite

From: Joe Marshall (jmarshall at alum.mit.edu)
Date: Fri Oct 16 18:30:00 EDT 2009

On Fri, Oct 16, 2009 at 1:47 PM, Morgan <lianciana at gmail.com> wrote:
>
> LOL! No, I mean something a wee bit different to that.
>
> taking an example; the difference between these two pieces of code.
>
> (define (get-smallest x y z)
>          (cond ((and (< x y) (< x z)) x)
>                ((and (< y x) (< y z)) y)
>                ((and (< z x) (< z y)) z)
>            )
>  )
>
> scheme is all happy with that, but not with what's below:
>
> (define (get-smallest x y z)
>          (cond (((and (< x y) (< x z))) x)
>                (((and (< y x) (< y z))) y)
>                (((and (< z x) (< z y))) z)
>            )
>  )


Hmmm.  What happens when you do this?

int main
{
         printf "hello, world";
         return 0;
}

> Now, I freely admit there's absolutely no utility in having those
> extra parens.

Why are some parenthesis `extra', but others seem to be `required'?
After all, if too many parens are OK, why not too few?  What's the
difference?

-- 
~jrm


Posted on the users mailing list.