[fpc-devel] Pascal Standard, and what we can do.

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Jul 22 19:43:33 CEST 2015

On 22/07/15 19:24, Paul van Helden wrote:
> What is wrong with a language evolving to allow (in addition to the above)?:
> if X is not TSomeClass then ..
> if 5 not in [1,2,3] then ..
> I'm not a compiler programmer, but it almost seems like laziness that
> the second case is not possible already?

If the "not" operator is overloaded in TSomeClass, "not TSomeClass" can
be a valid expression in itself. "not in" could never be anything else,
but consistency is also very important.

Additionally, keeping the compiler fast and maintainable (and able to
produce sensible error messages when syntax errors are found) conflicts
with arbitrary word orders. Calling that laziness is a bit blunt.

> IMO the design philosophy should be: "if it is more readable it
> should be allowed".

Allowing multiple ways to say the same thing generally does not increase
readability, even if in isolation it can look fine.


More information about the fpc-devel mailing list