[fpc-pascal] Scoped enums and inferred types

Bernd Oppolzer bernd.oppolzer at t-online.de
Wed Feb 21 18:41:16 CET 2018

Am 21.02.2018 um 16:29 schrieb Ryan Joseph:
>> 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.

the very first Pascal specifications of the 1970s had enums,
but they were called "scalar types" at that time.

see page 10: http://bernd-oppolzer.de/PascalReport.pdf
(page 18 of the PDF).

Kind regards


> Regards,
> 	Ryan Joseph
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

More information about the fpc-pascal mailing list