[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re:Remind me
- From: "marcus.cf" <marcus.cf@...>
- Date: Fri, 17 Oct 2003 21:18:50 -0300
You can use a table indexed by a boolean (i learned this
with Delphi, hehe). Not tested, but should work:
yesno = {[false] = "no", [true] = "yes"}
boolvar = true
print("Is today Sunday?" .. yesno[boolvar])
> What's the equivalent Lua idiom for C's ? :
> operator(s)? Obviously I
> could do it with a function, but that seems a little
> heavy-weight.
>
> Example: Simplify the following:
> print
> ("Is today Sunday? " ..
> (function (dow) if dow == 0 then return
> "yes" else return "no" end end) (0))
>
> Thanks,
>
> Curt
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/