io.randomseed.bankster.registry

added in 1.0.0

Bankster, registry management.

*default*

dynamic

added in 1.0.0

Registry that, if set to a truthy value (not nil and not false), will be used instead of a global, shared registry.

*warn-on-inconsistency*

dynamic

added in 2.0.0

Dynamic flag which enables warnings when inconsistencies are found in a registry. Default is false.

*warnings-logger*

dynamic

added in 2.0.0

A logging function which should take a message string and an optional map. Used to issue registry warnings. Defaults to clojure.tools.logging/warn.

country-id->currency

added in 2.0.0

(country-id->currency)(country-id->currency registry)(country-id->currency country-id registry)

Returns the country ID to currency map from 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.

country-id->currency*

macro

added in 1.0.0

(country-id->currency*)(country-id->currency* registry)(country-id->currency* country registry)

Returns the country ID to currency map from 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.

currency-code->currencies

added in 2.0.0

(currency-code->currencies)(currency-code->currencies registry)(currency-code->currencies code registry)

Returns the currency short-code to currencies map from 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.

currency-code->currencies*

macro

added in 1.0.0

(currency-code->currencies*)(currency-code->currencies* registry)(currency-code->currencies* code registry)

Returns the currency short-code to currencies map from 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.

currency-domain->currencies

added in 2.1.0

(currency-domain->currencies)(currency-domain->currencies registry)(currency-domain->currencies domain registry)

Returns the currency domain to currencies map from 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.

currency-domain->currencies*

macro

added in 2.1.0

(currency-domain->currencies*)(currency-domain->currencies* registry)(currency-domain->currencies* domain registry)

Returns the currency domain to currencies map from 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.

currency-id->country-ids

added in 2.0.0

(currency-id->country-ids)(currency-id->country-ids registry)(currency-id->country-ids id registry)

Returns the currency ID to country IDs map from 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.

currency-id->country-ids*

macro

added in 1.0.0

(currency-id->country-ids*)(currency-id->country-ids* registry)(currency-id->country-ids* id registry)

Returns the currency ID to country IDs map from 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.

currency-id->currency

added in 2.0.0

(currency-id->currency)(currency-id->currency registry)(currency-id->currency id registry)

Returns the currency ID to currency map from 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.

currency-id->currency*

macro

added in 1.0.0

(currency-id->currency*)(currency-id->currency* registry)(currency-id->currency* id registry)

Returns the currency ID to currency map from 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.

currency-id->localized

added in 2.0.0

(currency-id->localized)(currency-id->localized registry)(currency-id->localized id registry)

Returns the currency ID to localized properties map from 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.

currency-id->localized*

macro

added in 1.0.0

(currency-id->localized*)(currency-id->localized* registry)(currency-id->localized* id registry)

Returns the currency ID to localized properties map from 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.

currency-id->traits

added in 2.0.0

(currency-id->traits)(currency-id->traits registry)(currency-id->traits id registry)

Returns the currency ID to traits map from 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.

currency-id->traits*

macro

added in 2.0.0

(currency-id->traits*)(currency-id->traits* registry)(currency-id->traits* id registry)

Returns the currency ID to traits map from 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.

currency-id->weight

added in 2.0.0

(currency-id->weight)(currency-id->weight registry)(currency-id->weight id registry)

Returns the currency ID to weight map from 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.

currency-id->weight*

macro

added in 2.0.0

(currency-id->weight*)(currency-id->weight* registry)(currency-id->weight* id registry)

Returns the currency ID to weight map from 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.

currency-nr->currencies

added in 2.0.0

(currency-nr->currencies)(currency-nr->currencies registry)(currency-nr->currencies nr registry)

Returns the currency number to currencies map from 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.

currency-nr->currencies*

macro

added in 1.0.0

(currency-nr->currencies*)(currency-nr->currencies* registry)(currency-nr->currencies* nr registry)

Returns the currency number to currencies map from 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.

currency-nr->currency

added in 2.0.0

(currency-nr->currency)(currency-nr->currency registry)(currency-nr->currency nr registry)

Returns the currency number to currency map from 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.

currency-nr->currency*

macro

added in 1.0.0

(currency-nr->currency*)(currency-nr->currency* registry)(currency-nr->currency* nr registry)

Returns the currency number to currency map from 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.

default-version

added in 1.0.0

(default-version)

Returns a proposed version for a registry based on current date and time.

ext

added in 2.0.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.

ext*

macro

added in 2.0.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.

get

macro

added in 1.0.0

(get)(get registry)

Without arguments it gets a current state of a global registry. If the dynamic variable io.randomseed.bankster.registry/*default* is set to a truthy value, it will be used instead.

When a registry argument is provided it will be tried before using a dynamic or a global registry, unless its value is nil or false.

When the literal true is provided, it acts as a sentinel meaning: use the default registry. Caution: this works only on syntactic level.

global

added in 1.0.0

(global)

Returns global registry object.

hierarchies

added in 2.0.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.

hierarchies*

macro

added in 2.0.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.0.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.

hierarchy*

macro

added in 2.0.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.0.0

(hierarchy-derive hierarchy-name tag parent registry)

Returns registry updated by deriving tag from parent inside a hierarchy identified by hierarchy-name.

hierarchy-derive!

added in 2.0.0

(hierarchy-derive! hierarchy-name tag parent)

Updates global registry by deriving tag from parent inside a hierarchy identified by hierarchy-name.

inconsistency-warning

macro

added in 2.0.0

(inconsistency-warning ex-message ex-data & body)

Wrapper that displays an inconsistency warning when io.randomseed.bankster.registry/*warn-on-inconsistency* is truthy. Uses io.randomseed.bankster.registry/*warnings-logger* function and passes message and data to it. Always evaluates body in an implicit do.

new

added in 1.0.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)

Alias for new-registry.

new-registry

added in 1.0.0

(new-registry)(new-registry cur-id->cur ctr-id->cur cur-id->localized cur-id->traits cur-id->weight cur-hierarchies version)(new-registry cur-id->cur ctr-id->cur cur-id->localized cur-id->traits cur-id->weight cur-hierarchies)(new-registry cur-id->cur ctr-id->cur cur-id->localized cur-id->traits cur-id->weight)(new-registry 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).

R

added in 1.0.0

Global registry object based on an Atom.

registry?

added in 1.0.0

(registry? obj)

Returns true if the given object is a registry.

set!

added in 1.0.0

(set! registry)

Sets current state of a global registry.

state

added in 1.0.0

(state)

Returns current state of a global registry.

update

added in 1.0.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 1.0.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.0.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.

version*

macro

added in 2.0.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 1.0.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.