10
Nov
09

ruby method currying



Just wanted to share this link with you. Basically, this is how you can curry a method in Ruby:


class Object
   def curry(method,*params)
      lambda { send method,*params }
   end
end

Thanks Marcos Toledo!

Advertisements

0 Responses to “ruby method currying”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 229,426 hits

%d bloggers like this: