4 ms·
It is not syntactic sugar. It is one of two demonstrably equivalent ways to emulate functions of two arguments. The demonstrable equivalence comes from the equa
by catnaroek 13y ago
It is not syntactic sugar. It is one of two demonstrably equivalent ways to emulate functions of two arguments. The demonstrable equivalence comes from the equational theory of cartesian closed categories. The need to emulate functions of more than one variable comes from the fact that only functions of one variable are a native concept.
- Peaker 13y agoThe word is encode, not emulate. Native support isn't any more concise, in fact it is more verbose when partial application is involved. So why complicate the language with native support for a feature whose encoding on top of one argument functions is concise, elegant, and works well?
- catnaroek 13y ago> Native support isn't any more concise, in fact it is more verbose when partial application is involved. I only know too well. Everytime I write stuff like using std::placeholders; std::bind(foo, bar, _1, _2, baz, _3, _4); I wish I were using an applicative language instead.