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

Maciej Izak hnb.code at gmail.com
Mon Feb 1 18:10:02 CET 2016


2016-02-01 17:41 GMT+01:00 Fabrício Srdic <fabricio.srdic at gmail.com>:

> Em 01/02/2016 12:52, "leledumbo" <leledumbo_cool at yahoo.co.id> escreveu:
> >
> > > Iif sounds good, and would be very useful for converting C code.
> > > However Iif() sounds very good.
> > > Me too. Iif is used for many languages.
> > > +1+1+1+1+1 iif(). :-D
> >
> > I'm with Silvio. The name "inline if" (iif) describes its semantics
> clearer
> > than IfThen, which already has semantics of being regular function with
> all
> > parameters evaluated first instead of a syntactic sugar for if-then-else
> > statement.
>
> +1
>
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

IIF is equivalent of IfThen from Math / StrUtils, intrinsic "IfThen" works
in different way. We can not make such a mess.

-- 
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160201/dad745c8/attachment.html>


More information about the fpc-pascal mailing list