News for hackers. Stuff that matters.
Re:Not Lisp again (2009) by lisper on Tuesday May 02, 2017 @08:38PM (#14252103)
F# and all ML derivatives are an aberration because they use juxtaposition to denote function calls. That eliminates a lot of parens but personally I find the result less readable.

But compare to, say, C where no one complains about the parens:

    int fact(int n) {
      if (n==0) {
        return 1
      } else {
        return n*fact(n-1);
      }
    }
That's six pairs of parens. The only reason it's not more is because some function calls in C are disguised as operators, and those just happen to be the functions that factorial uses. If we wanted a semantically equivalent function that handled bignums you'd have to write:

    bignum fact(bignum n) {
      if (bignum_is_zero(n)) {
        return n;
      else {
        return bignum_multiply(n, fact(bignum_subtract_1(n)));
      }
    }
Now you've got nine parens. But still no one complains about C because of that.
Re:Not Lisp again (2009) by chriswarbo on Wednesday May 03, 2017 @08:28AM (#14255075)
> F# and all ML derivatives are an aberration because they use juxtaposition to denote function calls. That eliminates a lot of parens but personally I find the result less readable.

It makes a lot of sense when all functions are curried. Parenthesised function calls treat all of these as different things:

    f(a, b, c, d)
    f(a, b, c)(d)
    f(a, b)(c, d)
    f(a, b)(c)(d)
    f(a)(b, c, d)
    f(a)(b, c)(d)
    f(a)(b)(c, d)
    f(a)(b)(c)(d)
If functions aren't curried, then these all mean different things. When functions are curried, all of these have the same semantics (call `f` with `a`, call the result with `b`, call that result with `c` and call that result with `d`); ML's juxtaposition syntax makes these semantically-identical expressions syntactically-identical too:

    f a b c d
Re:Not Lisp again (2009) by lisper on Wednesday May 03, 2017 @11:41AM (#14256689)
You can curry in Lisp too, and if you do you can get rid of all but one of the unnecessary parens as well.

    (curry f a b c d)
Re:Not Lisp again (2009) by brianberns on Tuesday May 02, 2017 @09:18PM (#14252275)
Only if you assume that curly braces function as parens in C, which isn't true.
Re:Not Lisp again (2009) by lisper on Tuesday May 02, 2017 @10:14PM (#14252492)
It's not an assumption, it's a fact. Curly braces serve the same function in C as (some of the) parens do in Lisp.