You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where exhaustion is checked at macro expansion time..
However the subclass-responsiblity is not really enforced. We can have an open extension to <substmorph>. For which we don't care about implementing all the interfaces, but some core subset of features. Like we may care about visualizing a particular extension, but we don't support some feature like metadata
With this, we can define out an interface, saying we implement some set of methods. A class implements the interface if it properly fulfills the interface either by implementing it itself or relying on the superclass to do the work.
The pledge function is not strictly needed, as these interfaces can be put in the inheritance list of the class at class creation time, and we can compute later based on the subclass who has pledge to implement what interfaces.
If a class subclasses another one, we can check if the interface is fulfilled, if the interface covers it's subclasses, or is pledged to have it filled by the superclass, then we can remove it from the checked list.
This culminates in the missing-inteface/missing-methods api which tells us how many we are missing.
If we are missing a pledged system, we will get an error instead of a warning for the methods we've pledged.
This should make it easy to see what methods are not exhaustive in the open extension case.
CL is a multiple dispatch system, so we will only check a single specifier works as intended. If more are needed, then an extension to this system should be had
Implementing
The implementation work of this should be somewhat easy. Thanks to the MOP, we can do things like
no, I don't see how we have the API filled in here at all. This issue proposes a generic system for interfaces in CL and catching when methods are missing
Problem
Currently we have a fairly good exhaustion system for geb
where exhaustion is checked at macro expansion time..
However the
subclass-responsiblity
is not really enforced. We can have an open extension to<substmorph>
. For which we don't care about implementing all the interfaces, but some core subset of features. Like we may care aboutvisualizing
a particular extension, but we don't support some feature likemetadata
Thus I propose the following
Proposal
We should implement the following interface
With this, we can define out an interface, saying we implement some set of methods. A class implements the interface if it properly fulfills the interface either by implementing it itself or relying on the superclass to do the work.
The
pledge
function is not strictly needed, as these interfaces can be put in theinheritance
list of the class at class creation time, and we can compute later based on the subclass who has pledge to implement what interfaces.If a class subclasses another one, we can check if the interface is fulfilled, if the interface covers it's subclasses, or is pledged to have it filled by the superclass, then we can remove it from the checked list.
This culminates in the
missing-inteface
/missing-methods
api which tells us how many we are missing.If we are missing a pledged system, we will get an error instead of a warning for the methods we've pledged.
This should make it easy to see what methods are not exhaustive in the open extension case.
CL is a multiple dispatch system, so we will only check a single specifier works as intended. If more are needed, then an extension to this system should be had
Implementing
The implementation work of this should be somewhat easy. Thanks to the MOP, we can do things like
These methods should allow us to determine the applicability of methods.
Further we may be able to remove
subclasses
or rather we should be able to build some of this implicitly.Further we should make these mixins and likely stealth-mixins if we declare it later.
The text was updated successfully, but these errors were encountered: