Syntax options

Steven Simpson ss at comp.lancs.ac.uk
Tue Jun 21 00:57:38 PDT 2011


On 21/06/11 08:42, Howard Lovatt wrote:
> I too like the Ali Ebrahimi form [...]:
>
> Expression form:
>  Nilary example: -> 3
>  Unary example: x -> x + 1
>  Binary example: (x, y) -> x + y
>  Curry example: x -> y -> x + y
>
> Statement form:
>  Nilary example: -> { return 3; }
>  Unary example: x -> { return x + 1; }
>  Binary example: (x, y) -> {
>     if (x) { return y + 1; }
>     return y;
>  }
>  Curry example: x -> { y -> { return x + y; } }

Shouldn't that be:

  x -> { return y -> { return x + y; }; }

...for both to be in statement form (inserted return and semicolon)?  Or
mixed one way:

  x -> y -> { return x + y; }

...or the other:

  x -> { return y -> x + y; }




More information about the lambda-dev mailing list