On 10/8/2015 10:35 AM, Mark Morgan Lloyd wrote:

Indeed, it is even more succinct in C/C++:

   x = <boolean> ? <then part> : <else part>;

At which point you'll have various members of the Pascal community decrying it as too C-like.

Well, the tenary operator as present in C(++) is a shortcut for a simple if-then-else, and can be pretty readable if used "in moderation". And it assigns a value to x depending on two expressions not some murky boolean result out of three expressions like Bart supposed...

Ralf


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to