[M3devel] No short-circuit "or" and "and" in Quake

Rodney M. Bates rodney_bates at lcwb.coop
Fri May 30 21:49:29 CEST 2014


I just discovered by accident, an undocumented peculiarity in Quake.
The "or" boolean operator (and, presumably "and" too) do not have the
usual short-circuit property.  So, for example, you can't write:

if not defined("Unicode_WIDECHAR")
    or empty (Unicode_WIDECHAR)

If it's undefined, Quake will still evaluate and crash on the second
condition.


-- 
Rodney Bates
rodney.m.bates at acm.org



More information about the M3devel mailing list