[fpc-pascal] Scoped enums and inferred types

Ryan Joseph ryan at thealchemistguild.com
Wed Feb 21 16:29:24 CET 2018



> On Feb 21, 2018, at 10:13 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> You lose an important type safety if you replace them with constants.

I like enums also but you can imagine when they were proposed the compiler teams probably compared them to constants and decided if they were worth it bloat or not (much like my suggestion and what Swift decided to do). Ultimately it’s just another thing the user can do themselves instead of compiler but if you follow that road too far you’re back to assembly (on the other end is Java/Swift super high level languages).

Btw did enums exist in the first Pascal specs? I honestly kind of forgot about them since I was doing desktop apps from C based API’s that used all constants.

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list