Am 2016-02-02 um 11:41 schrieb Mark Morgan Lloyd: > Michael Van Canneyt wrote: > Yes, and that's why to get the desired semantics it's more appropriate to use if then else rather than iif() etc. > Please correct me if I'm wrong, but my understanding is that in all cases where parameters are passed to a procedure or function > they are evaluated and placed on the stack before the code is called. However the if then else statement never, under any circumstances, > executes code in the untaken statement/block, and it is that which is the required behaviour for an "inline if" expression.
Yes, I fully agree. If the behaviour is/will be exactly the same as "if .. then ... else" then it should also get a name that shows this clearly. Therefore, I would still vote for "IfThenElse(.. , .. , ..)". "InlineIf(.. , .. , ..)" would be ok too but not as clear as "IfThenElse". If "IIF" in other languages is more of a function in these languages (so both branches are evaluated in all cases) then I would not use the same name in Pascal but implement a different behaviour. Would this be possible in other languages: var c : char; s : string; c := IfThenElse(Length(s)=0,' ',S[1]); ? _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal