3 ms·
Open arrays were in Delphi from the beginning, but Dynamic arrays were added much later (circa 4.0 IIRC.) Object Pascal was always a lot more free with setting
by memsom 8y ago
Open arrays were in Delphi from the beginning, but Dynamic arrays were added much later (circa 4.0 IIRC.)
Object Pascal was always a lot more free with setting the bounds of an array too - you could specify any arbitrary range or even an enumeration. That's one thing I miss in C like languages. Being able to define an enumeration, then set the array bounds to that type - and then access it via the enumeration's values.
On a side note, I also miss sets. They were a first party part of the language, not a set of bolted on classes in the runtime library. I remember that I would quite often defined an enumeration, and array that used that enumeration as the subscript and a set to allow parts of the enum to be turned on and off when accessing the elements of the array. That was pretty cool. It made certain things a lot simpler - like defining errors that were raised by an action and then getting their textual error messages - all without having to do any conversion or anything fancy.
- pjmlp 8y agoYeah I loved sets, enumerations and sub-ranges as well. You can achieve some parity in C++ and other languages with similar type systems, but it does require some tricks and I am not sure if everyone would appreciate it.