lua-users home
lua-l archive

"or" shortcut does not work - but why?

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


Hello!
Yesterday, I have ported Lua 5.1.2 to Windows CE Handheld PC
2000 using embedded Visual Tools 3.0. My port uses the same
approach as Lua-5.1-CE by "goodtaste", but implements a few
more system functions (I even plan to implement "system" and
perhaps _popen/_pclose as I need that functionality)
The result works like a charm (which is astonishing) with
one strange exception:
 local Result = false; -- you could also use "nil" here
 Result = Result or "anything else";
 io.stdout:write("Result = '"..tostring(Result).."'");
yields "false" (or "nil", resp.) rather than "anything else"
If I change the second line to
 Result = false or "anything else";
then I get the expected output. I already tried to track the
VM's behaviour in order to isolate the problem - but then de-
cided to better ask the list first ;-)
Do you have any idea what might go wrong?
Thanks in advance for any help!
Kind regards,
Andreas Rozek Phone: ++49 (7031) 436 5784
Brunnenstraße 30/2 Mobile: ++49 (151) 172 879 18
D-71032 Böblingen EMail: Andreas.Rozek@gmx.de
Germany URL: http://www.Andreas-Rozek.de

AltStyle によって変換されたページ (->オリジナル) /