Re:Rust RAII is better than the Haskell bracket pattern
by dllthomas on Tuesday October 09, 2018 @05:47PM
(#18180081)
Right. I mean, consider your simple python:
with some_resource() as resource:
some_function_on(resource)
Is that broken? If some_function_on saves the resource, yes. If it just temporarily uses it, no.
I don't think the claim that it's syntactically obvious in Python is correct. In both cases the typical syntax helps a little but it's easy to get wrong.
It is the case that "the typical syntax" is a little more enforced by Python-the-language.
I don't think the claim that it's syntactically obvious in Python is correct. In both cases the typical syntax helps a little but it's easy to get wrong.
It is the case that "the typical syntax" is a little more enforced by Python-the-language.