(extract x)Recursively traverses the given data structure x and collects all unique
reference keywords (e.g., :ref/variable or :ref?/variable).
Returns a set containing all the encountered reference keywords intact, preserving their original namespaces so they can be classified later.
Example: (extract {:path [:room :ref/id] :request {:name :ref?/name}}) ;; => #{:ref/id :ref?/name}
Recursively traverses the given data structure `x` and collects all unique
reference keywords (e.g., :ref/variable or :ref?/variable).
Returns a set containing all the encountered reference keywords intact,
preserving their original namespaces so they can be classified later.
Example:
(extract {:path [:room :ref/id] :request {:name :ref?/name}})
;; => #{:ref/id :ref?/name}(get-ref ref-bindings ref)(optional-reference? x)Returns true if x is a keyword with the namespace 'ref?' (e.g., :ref/patientId). Otherwise, returns false.
Returns true if x is a keyword with the namespace 'ref?' (e.g., :ref/patientId). Otherwise, returns false.
(partial-resolve ref-bindings x)(reference? x)(referent ref)Returns the underlying target keyword (the referent) of a given reference by stripping away its 'ref' or 'ref?' namespace.
Example: (referent :ref/patientId) ;; => :patientId (referent :ref?/patientId) ;; => :patientId (referent :plain-keyword) ;; => nil
Returns the underlying target keyword (the referent) of a given reference by stripping away its 'ref' or 'ref?' namespace. Example: (referent :ref/patientId) ;; => :patientId (referent :ref?/patientId) ;; => :patientId (referent :plain-keyword) ;; => nil
(required-reference? x)Returns true if x is a keyword with the namespace 'ref' (e.g., :ref/patientId). Otherwise, returns false.
Returns true if x is a keyword with the namespace 'ref' (e.g., :ref/patientId). Otherwise, returns false.
(resolve ref-bindings x)Recursively traverses the given form (maps, vectors, lists, etc.)
and replaces any placeholder keyword matching the format :ref/variable-name
with its corresponding runtime value extracted from ref-bindings.
Arguments:
ref-bindings: A map containing runtime dynamic data (e.g., {:patientId "123"}).form: Any Clojure data structure or template that contains :ref/... keywords.Returns: The deeply transformed data structure with all references resolved.
Throws:
clojure.lang.ExceptionInfo if a required :ref/... keyword found in the form
cannot be resolved within the provided ref-bindings map. The exception
includes the full original context for deep production debugging.
Recursively traverses the given `form` (maps, vectors, lists, etc.)
and replaces any placeholder keyword matching the format :ref/variable-name
with its corresponding runtime value extracted from `ref-bindings`.
Arguments:
- `ref-bindings`: A map containing runtime dynamic data (e.g., {:patientId "123"}).
- `form`: Any Clojure data structure or template that contains :ref/... keywords.
Returns:
The deeply transformed data structure with all references resolved.
Throws:
clojure.lang.ExceptionInfo if a required :ref/... keyword found in the form
cannot be resolved within the provided `ref-bindings` map. The exception
includes the full original context for deep production debugging.(validate-ref-bindings ref-bindings)Returns true when ref-bindings is a Clojure map, else throws :invalid/type error
Returns true when ref-bindings is a Clojure map, else throws :invalid/type error
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 |