Ruby Blocks Vs Smalltalk Blocks

Are these things really the same?

Am I misunderstanding or what?

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


CategoryRuby CategorySmalltalk