Note that for blocks, {}
and do ... end
are interchangeable. For brevity, only the former will be listed here.
Pre-1.9, lambda
and proc
are synonyms. Essentially the difference is between proc
and block
.
def method(&block) p block.class; p block.inspect; end
l = lambda { 5 }