<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 8/29/25 5:30 PM, Hairy Pixels via
fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGsUGtmBdvZCOsbhBZ777-v=3kH8p9QVHK0u5nX_eNySVxaJvQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Aug 28, 2025 at 5:10:56 AM,
Sven Barth via fpc-devel <<a
href="mailto:fpc-devel@lists.freepascal.org"
moz-do-not-send="true" class="moz-txt-link-freetext">fpc-devel@lists.freepascal.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"
type="cite">
<div>
<div dir="auto">Also there *will* be the if-then-expression,
the question is only when the merge request is finalized
enough (I currently can't check, so I can't comment on any
progress there). </div>
</div>
</blockquote>
</div>
<br>
<div dir="ltr"> <br>
</div>
<div dir="ltr">I didn’t realize it was imminent. </div>
<div dir="ltr"><br>
</div>
<div dir="ltr">What about this:</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">
<div dir="ltr"> if (if x > 10 then 1 else -1) > 0 then</div>
<div dir="ltr"> ;</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">You can do confusing things like this too right?
I don’t think we’re going to avoid confusion with the
intrinsic or this syntax.</div>
</div>
</blockquote>
<p>Yes, that would become valid syntax. However, I doubt you're
gonna see such code anytime soon, outside of obfuscated code
contests (or vibe coded AI slop). Your nested if example is
pointless, because it is equivalent to the much simpler:</p>
<p>if x > 10 then</p>
<p> ;<br>
</p>
<p><br>
</p>
<p>You're more likely to see things like:</p>
<p>a := if x > 10 then 1 else -1;</p>
<p>instead of</p>
<p>if x > 10 then<br>
a := 1<br>
else</p>
<p> a := -1;</p>
<p>At least that's what I see in Rust code, which has a similar "if"
as an expression, as well as a "if" as a statement. People who
have the tendency to like functional programming tend to prefer
the first form.</p>
<p><br>
</p>
<p>Every feature can be abused to write ugly code, but this one is
not so bad, actually.<br>
</p>
<p><br>
</p>
<p>Nikolay</p>
</body>
</html>