Interface guarantees

Btw, an example of interface testing in a widely-used packages is Accessors.jl/testing.jl at master · JuliaObjects/Accessors.jl · GitHub.
An important thing to note from the example and its implementation is that the sense of “equality” should be customizable in interface definition. Sometimes it makes sense to use ===, ==, sometimes isapprox, and sometimes stuff like Set(x) == Set(y). The precise sense of equality depends on the specific type implementing interface, and shouldn’t be the same for all implementers.

Please correct me if I’m wrong , but it seems to me that people may well mean very different things when they say “interface”. What does “interface” mean in Julia, and what should its semantics be in Julia? Could people agree on it? Do the current “interfaces” in Julia meet those expectations?

May be of interest GitHub - Keno/InterfaceSpecs.jl: Playground for formal specifications of interfaces in Julia

1 Like