News for hackers. Stuff that matters.
Re:The reason why Blub programmers have such a hard time pic... by euccastro on Saturday September 29, 2007 @11:47PM (#61218)
That may be the correct way, e.g., if you do a lot of list squaring, and if you don't square other things a lot. Even in this case, I'd prefer something like

dest = mapsquare(src)

Consider the possibility that C-like syntax and mixedCaseVerboseNames may be an acquired taste.

If you do square a lot other things than lists, it's probably best to say

dest = map(square, src)

For one-shot usage where defining square seems overkill, and where it's available and idiomatic, I find the list comprehension most readable.

Re:The reason why Blub programmers have such a hard time pic... by mynameishere on Sunday September 30, 2007 @12:05AM (#61221)
dest = map(square, src)

Well, this is okay. Of course, in java, you have to hack it unpleasantly,

List dest = map(UtilityMethods.class, "square", src)

...you have to manually extract the method "square" from UtilityMethods.class and process it over src. One advantage: You can use UtilityMethods as a namespace and swap in different methods thereby.