3 ms·
Why all the hate? Perl 6 and Perl 5 are two different languages. If you hate the second, you shouldn't automatically hate the first. The reverse is also true
by jrockway 17y ago
Why all the hate?
Perl 6 and Perl 5 are two different languages. If you hate the second, you shouldn't automatically hate the first. The reverse is also true.
Partial function application is a nice feature. The quote from the article that prompted the application of this term describes a feature which is more like Haskell's "sections", which is a very useful feature. (Currying is what happens; a "section" is the syntax that curries the operators.)
It's nice to be able to write:
(neg, pos) = partition (< 0) numbers
instead of:
(neg, pos) = partition (λx -> x < 0) numbers
Right? It's also useful elsewhere.
Clearly, it's possible to write a computer program without this syntax sugar. But criticizing someone for their work in adding it to a language doesn't make much sense to me. It's available if you choose to use it. It doesn't seem like a very good reason for inventing a derogatory term and posting it to the front page of HN, anyway.
(BTW, I'm a total wanker! I like all of Perl, Haskell, and Lisp.)
- nostrademons 17y agoTechnically, a section is the syntax that partially applies the operators. Currying is a different (though somewhat related) concept; yes, the standard libraries of both Dylan and certain Scheme implementations have gotten that wrong. Currying is when you take a function that takes a tuple, and change it into a function that returns a function. The Haskell prelude definition has it right: curry :: ((a, b) -> c) -> a -> b -> c curry f x y = f (x, y) Uncurrying is the reverse, taking a function that returns a function and making it take a tuple instead: uncurry :: (a -> b -> c) -> ((a, b) -> c) uncurry f p = f (fst p) (snd p) Partial application is when you take the function that currying gave you, and apply it to only some of its initial arguments. Haskell functions are curried by default (it's pretty easy to define uncurried versions, but it's not what the syntax encourages). </pedantic>. Yeah, I think I'm more of a language wanker (wankler?) than you are. ;-)
- jrockway 17y agoThanks for the explanation. Yeah, I think I'm more of a language wanker (wankler?) than you are. ;-) I thought about going into this much detail, but when you are engaging people that just want to insult, it is probably not worth the time. Better to use the time to use these clearly-useless features to write clearly-useful programs instead :)