-
Notifications
You must be signed in to change notification settings - Fork 38
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
Unify Ones
and Zeros
as SFill{0}
and SFill{k}
?
#104
Comments
Coming here from JuliaArrays/StaticArrays.jl#815. I'll let others debate about whether the machinery is worth it :) A small note - I'm not sure you want the value |
We already have A more pressing case is where the length is static. But it seems this might be better done via Edit: Errr, there is: julia> axes(SVector(1,2))
(SOneTo(2),) So Actually we can already support static lengthed julia> Fill(1, (SOneTo{2}(),))
2-element Fill{Int64,1,Tuple{SOneTo{2}}} with indices SOneTo(2): entries equal to 1 |
Coming from #176 (compatibility with Static.jl), might const Ones{T,N,Axes} = Fill{Static.True,N,Axes}
const Zeros{T,N,Axes} = Fill{Static.False,N,Axes} not be an elegant alternative? |
Where did |
If FillArrays would take on Static as a dependency, also #140 could be extended to enable
|
Ooops, indeed! :-) That's a problem, because there's no common static supertype across all value types in Static.jl. But we could do
(Update: As @dlfivefifty pointed out, no we can't) |
Except then you lose the propagation of static values so there's no point... |
I would say a better solution may be to just support |
Ah, silly me
General support for Static would be awesome (e.g. for the possibilities with And I guess one you just use Ones{StaticInt}(5) then, right? |
It might make the code cleaner to do:
It would then be possible to support other special cases. Though whether this machinery is worth it is not clear.
The text was updated successfully, but these errors were encountered: