Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-02

Re: fpc-pascal Digest, Vol 140, Issue 27

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Serguei TARASSOV
Show quoted text 9 lines
Date: Tue, 2 Feb 2016 14:24:18 +0100 From: Sven Barth > > > >Why make the things complex? Why create another "special case"? > >Look at the "iif" as an statement and the things will be simple. BECAUSE. IT. IS.*NOT*. A. STATEMENT! It never was and it never will be! It returns a value and thus by definition it is an expression!

The first tile in my life I see such strange definition of expression :) Please, use more generic notions.

As I said, "return" statement is a good example. The assignment one too.

And the principal difference between statement and expression that the expression doesn't control execution flow.
As you can see, iif "expression" does.

In C the "?" statement called operator, it may be a good compromise.

Regards,
Serguei