-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Description
All traits which semantically define whether or not a method is expected, e.g. HasShape, HasLength, HasEltype, could be refactored into a single function:
expect_method(::typeof(size), ...)
expect_method(::typeof(length), ...)
expect_method(::typeof(eltype), ...)
which need only take two typed values: True and False. This could unify many existing trait interfaces, and allow them to be more easily combined. In addition, I propose
expect_method(::typeof(getindex), ::Type{Container}, ::Type{Vararg{Int, Dimensions}})
expect_method(::typeof(setindex!), ::Type{Container}, ::Type{Element}, ::Type{Vararg{Int, Dimensions}})
etc. for any method that is required by an Abstract interface.
Metadata
Metadata
Assignees
Labels
No labels