[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How can we make lua better?
- From: crow <crow_64a@...>
- Date: Mon, 28 Feb 2005 15:05:05 -0000
David Olofson <email@example.com> wrote:
>The tricky part is avoiding a dummy initialization before code like
> //y = 0; // No, thanks!
> if a
> y = 1;
> y = 2;
David, did you mean 'No thanks' as in: not wanting the ugly extra assignment to zero?
In a case like this, I use this:
y = 2
if a then y = 1 end
Only two, no 'else' and no chance of a var depending on a conditional branch merely for its prior existence...