Operator overloading -- lets collect some use cases

bearophile bearophileHUGS at lycos.com
Mon Dec 29 01:31:40 PST 2008


downs:
> The reason infix keywords are useful, is because they can be used as a simple way to chain bijective operations together, i.e. a /foo/ b /map/ c /select/ d. Without infix keywords, this would take the form of select(map(foo(a, b), c), d), which is an atrocity because it has to be read in two directions - middle-leftwards for the operations, and middle-rightwards for the parameters.<

I agree that some syntax support for some form of function chaining may be useful if D wants to become a little more functional. But such syntax has to be chosen with care.

Bye,
bearophile



More information about the Digitalmars-d mailing list