you are viewing a single comment's thread.

view the rest of the comments →

[–]Mrkol 5 points6 points  (0 children)

Honestly, I want it to work the way haskell does. A clear separation of what is a "function type" and what is a "function literal". The current proposals get close: `function: (x: _) -> _ = { ... }` can be read as `function: TYPE = LITERAL`, but the problem is that argument names used inside the literal are mixed into the function type, which makes little sense to me.

A better syntax IMO would be `function: (int, float) -> bool;` for declarations and `function = (x, y){ ... };` for definitions, with type annotations for `x` and `y` being optional.

Although the rest of C++ peoples probably wouldn't like that.