Op 2015-10-08 om 19:25 schreef Dmitry Boyarintsev:
On Thu, Oct 8, 2015 at 12:54 PM, Sven Barth <pascaldra...@googlemail.com <mailto:pascaldra...@googlemail.com>> wrote: I had the idea to implement inline-if as well. I think the syntax I selected is derived from Oxygene, but it looks very Pascal and shouldn't break anything: left := if expr1 then expr2 else expr3; Thereby expr1 returns Boolean and expr2 determines the type of the whole inline-if, thus expr3 needs to be compatible to expr2. Does Oxygene allow something like this? left := if expr1 then begin exprN, left := exprK end else begin left:=left+3; exp3 end or is it only one expression at a time? left := if expr1 then if expr2 then expr5 else expr6 else expr7;
Only one expression at a time, since the 'result' of the expression in oxygene is the combined type of the true value and false value, false being optional defaulting to nil.
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel