Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redimension method for arrays #6

Open
nikomatsakis opened this issue Mar 27, 2014 · 0 comments
Open

Add redimension method for arrays #6

nikomatsakis opened this issue Mar 27, 2014 · 0 comments

Comments

@nikomatsakis
Copy link
Collaborator

Arrays need a redimension method that lets you redistribute their elements over any number of dimensions. As implemented in SpiderMonkey, this method lets you:

  1. Convert a non-array type T into an array type T([1])+ -- i.e., any number of dimensions, as long as they all have length 1.
  2. Convert an array type T[...] into an array type U[...] as long as T and U are equivalent.

Note that this second test is slightly wrong: we should require that T === U to preserve aliasing guarantees (we could do T === U || (T.isTransparent() && U.isTransparent() && T.equivalent(U)), but why? you could always cast the buffer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant