Short is Good

Here’s a little Ruby snippet that I enjoy:


module Kernel
  alias fn lambda
end

Example usage:


lambda {a_call}.should raise_error
fn {a_call}.should raise_error

Courtesy of Arc.

Comments

Leave a Reply




  • About

    Daniel Lucraft, London, UK. Interested in Ruby, Prolog and software.