[fpc-pascal] New feature: IfThen() intrinsic
silvioprog
silvioprog at gmail.com
Mon Feb 1 15:34:07 CET 2016
On Mon, Feb 1, 2016 at 6:17 AM, Michalis Kamburelis <
michalis.kambi at gmail.com> wrote:
> Maciej Izak wrote:
> > +1 . IfThen instricit is IMO very bad idea. I have a lot of "IfThen"
> > from math and strutils modules.
> >
> > IfThen from System totally breaks the compatibility :\ . C'mon Sven. In
> > one field you're rigorously but in something like this you're liberal
> > (braking/dangerous change / for existing code base).
> >
> > If i understand correctly "ThenExpr" is executed only when "Condition"
> > is true and "ElseExpr" is executed only when "Condition" is false. For
> > standard "IfThen" from Math and StrUtils "ThenExpr" and "ElseExpr" is
> > executed before IfThen is called.
> >
> > for me different syntax for System.IfThen is required (fpIfThen ? or
> > http://docs.elementscompiler.com/Oxygene/Expressions/If/ ).
>
> As far as I understand, compatibility is not broken: new IfThen was
> deliberately introduced as part of the System unit, that is implicitly
> always used as the 1st unit. If you use Math (or StrUtils or any other
> modules that provide IfThen implementations), they will "cover" the
> System.IfThen definition. So your code will continue to work as it was.
>
However Iif() sounds very good.
> And the name like FpIfThen look rather ugly, actually. As far as I'm
> concerned, IfThen sounds simple and Ok.
+1. FpIfThen is very ugly. o.o'
--
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160201/6de0b519/attachment.html>
More information about the fpc-pascal
mailing list