Ruby Blocks Vs Smalltalk BlocksAre these things really the same?
require "Continuation"
callcc do | ret |
(1..10).each do | i |
ret i
end
end
This replicates the SmallTalk behavior. So, they are the same thing, but with different concepts of return. See CallCc.
See also SmalltalkBlocksAndClosures, BlocksInRuby, BlocksInManyLanguages
EditText of this page
(last edited April 24, 2013)
or FindPage with title or text search