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

Jay K jay.krell at cornell.edu
Sat May 31 01:13:48 CEST 2014


Yes, I know, it is unfortunate and counterintuitive. I workaround it all the time.
 
 - Jay

 
> Date: Fri, 30 May 2014 14:49:29 -0500
> From: rodney_bates at lcwb.coop
> To: m3devel at elegosoft.com
> Subject: [M3devel] No short-circuit "or" and "and" in Quake
> 
> 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
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20140530/907ee3a4/attachment-0002.html>


More information about the M3devel mailing list