I don't understand. I would _not_ enjoy the removal of our currently
function call operator one bit. But if the language changes, the language
changes. If the original poster convinces a majority of the relevant people
of the benefit and the suggestion is standardized, then I fail to understand
why that would not be C. Perhaps you both mean "C circa 2010"?
(This is the second thread today that I start to read at the end. Sorry!)
I believe it would not be C because the "function" notion would change
completely, throwing away all tradition.
I fiddled with Haskell very shortly when it was the rage on reddit a few
years(?) ago, and the idea is "currying" (I think).
http://en.wikipedia.org/wiki/Currying
In short, instead of defining a function taking N values of different
types (that is, an N-component tuple) and returning yet another value of
yet another type, you define the function as taking only the first
component of the original tuple, and returning another function, which
takes one less arguments. For the returned function, you apply the same
recursion immediately.
In vague Haskell-like sytnax (as I said, I only scratched the surface -- I
stopped as soon as I *thought* I understood monads), the original function
signature ("prototype") is
f :: (type1, type2, type3) -> type4
This is the "C style" declaration, and the "C semantics" go with it:
evaluate all arguments before the call (in unspecified order), call the
function, return the return value. You "call" this as "f (a, b, c)" even
in Haskell, though in Haskell -- to say the least -- (a, b, c) is a single
tuple, not "three arguments". (Sorry, I really can't recall the correct
Haskell syntax, perhaps look at
<
http://en.wikibooks.org/wiki/Haskell/Lists_and_tuples#Tuples> if
interested.)
Contrast:
f1 :: type1 -> type2 -> type3 -> type4
or, fully parenthesized:
f1 :: type1 -> (type2 -> (type3 -> type4)))
You "call" this as
f1 a b c
It is equivalent to the following, fully-parenthesized form:
(((f1 a) b) c)
"f1 a" is a "partial application":
f1 a :: type2 -> (type3 -> type4))
and so on:
f1 a b :: type3 -> type4
This is very alien from C -- there is no immediate way to write the
equivalent of "f1 a b" in C (that is, dynamically create a partial
application, which is itself a function), and even "f1 a b c" -- that
could correspond to the original f(a, b, c) call -- is not evaluated in
Haskell until needed.
http://en.wikipedia.org/wiki/Lazy_evaluation
Sometimes in Haskell, you *do* wish to write
g(h(i))
Haskell does have some syntactic sugar for that:
g $ h $ i
http://stackoverflow.com/questions/940382/haskell-difference-between-dot-and-dollar-sign
I believe the C syntax (with parentheses) reflects an idea very well. I
also believe the Haskell syntax (without parentheses) reflects another
idea very well. It's only that those two ideas are fundamentally
different.
lacos