[fpc-pascal] New feature: IfThen() intrinsic

Philippe Lévi Philippe at quarta.com.br
Tue Feb 2 01:02:43 CET 2016


I thought about "condEval( cnd, true, false);"


we are looking for a name of a function ... and "if" is a statment ... variations of  "if" still have the flavour of statment name ...


Philippe

________________________________
De: fpc-pascal-bounces at lists.freepascal.org <fpc-pascal-bounces at lists.freepascal.org> em nome de Roberto P. <padovani.r at gmail.com>
Enviado: segunda-feira, 1 de fevereiro de 2016 19:34
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] New feature: IfThen() intrinsic

Maybe we shouldn't focus all that much on the " if " word..since all in all, it is meant to be differently from the language if-then-else
What about using another word suggesting a choice?

   j := Switch(i < 32, 48, 21);
   j := Select(i < 32, 48, 21);
   j := Which(i < 32, 48, 21);

They look to me as a goog compromise between expressiveness (IfThen) and typing-laziness (iif).

Roberto


2016-02-01 20:24 GMT+01:00 Philippe Lévi <Philippe at quarta.com.br<mailto:Philippe at quarta.com.br>>:
iif ... sounds good to me! +1 !
Philippe

________________________________________
De: fpc-pascal-bounces at lists.freepascal.org<mailto:fpc-pascal-bounces at lists.freepascal.org> <fpc-pascal-bounces at lists.freepascal.org<mailto:fpc-pascal-bounces at lists.freepascal.org>> em nome de Marco van de Voort <marcov at stack.nl<mailto:marcov at stack.nl>>
Enviado: segunda-feira, 1 de fevereiro de 2016 16:22
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] New feature: IfThen() intrinsic

In our previous episode, Maciej Izak said:
> >
> iif is not semantic clear.  IIF means "Immediate IF". Citation: "both
> truepart and the falsepart will be evaluated regardless of which one is
> actually returned." - https://en.wikipedia.org/wiki/IIf

Well, correct that then :)
_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org<mailto:fpc-pascal at lists.freepascal.org>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org<mailto:fpc-pascal at lists.freepascal.org>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160202/840b3968/attachment.html>


More information about the fpc-pascal mailing list