lua-users home
lua-l archive

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


> if a < b then return 10 else return 25 end
>
> but some are more comfortable with other, more terse forms that are not
> currently supported in Lua.

and indeed (if a<b then 5 else 4) allows if...thens to be expressions rather
than statements. So you could then imagine writing c = if a <b then 5 else 4
...ooh, we're nearly at functional programming. However, it's not at all
obvious this is a good thing to do to Lua, for all sorts of reasons.

-- 
http://sc3d.org/rrt/ | competent, a.  underpromoted