Details
-
Feature Request
-
Resolution: Obsolete
-
Optional
-
None
-
None
-
None
-
Documentation (Ref Guide, User Guide, etc.)
-
Medium
Description
For various reasons, a rule may want to prevent the future "don" of a given trait for a given object.
I propose the use of the "ward" macro, as follows:
Thing t = ward( $core, BannedTrait.class );
If another rule, at a later point, will try to apply the BannedTrait or any of its subtypes to $core, that trait will not be applied to $core and (potentially) an exception will be thrown.
Details:
$core can be a @Traitable object or a Thing (i.e. an instance of a trait proxy). THe "ward" operation automatically applies the "Thing" trait to $core in case it has not been done yet.
Optionally, one might use the "grant" macro to undo a ward (suggestions for a better name are encouraged).
This feature will help in the implementation of "disjunct" or "mutually exclusive" traits, which are incompatible and can't be applied to the same