[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: (not) handling new programming idioms with grace
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 25 Jul 2018 21:35:27 -0300
> The creation of a scoped variable needs to allocate memory, and therefore
> >
> it could fail without creating the scoped variable!
> >
>
> Would it be reasonable to only allow scoped var assignment at declaration,
> and not add the var to the stack if nil?
I don't think so. As I said, the variable must be allocated before
the creation of the resource; if we create the resource and then
the variable allocation fails, the resource won't be closed. But before
the creation of the resource we cannot know whether it will be nil.
-- Roberto
- References:
- Re: (not) handling new programming idioms with grace, John Belmonte
- Re: (not) handling new programming idioms with grace, Roberto Ierusalimschy
- Re: (not) handling new programming idioms with grace, John Belmonte
- Re: (not) handling new programming idioms with grace, Roberto Ierusalimschy
- Re: (not) handling new programming idioms with grace, Patrick Donnelly
- Re: (not) handling new programming idioms with grace, John Belmonte
- Re: (not) handling new programming idioms with grace, John Belmonte
- Re: (not) handling new programming idioms with grace, Patrick Donnelly
- Re: (not) handling new programming idioms with grace, Roberto Ierusalimschy
- Re: (not) handling new programming idioms with grace, John Belmonte