lua-users home
lua-l archive

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


Hallo,

On Tue, Sep 14, 2010 at 2:58 PM, Tomas Guisasola Gorham
<tomas@tecgraf.puc-rio.br> wrote:
>        Hi Martin
>
>>>     Since Lua is an applicative language both branches would be
>>> evaluated.
>>
>> Whenever that becomes an issue i usually wrap the branches in quotes
>> and evaluate them in the function depending on the condition.
>
>        But then you lost access to local values, don't you?
>

     He could wrap the branches in closures to be applied inside the
if-then-else function. Ugly, nevertheless.

-- 
-alex
http://www.artisancoder.com/