Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Functional Programming with Ruby

23,366 views

Published on

This presentation shows how to apply functional programming principles to Ruby. It covers some theoretical principles but also code examples.

Published in: Technology, Education
  • @tokland Aaand I just realized that you have actually used `Hash#[]` and explained why you don't like it on Slide #29 (How in the world did I misread the code?!). Now that I tried out `mash()` in IRB, I fully see your rational and I appreciate the elegance of the solution. Thanks for your reply.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • @ysulaiman I am aware of Hash[...], check my whole rationale here: http://bugs.ruby-lang.org/issues/666#note-6 Basically my point is that Hash[...] breaks OOP flow (we want a method!) and builds an intermediate array (while mash is an enumerable method and performs the key/value transformation on the fly).
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Thanks for sharing this informative presentation.

    Regarding the example of converting an Enumerable (Array) to a Hash on Slide #28, and under Ruby 1.9.2 or higher, why not use the new form of the `Hash#[]` method as in the following gist?
    https://gist.github.com/4453725
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Really funny
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • nice.. thx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

×