lua-users home
lua-l archive

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


cynthia powers <powcyn@gmail.com> writes:
>> I was pretty happy when I finally found out that "x and y or z" was
>> essenttially "x ? y : z", maybe Cynthia is, too.
>
> Thanks. I auto-generate lua from an ast of a c-like language, and then have
> a lua-calling c settup. So,  its easier to keep it is easier for me to
> generate the compact if-then-else in lua from the corresponding
> corresponding x?y:z format

Hopefully you're careful to check for and handle the cases where "x and
y or z" is _not_ equivalent to "x?y:z" ...

(specifically, if y can have a value of false or nil, then the two forms
are not equivalent)

-miles

-- 
Liberty, n. One of imagination's most precious possessions.