Array Lower Bounds

0ffh frank at frankhirsch.youknow.what.todo.net
Tue Dec 18 15:19:12 PST 2007


Mike Marquard wrote:
> Why would there be a need for an extra memory in normall zero based
> arrays? I would think this would only affect people who decide to use
> the non-standard arrays to hold the lower bounds. And if bounds checking
> is turned off I would think it wouldn't make any difference. Then again
> I've never written a compiler so maybe I'm missing something.

Indeed it would only concern those who use the non-standard arrays /if/
you are actually proposing to add a second array type which is inherently
incompatible with the current native array type (yes, of course it would
be possible to cast between them, if you are prepared to loose the extra
information when casting). But that situation seems... ugly, sorry.
I propose leaving the current array type as it is; you can have your own
(albeit imperfect) array type with any kind if indexing you like right
now - just write it. And sooner or later, you can probably even add the
last bit of perfection you could want (just wait for D to evolve - Rome
wasn't built in a day, or even a decade).

regards, frank


More information about the Digitalmars-d-learn mailing list