-
Notifications
You must be signed in to change notification settings - Fork 152
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
similar(staticarray, newsize)
produces a statically sized array
#22
Comments
Given that one could create an array of We might conceivably want |
This is a bit like Stefan's proposal in JuliaLang/julia#18161. Maybe |
That would be fine. Base has |
FYI there's also a typealias in base already called |
Oh I get it now... :)
So In general, I have been wondering whether any isbits, indexable collection could be the indices... so |
Maybe yes. But one constraint needs to be contiguity, if the index type has such a notion. In other words, |
Right... I guess this comes back to the old question about the difference between an array and a |
At present, any You probably already saw JuliaLang/julia#10064 (comment). |
* general collection mechanism * cleanup * fix promoted_eltype * cleanup * fix recursive * cleanup * respect user type * add tests * test pass no inf * fix inference * multidimensional case
This is inefficient since the new size won't be known to the compiler, and
Array
would be faster. While speculative, future compiler enhancements might lead to proper constant propagation in this case, I think we should make this return anArray
for now.Should we introduce
similar(array, Val{newsize})
? It clashes with a method in base, but I think this usage makes more sense. @timholy?The text was updated successfully, but these errors were encountered: