Pure dir-set arithmetic for the tracked source roots.
Every function here takes dirs already in ONE spelling (the boundary in hive-hot.core canonicalizes them) and answers data; nothing touches the file system or clj-reload.
Claims: {dir #{owner ...}} records which owners (an addon id, or
anonymous for a caller that names none) asked for a dir through
extend-init!. A dir stays tracked while ANY owner other than the releasing
one still claims it.
Pure dir-set arithmetic for the tracked source roots.
Every function here takes dirs already in ONE spelling (the boundary in
hive-hot.core canonicalizes them) and answers data; nothing touches the file
system or clj-reload.
Claims: {dir #{owner ...}} records which owners (an addon id, or
`anonymous` for a caller that names none) asked for a dir through
extend-init!. A dir stays tracked while ANY owner other than the releasing
one still claims it.The owner a caller that names none claims and releases under.
The owner a caller that names none claims and releases under.
(claim claims owner dirs)CLAIMS with OWNER claiming every dir in DIRS.
CLAIMS with OWNER claiming every dir in DIRS.
(owner-of owner)The claim key for a caller-supplied OWNER (nil -> anonymous).
The claim key for a caller-supplied OWNER (nil -> `anonymous`).
(plan-addition current requested)The dirs REQUESTED adds to CURRENT, in the caller's spelling.
CURRENT [dir ...] the tracked dirs, canonical REQUESTED [[canonical spelled] ...] in request order
A root already tracked, or requested twice, is not added again (first spelling wins); request order is kept. Idempotent: planning REQUESTED against CURRENT plus the answer's canonicals adds nothing.
The dirs REQUESTED adds to CURRENT, in the caller's spelling. CURRENT [dir ...] the tracked dirs, canonical REQUESTED [[canonical spelled] ...] in request order A root already tracked, or requested twice, is not added again (first spelling wins); request order is kept. Idempotent: planning REQUESTED against CURRENT plus the answer's canonicals adds nothing.
(plan-removal current requested core)(plan-removal current requested core claims owner)What OWNER releasing REQUESTED from CURRENT does, when CORE may never be removed and CLAIMS records who else still holds a dir.
CURRENT [dir ...] the tracked dirs, in order
REQUESTED [dir ...] the dirs a caller wants released
CORE #{dir ...} the dirs the initial init declared
CLAIMS {dir #{owner ...}} (5-arity; see ns doc)
OWNER the releasing owner, nil for anonymous (5-arity)
Returns {:dirs [dir ...] CURRENT without :removed, order kept :removed [dir ...] requested, tracked, not core, no other owner left :kept [dir ...] requested and tracked, but core or still claimed :absent [dir ...] requested but not tracked: nothing to do :shared {dir [owner ...]} for each kept dir another owner still claims :claims {dir #{owner ...}} CLAIMS after OWNER's release}
The 3-arity (no claims) answers only :dirs :removed :kept :absent.
Every requested dir lands in exactly one of :removed :kept :absent, once, in request order. Idempotent: planning the same request against the answer's :dirs and :claims removes nothing.
What OWNER releasing REQUESTED from CURRENT does, when CORE may never be
removed and CLAIMS records who else still holds a dir.
CURRENT [dir ...] the tracked dirs, in order
REQUESTED [dir ...] the dirs a caller wants released
CORE #{dir ...} the dirs the initial init declared
CLAIMS {dir #{owner ...}} (5-arity; see ns doc)
OWNER the releasing owner, nil for `anonymous` (5-arity)
Returns
{:dirs [dir ...] CURRENT without :removed, order kept
:removed [dir ...] requested, tracked, not core, no other owner left
:kept [dir ...] requested and tracked, but core or still claimed
:absent [dir ...] requested but not tracked: nothing to do
:shared {dir [owner ...]} for each kept dir another owner still claims
:claims {dir #{owner ...}} CLAIMS after OWNER's release}
The 3-arity (no claims) answers only :dirs :removed :kept :absent.
Every requested dir lands in exactly one of :removed :kept :absent, once, in
request order. Idempotent: planning the same request against the answer's
:dirs and :claims removes nothing.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |