lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Em qua, 12 de jun de 2019 às 15:45, nobody
<nobody+lua-list@afra-berlin.de> escreveu:
>
> On 12/06/2019 19.33, Coda Highland wrote:
> >
> >
> > On Wed, Jun 12, 2019 at 12:28 PM Andrew Gierth
> > <andrew@tao11.riddles.org.uk <mailto:andrew@tao11.riddles.org.uk>> wrote:
> >
> >     Egor suggested <resource>. I think Sean Connor's <cleanup> is better,
> >     but to throw out some other random ideas: <unwind> or <onexit>.
> >
> >     --
> >     Andrew.
> >
> > +1 to <onexit>. I think I might like it better than <scoped>.
>
> I think <onexit> will be confusing:  It's not run when you exit the
> program but when you leave the current scope.
>
> > <cleanup> and <unwind> aren't bad.
>
> <cleanup>, <unwind>, <scoped> would all be fine for me, with
> <unwind>/<scoped> slightly preferred – these two describe the mechanism
> / when stuff happens, not what happens.


What about <catch> and __catch?
It is simple, short and it will be caught when out of scope anyway.


-- Rodrigo