News for hackers. Stuff that matters.
Re:Imperative vs. Declarative by masklinn on Tuesday April 02, 2013 @01:59PM (#5480971)
That's a lower-level version of map in a language with destructuring: Haskell would let you say

    double numbers = map (\x -> x * 2) numbers
or

    double [] = []
    double (x:xs) = x * 2 : double xs
or

    double = map (*2)
I don't think #2 is more declarative than #1, let alone #3. Then again, I don't think any of these versions is very declarative.

Declarative would be numpy:

    doubled = numbers * 2

There are no comments on this comment yet.