10 Jan
2010
10 Jan
'10
3:48 p.m.
On 10 Jan 2010, at 19:59, mike clemow wrote:
1 => foo;
this is sane, but this isn't:
1 => foo => bar;
foo(1) is the same as 1 => foo
foo => bar is the same as bar(foo)
When combining, one need to specify a binding order. Should it bind to the left, like say +: (1 => foo) => bar; or to the right, as for example the assignment operator = in C/C++: 1 => (foo => bar); One can be the default, and the other can be invoked by the use of parenthesizes. Such combinations are quite useful in C++ as "manipulators" of IO- streams. For example, chin => parser => value; Here, the manipulator parser() could be a function that takes a chin as an argument, parsers it, and returns a value. Hans