rafaqz / Interfaces.jl

Macros to define and implement interfaces, to ensure they are checked and correct.
MIT License
72 stars 4 forks source link

Combined interface over multiple test objects #34

Open rafaqz opened 8 months ago

rafaqz commented 8 months ago

Writing the push! options for ArrayInterface its apparent that to prove push! we need multiple test objects, and to accept one of them passing as enough to satisfiy the interface. So a Vector would pass, but a Matrix would not, but Array generally would still pass becuase push! is only expected to work for Vector.

we can use any and all to define how the results of multiple test objects are combined. Like:

push = A -> ndims(A) == 1 ? last(push!(A, first(A))) == A, false => any 

all would be assumed for most cases.