Am 02.02.2016 16:11 schrieb "Martin" <f...@mfriebe.de>: > > On 02/02/2016 13:24, Sven Barth wrote: >> >> >> > 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! >> >> > +1 > And imho that why it is important that it does not look like a statement either, i.e. it does not start with a keyword. > > also if we are discussing (are we?) a form like > x:= iIf a>b iThen c iElse b; > then why not > x:= a>b ifThen c ifElse b;
Because I won't add new keywords just for this feature, especially if they are inside normal code (I'm a bit less strict outside of routine bodies ;) ). Also in your second case especially the "ifThen" needs to be handled as an operator to avoid too big modifications of the parser that I don't see justified for something that should merely be a minor extension. > What are the advantages/disadvantages they have over each other? The former is much more easy to add as my patch in the "if-then-else expression" thread shows. The other will be be more complicated. Regards, Sven
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal