Retire the keywords Array, List, and Map
Posted: Thu Jul 19, 2018 4:57 pm
I've never commented on this but it's always bothered me. Basically, these three keywords are equivalent to some of the most common data structures used in programming and, because PureBasic is not case-sensitive, we can't use any form of them as variable names without them being colorized and case-corrected.
For temporary variables that I want to clearly define as one of these collections I have to use weird names like "_list" or something.
The reason for these keywords is to provide a hint for the compiler when using these collections within structures and as procedure parameters. I would much rather see the "Dim", "NewList" and "NewMap" re-used for this purpose to return these keywords to us.
To clarify for others why this isn't an issue in other languages, PureBasic is unique in that these are reserved keywords which means that they can NEVER be used for anything else. In most other languages the words "list/List", etc. are both case-sensitive, scoped, and usually require the explicit inclusion of a standard library before they exist.
I'm sure that this will never be accepted but it's always been something that annoyed me. PureBasic collections have always been this weird facet that does serve a useful purpose but has never really meshed well with the rest of the language.
For temporary variables that I want to clearly define as one of these collections I have to use weird names like "_list" or something.
The reason for these keywords is to provide a hint for the compiler when using these collections within structures and as procedure parameters. I would much rather see the "Dim", "NewList" and "NewMap" re-used for this purpose to return these keywords to us.
To clarify for others why this isn't an issue in other languages, PureBasic is unique in that these are reserved keywords which means that they can NEVER be used for anything else. In most other languages the words "list/List", etc. are both case-sensitive, scoped, and usually require the explicit inclusion of a standard library before they exist.
I'm sure that this will never be accepted but it's always been something that annoyed me. PureBasic collections have always been this weird facet that does serve a useful purpose but has never really meshed well with the rest of the language.