Vexatos / CircularArrays.jl

Multi-dimensional arrays with fixed size and circular indexing.
MIT License
38 stars 12 forks source link

map problem #14

Closed BASS10 closed 3 years ago

BASS10 commented 3 years ago

I get an error when I try to use map on a circular array. It seems like this should work but perhaps I am missing something.

e.g. map(x -> x+1, CircularArray([1,2,3,4])) throws an error...

ERROR: MethodError: similar(::CircularVector{Int64, Vector{Int64}}, ::Type{Int64}, ::Tuple{Base.OneTo{Int64}}) is ambiguous. Candidates: ..............

reduce seems to work which slightly surprised me given the above reduce(+, CircularArray([1,2,3,4])) 10

Vexatos commented 3 years ago

Looks like there is another ambiguity with Base to resolve.

BASS10 commented 3 years ago

Wow, that was quick!

Thanks for this handy package and the support.

All the best.