[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: expression as statement
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 17 Nov 2009 10:14:19 -0200
> Say, I want to write code that does '#' on value x. I can write:
>
> while #x do break end
> do local _ = #x end
> (function () return #x end)()
>
> Is there something that has least runtime and size overhead,
> i.e. doesn't create extra branches or stack allocations in bytecode?
There's also
repeat until #x
assuming (as you are) that #x does not return false...
But this generates the simplest bytecode:
do local _ = #x end