In mathematics, a
binary relation on a set X
is just a set of 2-tuples
X × X
.
Let us define a Leonine relation to be a set of tuples N × N, where N is the set of all Leo nodes. Informally, a Leonine relation R(n) gives, for any particular Leo node n, the (list of) all Leo nodes associated with node n.
Aha 1: Within Leo, we can represent a Leonine relation in two ways:
- explicitly: as an organizer node containing any number of clones.
- implicitly: as a Leonine script.
Aha 2: c.cloneFindByPredicate forms the basis of all possible Leonine relations.
Indeed, c.cloneFindByPredicate(predicate) produces an organizer node containing clones of nodes that match the predicate, which is just the explicit form of a relation.
Why does this matter?
A frequently-requested feature: associate one or more nodes with other nodes. Examples:
- Associate a function with its unit tests.
- Associate a function with its documentation nodes.
- Associate an issue with nodes related to it.
Leonistas can create such associations in two ways:
1. Explicitly, laboriously: Manually create "permanent" organizer nodes containing a node (the first child) and its "related" nodes (the cloned children of the organizer node).
2. Automagically: Use an @command script based on c.cloneFindByPredicate.
The
predicate (@command script) can be anything we like! The predicate can
match:
- patterns in headlines or body text,
- relations between nodes,
- uAs or tags,
- anything else!
Aha 3: Leonine relations can express the meaning of programs, functions, data, or anything else.
Proof: Everything in mathematics is a relation, so if something has mathematical meaning, that meaning must be equivalent to a Leonine relation.
A detail: meaning is not necessarily limited to relationships between nodes, but neither are predicates, so the proof appears sound.
Edward