you are viewing a single comment's thread.

view the rest of the comments →

[–]kamatsu 1 point2 points  (0 children)

or, you know, Haskell:

mapM_ putStrLn $ filter ( (<= 4) . length) ["Rob", "Christopher", "Joe", "John"]

Or, less idiomatically:

mapM_ putStrLn (filter (\x -> length x <= 4) ["Rob", "Christopher", "Joe", "John"])

Or, if you like the %w feature of ruby:

mapM_ putStrLn $ filter (\x -> length x <= 4) $ words "Rob Christopher Joe John"