<p>Am 08.10.2015 23:48 schrieb "Michael Van Canneyt" <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>>:<br>
> Actually, yes I think C's or Javascript's ternary is better suited.<br>
><br>
> Let me explain. If I see<br>
><br>
> If expr1 then expr2 else expr3<br>
><br>
> it says 'statement' to me. But<br>
><br>
> a ? b : c;<br>
><br>
> Says "expression" to me.<br>
><br>
> So<br>
><br>
> left := a ? b : c;</p>
<p>That's probably only because other languages use that as the ternary.</p>
<p>There also another reason why I prefer the variant with the if: ease to implement in the compiler.</p>
<p>For the if one merely needs to add a corresponding case in factor() while for the ?: one needs to fiddle with the compiler's operator precedence rules that are applied in sub_expr() which can lead to desaster either during implementation or later on when bugs are discovered...</p>
<p>So that's another reason why I'm inclined to this...</p>
<p>(Also that Algol-60 as the spiritual predecessor of Pascal has them as well is quite intriguing :) )</p>
<p>Regards,<br>
Sven</p>