
28 Apr
2012
28 Apr
'12
10:22 p.m.
On 04/28/2012 08:47 PM, Mike Meyer wrote:
Ruby makes a bad fit if Haskell is a goal (and that's a good goal). Ruby functions aren't first-class objects, and can't simply be passed to other functions as arguments.
That's like, the least true thing you can say about Ruby =) A simple test program: $ cat fcf.rb def foo puts "foo" end def call_arg(f) f end call_arg(foo) Running it: $ ruby fcf.rb foo Moreover, every function and method implicitly accepts a function as an argument: $ cat yield.rb def call_block yield end call_block { puts "foo" } This allows you some nice do-block syntactic sugar instead of lambdas which can get ugly. $ ruby yield.rb foo