Which language constructs could be done as a library if we accept some breaking changes?

Nick Treleaven nick at geany.org
Mon Nov 29 13:22:34 UTC 2021


On Monday, 29 November 2021 at 13:11:47 UTC, Alexandru Ermicioi 
wrote:
> But isn't a slice basically a struct with pointer and length?
> Therefore you can consider that a slice is never null, but 
> rather internal ptr field is, while length is 0.
> The assoc array could follow same logic, i.e. point to null 
> node.

For slices we could just stop supporting null and require `[]` 
instead, but I expect it would break quite a lot of code. For 
AAs, `null` is part of its design as a reference type. I'm not 
sure how you would get around that elegantly.


More information about the Digitalmars-d mailing list