[fpc-pascal] if-then-else expression

Dmitry Boyarintsev skalogryz.lists at gmail.com
Tue Feb 2 22:22:11 CET 2016


On Tue, Feb 2, 2016 at 4:07 PM, geneb <geneb at deltasoft.com> wrote:

I probably missed it, but what problem is "IfThen()" actually solving?
>
> It's a sugar syntax, for

if cond then
  x:= a
else
  x:=b;

Just follow this thread:
http://lists.freepascal.org/pipermail/fpc-pascal/2016-January/046375.html

Pro #1: shortness of script
Pro #2: easier porting of C-style code (with ternary ? operator. Pascal
doesn't have an equivalent
https://en.wikipedia.org/wiki/%3F:#Programming_languages_without_the_conditional_operator
)

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160202/2a50ccee/attachment.html>


More information about the fpc-pascal mailing list