[Pas2js] another optimization idea

Michael Van Canneyt michael at freepascal.org
Sat Oct 5 01:34:03 CEST 2019



On Fri, 4 Oct 2019, warleyalex via Pas2js wrote:

> I think it is amazing to see new optimizations/fetures introduced to pas2js. 
>
> a) for instance, a feature IF-THEN-ELSE - a pascal version of the C ternary
> operator ( ? : )

As far as I know, ternary syntax is planned for FPC.

Personally I'm very much against the if-then-else construct for this 
If then else is a statement, not an expression.
Pascal is supposed to be readable, and I think the C syntax is
more readable in an expression than a if... then statement.
But I will not be the one implementing it so it is not my say.

In each case: as soon as FPC has it, pas2js can have it.

Other optimizations are still planned - there is a whole wiki page with
possible optimizations - but an actual planning is not yet made.

Michael.


More information about the Pas2js mailing list