Brevity is a library that enables Feature-Oriented Programming (FOP) and solves the expression problem in a manner that makes data and operation declarations trivial to define and compose.
print and eval would be the declarations in scope and not associated with the appropriate subtype that can be declared elsewhere. If Exp was extended to MulExp with its own evaluate and print, they would not be called.
Traits need to be more late-bound than they are currently. The best way to accomplish this is to treat them as methods:
This breaking change requires a significant change in the implementation. A full Object-Algebra approach is needed, but that doesn't mean the overhead of the typical approach is required. I see no need for Trait to be defined as a factory of records.
The current approach with traits is unacceptable when it comes to interacting features:
print
andeval
would be the declarations in scope and not associated with the appropriate subtype that can be declared elsewhere. IfExp
was extended to MulExp with its ownevaluate
andprint
, they would not be called.Traits need to be more late-bound than they are currently. The best way to accomplish this is to treat them as methods:
This breaking change requires a significant change in the implementation. A full Object-Algebra approach is needed, but that doesn't mean the overhead of the typical approach is required. I see no need for Trait to be defined as a factory of records.
Here is how I envision the new approach:
Data
Data
->data
Nothing new here
Trait
Trait
->trait
Nothing new here
memoFix
With the new approach to traits,
memoFix
won't work as-is. This could become a symbol option instead:Complect
By treating traits as methods instead of functions, it's necessary to have a merging concept to combine the data and trait declarations.
This will be handled by the complect function
This approach provides the added benefit of reducing the import/export overhead down to the complected object