The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Short circuit logic
04-18-2020, 08:17 AM
Post: #1
Short circuit logic
I found that I can replace IFs with short circuit logic. Example:

IF a>b THEN
do_something;
do_something_else;
END;

can be replaced by:

(a>b) AND (do_something; do_something_else);

as long as do_something and do_something_else are only calls to other functions or assignments. There must not be statements like IFs, RETURNs, BEGINs, loops... But if this is a really long line the Prime finds an error in it. Any thoughts?
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Short circuit logic - mchris - 04-18-2020 08:17 AM
RE: Short circuit logic - DrD - 04-18-2020, 11:06 AM
RE: Short circuit logic - CyberAngel - 04-18-2020, 07:52 PM
RE: Short circuit logic - Carlos295pz - 04-18-2020, 11:35 AM
RE: Short circuit logic - Carlos295pz - 04-18-2020, 11:39 AM



User(s) browsing this thread: 1 Guest(s)