Skip to content

Instantly share code, notes, and snippets.

@kbaird
Created December 20, 2011 20:09
Show Gist options
  • Save kbaird/1503059 to your computer and use it in GitHub Desktop.
Save kbaird/1503059 to your computer and use it in GitHub Desktop.
Nerdy syntactic sugar to allow the Greek letter lambda for Procs in Ruby.
# encoding: UTF-8
module Kernel
alias_method :λ, :lambda
end
=begin
Allows code like this, using the actual Greek λ character:
add1 = λ { |x| x + 1 }
puts "add1.call(2) = " + add1.call(2).to_s + "\n"
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment