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 dYou 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.
But compare to, say, C where no one complains about the parens:
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: Now you've got nine parens. But still no one complains about C because of that.