<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 9, 2015 at 2:30 PM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I'm not sure this kind of semantics is possible with a compiler intrinsic...<br>
But if it is: In that case the IfThen or IIF() or somesuch has my absolute top preference, followed by ternary. (and the If .. then expression should be blasted to hell ;) )<br></blockquote></div><br></div><div class="gmail_extra">Here's an example:<br><br>uses sysutils;<br>var<br> a,b : integer;<br>begin <br> a:=1;<br> b:=5; <br> assert(a=0, 'error: '+intTostr(b));<br>end.<br><br></div><div class="gmail_extra">compiled with (2.6.4) fpc -al -Sa testassert.pas<br><br></div><div class="gmail_extra">Looking at the assembler code, a=0 is evaluated first.<br></div><div class="gmail_extra">If it's true, the code is passed to the next line after assert, w/o evaluating 'error '+intToStr(b).<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Looks like a good example of conditional intrinsic supported by compiler to me.<br><br></div><div class="gmail_extra">thanks,<br></div><div class="gmail_extra">Dmitry<br></div><div class="gmail_extra"><br></div></div>