Open tk3369 opened 4 years ago
The idea is to enforce consistency. The benefit is that a user would not accidentally assign and check a type, and then later change the contract. To do this, we will probably have to support a new syntax such that all interfaces are defined altogether in one place e.g.
@implement Can{Drive} by begin
start(_)
turn(_, direction::Float64)
move(_, distance::Float64)
stop(_)
end
Then, either disallow the user from issuing another @implement Can{Drive}
statement again, or else we could automatically check all assigned types against the new contract.
As for the 2nd point, it seems to be just a small convenience over two lines of code (@assign
followed by @check
). I don't think that is needed at the moment.
or maybe do so .. provide a seal_this_interface
command/function/operation/macro which, when utilized, disallows, and until utilized, allows.
See https://discourse.julialang.org/t/ann-binarytraits-jl-a-new-traits-package/37475/5?u=tk3369
In a nutshell, the ideas are: