Mixins
A Mixin is a named bundle of properties (and relations) that any Type can mix in, regardless of where it sits in the inheritance tree. Mixins answer: what shared structure does this Type carry, even though it isn’t a subtype of anything related?
Example: Taskable
Section titled “Example: Taskable”Lar’s built-in Taskable mixin adds done, due, and recurrence to a Type. The built-in Task Type uses it — but so could a Project or a Bill, none of which should inherit from each other just to get due dates.
Type: Task mixes: [Taskable]Type: Project mixes: [Taskable] extends: CreativeWorkType: Bill mixes: [Taskable] extends: ExpenseEach mixed-in Type still has exactly one parent in the inheritance tree — mixins never touch the IS-A axis.
Collision handling
Section titled “Collision handling”If a Type already declares a property with the same name as one in a Mixin it’s mixing in, Lar rejects the mixin at Type-definition write time unless you explicitly mark the Type’s own property as override. Silent shadowing is not allowed — a collision has to be a deliberate decision, not something you discover later in a query that returns the wrong field.
Queryable like anything else
Section titled “Queryable like anything else”Mixins work throughout Lar, including in TQL queries such as mixin:Taskable due:<today.
Next: Relations & tags — ways to connect and organize Objects.