[fpc-pascal] IfThen() intrinsic removed

Sven Barth pascaldragon at googlemail.com
Fri Feb 5 10:48:32 CET 2016


Am 05.02.2016 10:46 schrieb "Lukasz Sokol" <el.es.cr at gmail.com>:
>
> On 05/02/16 09:22, Lukasz Sokol wrote:
> > Hi,
> >
> > On 04/02/16 21:33, Michael Van Canneyt wrote:
> >>
> >>
> >> On Thu, 4 Feb 2016, Felipe Monteiro de Carvalho wrote:
> >>
> >>> Disappointed :(
> >>
> >> Well, such is life. I'm also disappointed that my bank account doesn't
contain millions. But I learned to live with it :-)
> >>
> >> But all hope is not lost yet.
> >>
> >>> Why was it done? I thought that pretty much everyone was in favor?
> >>
> >> Not quite, form was also deemed important. It is a tricky balance.
> >>
> >> To recapitulate:
> >>
> >> There were various choices:
> >>
> >> a) not adding at all
> >> b) a ? b : c
> >> c) if a then b else c
> >> d) iif()    (or some variant thereof)
> >
> > what of
> >   e) some kind of assignment, requiring use of braces, e.g.
> >    x :=  ( if condition then truevalue else flasevalue );
> > or
> >    x :=  ( condition then truevalue else falsevalue );
> >
> > ... ?
> >
> > It also does not clash with function names, only reuses same keywords...
>
> An as reusing keywords is a no-no...
>
> I wrote x := ( condition, true := truevalue, false:=falsevalue); in
previous email;
> but since true and false are constants (and reserved names) too,
>
> maybe, actually, a new keyword (pair) would be actually OK ?
>
> x := (condition; whentrue:=truevalue; whenfalse:=falsevalue); ?
>
> yes requiring use of assignment, braces, and assignments inside braces.

You're butchering the language even more than if-then-else could have -.-

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160205/2df35245/attachment.html>


More information about the fpc-pascal mailing list