Nordlöw:

Have anybody thought about adding safe enum-based indexing to builtin arrays? Ada has this.

I'd like this. I'd like even more: a general way to have optionally strongly typed array indexes.


    enum I { a=3,b=4,c=5 }
    int[I] x = [3,4,5];

In D currently that "int[I]" is an associative array with I index and int values. So in another post I have suggested another syntax.

Bye,
bearophile

Reply via email to