On Tue, Feb 2, 2016 at 6:07 AM, Michael Van Canneyt <mich...@freepascal.org> wrote:
> On Tue, 2 Feb 2016, Maciej Izak wrote: > >> we can even mix to gain more clear code: >> >> foo := >> if Condition1 then >> iif(Condition2, ThenExpr1, ElseExpr1) >> else >> iif(Condition3, ThenExpr2, ElseExpr2); >> >> much more readable than: >> > > Call me old fashioned, but then I think > I don't think you are old fashioned. :-) > foo:=iif(Condition1, > iif(Condition2, ThenExpr1, ElseExpr1), > iif(Condition3, ThenExpr2, ElseExpr2)); > is more clear. > +1. > The "if then" construct is really confusing. > "if then" is a statement, not an expression. I think strange this logic on the code above, and I totally agree with you. If it was accepted to ObjFPC, it would be the first language to accepet an `if` statement as an expression, sounding as an abbreviation in the language. -- Silvio Clécio
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal