Non-extensibility of Typed Arrays

Niko Matsakis niko at alum.mit.edu
Thu Sep 5 03:24:46 PDT 2013


On Thu, Sep 05, 2013 at 09:15:11AM +0200, Andreas Rossberg wrote:
> Maybe it actually _is_ worth considering a different equality
> semantics for structs and typed arrays. In essence, they are a kind of
> super-fat pointer, and we could give them the usual notion of (fat)
> pointer equality. That is, two objects are equal if they are
> equivalent views to the same backing store. It would make them value
> types, more or less.
> 
> As an implementor, I don't like this idea too much :), but from a user
> perspective it would probably be saner.

Perhaps. Note that arrays can still point at overlapping memory
without being *equal*. So the same basic guarantees hold as today:

  `==` => aliasing
  `!=` => nothing in particular


Niko


More information about the es-discuss mailing list