-
Notifications
You must be signed in to change notification settings - Fork 20
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
Comprehensions for FixedSizeArrays #155
Comments
We could add a constructor like: (::Type{T}){T<:FixedArray}(x::Base.Generator) = map(i->next(x, i)[2], T) Note, that we need to infer the length |
(That's a cool idea by the way!) |
sounds great if it can be done. Does the fact that |
If |
In StaticArrays I played with the idea of indexing the iterator in the generator directly. The user had to specify at least the size as a type parameter, so something like In mythical future versions of Julia, constant propagation may let you obtain the size of |
that would actually be fine for me |
Vec(i for i=1:3)
generates aVec(Base.Generator{UnitRange{Int64},##7#8}(#7,1:3))
I can of course do
Vec([i for i=1:3])
, but then I first allocate aVector
and then convert it to aVec
. If I have to do many of these, then this will be inefficient. (I am assuming?)Can the functionality I am asked for be implemented?
The text was updated successfully, but these errors were encountered: