io.randomseed.bankster.api.v2.registry
added in 2.2.0
Bankster library, front API version 2 registry helpers.
default
added in 2.2.0
(default)Returns the default registry (honors io.randomseed.bankster.registry/*default*).
default-version
added in 2.2.0
(default-version)Returns a proposed version for a registry based on current date and time.
ext
added in 2.2.0
(ext)(ext registry)(ext k registry)Returns extra data map of a registry. If the registry is not given the dynamic variable io.randomseed.bankster.registry/*default* is tried. If it is not set, current state of a global registry is used instead.
When registry is true, the default registry (global or dynamically bound) is used.
ext*
macro
added in 2.2.0
(ext*)(ext* registry)(ext* k registry)Returns extra data map of a registry. If the registry is not given the dynamic variable io.randomseed.bankster.registry/*default* is tried. If it is not set, current state of a global registry is used instead.
hierarchies
added in 2.2.0
(hierarchies)(hierarchies registry)(hierarchies k registry)Returns hierarchies map of a registry. If the registry is not given the dynamic variable io.randomseed.bankster.registry/*default* is tried. If it is not set, current state of a global registry is used instead.
When registry is true, the default registry (global or dynamically bound) is used.
hierarchies*
macro
added in 2.2.0
(hierarchies*)(hierarchies* registry)(hierarchies* k registry)Returns hierarchies map of a registry. If the registry is not given the dynamic variable io.randomseed.bankster.registry/*default* is tried. If it is not set, current state of a global registry is used instead.
When k is given the macro will extract a specific hierarchy from a record field. it should be a simple keyword. If it is a constant form of a keyword field-access byte code will be generated.
hierarchy
added in 2.2.0
(hierarchy k)(hierarchy k registry)Returns a hierarchy identified by the given key k in a registry. The key should be a keyword. If the registry is not given the dynamic variable io.randomseed.bankster.registry/*default* is tried. If it is not set, current state of a global registry is used instead.
For static keywords it is advised to use hierarchy* macro whenever possible as it compiles to a field-access byte code.
When registry is true, the default registry (global or dynamically bound) is used.
hierarchy*
macro
added in 2.2.0
(hierarchy* k)(hierarchy* k registry)Returns a hierarchy identified by the given key k in a registry. If the registry is not given the dynamic variable io.randomseed.bankster.registry/*default* is tried. If it is not set, current state of a global registry is used instead.
When k is given it should be a simple keyword. If it is a constant form of a keyword field-access byte code will be generated.
hierarchy-derive
added in 2.2.0
(hierarchy-derive hierarchy-name tag parent registry)Alias for io.randomseed.bankster.registry/hierarchy-derive.
Returns registry updated by deriving tag from parent inside a hierarchy identified by hierarchy-name.
When registry is true, the default registry (global or dynamically bound) is used.
hierarchy-derive!
added in 2.2.0
(hierarchy-derive! hierarchy-name tag parent)Updates global registry by deriving tag from parent inside a hierarchy identified by hierarchy-name.
new
added in 2.2.0
(new)(new cur-id->cur ctr-id->cur cur-id->localized cur-id->traits cur-id->weight cur-hierarchies version)(new cur-id->cur ctr-id->cur cur-id->localized cur-id->traits cur-id->weight cur-hierarchies)(new cur-id->cur ctr-id->cur cur-id->localized cur-id->traits cur-id->weight)(new m)Creates a new registry.
Accepts base maps and builds derived index maps during initialization. Even the arity that accepts a Registry map/record ignores any derived index fields (they are recomputed during initialization).
or-default
added in 2.2.0
(or-default registry)Resolves true or nil into the current default registry, otherwise returns the given value.
When registry is true, the default registry (global or dynamically bound) is used.
set!
added in 2.2.0
(set! registry)Sets current state of a global registry.
When registry is true, the default registry (global or dynamically bound) is used.
update
added in 2.2.0
(update r fun & more)Updates a registry with a function that should take a registry as its first argument and return the updated one. It is a simple apply-based implementation provided for the sake of symmetry with update! which operates on a global registry object.
update!
added in 2.2.0
(update! fun & more)Updates a global registry using a function that should take a registry and return the updated version of it.
version
added in 2.2.0
(version)(version registry)Returns a version string of a registry. If the registry is not given the dynamic variable io.randomseed.bankster.registry/*default* is tried. If it is not set, current state of a global registry is used instead.
When registry is true, the default registry (global or dynamically bound) is used.
version*
macro
added in 2.2.0
(version*)(version* registry)Returns a version string of a registry. If the registry is not given the dynamic variable io.randomseed.bankster.registry/*default* is tried. If it is not set, current state of a global registry is used instead.
with
macro
added in 2.2.0
(with registry & body)Sets a registry in a lexical context of the body to be used instead of a global one in functions which require the registry and it was not passed as an argument.