-
Notifications
You must be signed in to change notification settings - Fork 149
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 with specified size #545
Comments
With constant propagation in Julia v1.0 we could potentially do this automatically, but then it would be difficult to get a dynamically sized array... |
I'm interested in the same (giordano/PolynomialRoots.jl#9). The problem with |
If I define similar(v::MVector,s::Int) = similar(v,Size(s)) is it likely to break your package somewhere? |
Potentially? I'm not 100% sure. The problem as I see it is that sometimes generic code might expect to call I'm not sure what the endgame here is. We could maybe ask to be able to dispatch or branch on "constness" - but I strongly suspect the compiler people would say something like "the problem of determining whether any given variable is found to be constant or not is undecidable (or undefined, or at the very least frequently changing as the compiler evolves) and we don't want this to affect program behavior". Anyone have thoughts on the best way to proceed? |
@EP-Guy ultimately we may require some traits like Generally, I don't know what we can do about this for the reasons described by Andy. Would probably need to be part of a larger carefully considered design iteration. |
Hi,
Is there a way to make this work for
Array
and Static Arrays?Thank you
The text was updated successfully, but these errors were encountered: