[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [5.0] trying to auto init a nil field on first ref...
- From: scott <scott+lua@...>
- Date: Thu, 11 Dec 2003 23:37:59 -0500
On Thu, Dec 11, 2003 at 08:15:22PM -0800, Ando Sonenblick wrote:
>
> r = {}
> r.top = r.top + 10
> print(r.top)
>
r = {}
r.top = (r.top or 0) + 10
print(r.top)
would give you the results that you are looking for, but forces you to
change your second line a bit, which may not be exactly what you wanted.
scott
--