2016-02-02 8:22 GMT+01:00 Maciej Izak <hnb.c...@gmail.com>: > 2016-02-01 10:59 GMT+01:00 Michael Schnell <mschn...@lumino.de>: > >> On 02/01/2016 09:35 AM, David Butler wrote: >> >>> >>> >>> Maybe call it "inlineif" or "iif", e..g >>> >>> x := iif (a < 3, 1, 2) >>> >>> It's iif in Oxygen. So why not keep that name ? > > > Same here. I see no reason to differ from it. Introducing new > incompatibility is bad idea. For me is good to have booth (Oxygene > compatible): > > x := iif (a < 3, 1, 2); > V := If a < 3 then 1 else 2; > > sometimes is better to use first option and sometimes is better to use > second option. Both Oxygen compatible and very "pascalish". >
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: if Condition1 then begin if Condition2 then foo := ThenExpr1 else foo := ElseExpr1 end else begin if Condition3 then foo := ThenExpr2 else foo := ElseExpr2 end; -- Best regards, Maciej Izak
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal