K
Kurt M. Dresner
I realize what the difference between these two block delimiters is, but
I can't seem to put it in words. I realize that you only use do..end
when you are passing a block to a method, and that you can use
begin..end to create a block expression with a specific return value
(and rescue/ensure clauses). How would I explain to someone what the
difference is, though? I've been reading through "Programming Ruby" and
they just call both of them "block"s. Anyone with a better way of
explaining it?
-Kurt
I can't seem to put it in words. I realize that you only use do..end
when you are passing a block to a method, and that you can use
begin..end to create a block expression with a specific return value
(and rescue/ensure clauses). How would I explain to someone what the
difference is, though? I've been reading through "Programming Ruby" and
they just call both of them "block"s. Anyone with a better way of
explaining it?
-Kurt