blob: a2cb827d771e48960a62400ab76a400088be2476 (
plain) (
tree)
|
|
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
|