On Monday, 28 April 2014 17:20:34 UTC+1, Stefan Karpinski wrote:
>
> Python has the with
> keyword<https://docs.python.org/release/2.5/whatsnew/pep-343.html>,
> which serves a similar role. However, I have to admit that I've never
> really understood how the Python style `with` approach is a better than the
> Ruby-style (do)-blocks. The with keyword seems more limiting since you
> can't, for example, evaluate the block multiple times. Does anyone have any
> reasons why the with approach is better?
>
Sorry, I should clarify, I didn't mean to rename `do`, I meant renaming
`open` in the case where a function is the first argument. e.g.
withfile("outfile", "w") do f
write(f, data)
end