addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonJoin Group on CardStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Lambda Deep Dive

Better Coding with Ruby Lambdas

The Problem

Object Oriented Design is powerful for organizing software behavior, but without the benefit of lambdas' code-as-data flexibility, it fails to reduce solutions to their simplest form.

Functional programming has been gaining popularity, and many Rubyists have embraced functional languages such as Clojure. While Ruby generally isn't considered a functional language, it does have lambdas and a rich Enumerable library.

Although Ruby's Enumerable functionality is widely appreciated and used, its lambdas generally are not.

The Solution

This presentation introduces the developer to lambdas, and shows how they can be used to write software that is cleaner, simpler, and more flexible.

We'll go through lots of code fragments, exploring diverse ways of exploiting the power of lambdas, and identifying reusable functional design patterns along the way.

Topics covered will include:

* a short introduction to lambdas, including the 1.9+ syntax

* using 'currying' and 'partial application' to simplify the use of lambdas

* assembling composite predicates, transformers, etc., using lambdas and Enumerable methods

* injecting deferred behavior using lambdas with consistent signatures

* a simple scheme for configuring conditional behavior using lambdas

* contrasting the duck typing and lambda approaches

* using lambdas as nested functions to minimize scope and improve code clarity.

Join or login to comment.

  • Ryan S.

    Is this really tomorrow instead of Wednesday?

    January 27, 2014

  • Todd Van D.

    Someone asked what a lambda could do that a block couldn't. I thought this was a short but sweet explanation of some differences between lambdas, procs, and blocks.

    2 · January 28, 2014

  • Keith B.

    The code used for yesterday's session is up at

    Thanks everyone for braving the cold to join in.

    1 · January 29, 2014

  • J. M.

    Wish I could be there but old friends are in from out of town. Might there be slides / recording available after the fact?

    January 28, 2014

    • Keith B.

      Sorry, there was no recording, but I intend to post the code (there were no slides) shortly. Also, I may give the talk again at the Retrocession conference if people want, and possibly at the DC and/or Reston Ruby Meetups.

      January 28, 2014

  • Bruce

    Looking forward to this!

    January 27, 2014

36 went

Our Sponsors

  • New Relic

    Application performance monitoring

  • Clean Ruby

    Get the ebook by Jim Gay about Ruby, OOP, and DCI

  • O'Reilly

    Discounts on print and ebooks.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy