GCC 13.1 released
GCC 13.1 released
Posted May 1, 2023 19:13 UTC (Mon) by bartoc (guest, #124262)In reply to: GCC 13.1 released by eru
Parent article: GCC 13.1 released
All these languages (including C, and Delphi, even though it tries) have the problem that it's basically impossible to implement your own data structure that works like the built-in ones. The syntax just isn't there. I think this is because to do that you either need something that works like C++ references or some way to customize subscripting that differs depending on if the subscript expression is mutable or not (nim's `[]` vs `[]=`, along with `var`, or rust's Index vs IndexMut). Delphi's array properties try to do the second thing but fail a little bit because the return value is the wrong type, so you can't do like array[idx].some_method() and have that method mutate the thing inside the array.
