Skip to content

Instantly share code, notes, and snippets.

View snuggs's full-sized avatar
👤
Committing

Snuggs snuggs

👤
Committing
View GitHub Profile
@snuggs
snuggs / closures_presentation.rb
Created May 10, 2010 11:50
Closures Presentation
# I recommend executing this file, then reading it alongside its output.
# A closure is a block of code which meets three criteria:
#
# * It can be passed around as a value and
#
# * executed on demand by anyone who has that value, at which time
#
# * it can refer to variables from the context in which it was created
# (i.e. it is closed with respect to variable access, in the