1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
module Kernel # A Ruby-ized realization of the K combinator, courtesy of Mikael Brockman. # # def foo # returning values = [] do # values << 'bar' # values << 'baz' # end # end # # foo # => ['bar', 'baz'] # def returning(value) yield value end end