[#82706] [Ruby trunk Bug#13851] getting "can't modify string; temporarily locked" on non-frozen instances — cardoso_tiago@...
Issue #13851 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/07
[#82853] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork — russell.davis@...
Issue #13916 has been reported by russelldavis (Russell Davis).
3 messages
2017/09/19
[#82892] [Ruby trunk Bug#13921] buffered read_nonblock doesn't work as expected using SSLSocket — cardoso_tiago@...
Issue #13921 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/20
[ruby-core:82906] Re: [Ruby trunk Feature#13923] Idiom to release resources safely, with less indentations
From:
Eric Wong <normalperson@...>
Date:
2017-09-20 20:03:13 UTC
List:
ruby-core #82906
matz@ruby-lang.org wrote:
> I like `defer` idea, although adding a new keyword is hard.
I like `defer' idea, too; but I think we can overload `ensure'
keyword to take a block and avoid conflicts:
def foo
resource = Resource.acquire
ensure { resource&.close }
do_stuff(resource)
# resource closed by previous ensure block
end
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>