More on "Component Programming"

bearophile bearophileHUGS at lycos.com
Tue May 28 04:53:51 PDT 2013


Jacob Carlborg:

> Why not use proper lambdas instead of strings?

Mostly for personal reasons: quoted strings are sometimes a 
little shorter, and they require you to use arguments with 
default names (as "a" and "b"), this increased standardization 
makes me read them a little faster than lambdas that have varying 
argument names. If I see q{a + b} I don't need to go look what a 
and b are, for me it's a "standard" sum, like one to be used by a 
reduce().

It's a bit like the "pointfree" style in Haskell 
(http://www.haskell.org/haskellwiki/Pointfree ), also named 
"tacit" in other languages, where you don't name input variables; 
that if overused makes the code unreadable, but if used a bit and 
wisely allows you to underline the transformations done on the 
data instead of on the (sometimes arbitrary) names you give to 
parts of generic data.

Bye,
bearophile


More information about the Digitalmars-d mailing list