Feature protocols for metadata, configuration and validation.

Metadata

alter-meta!

Available since version 1.0 (view source)

Usage:
  • (alter-meta! x f & args)

Type signature:
  • (IMutableMeta ⨯ AnyFn ⨯ (Va Any)) → Any

Changes metadata with (apply f meta args). Returns new metadata. Mutates x.

See also: reset-meta!, meta-ref, meta

assoc-meta

Available since version 1.0 (alias of clojure.core/with-meta)

Usage:
  • (assoc-meta x m)

Type signature:
  • (IPersistentMeta ⨯ KeywordMap) → IPersistentMeta

Returns x with m associated as object’s metadata.

See also: update-meta, meta

meta

Available since version 1.0 (alias of clojure.core/meta)

Usage:
  • (meta x)

Type signature:
  • (Any) → KeywordMap

Returns the metadata map attached to object x, returns nil if there is no metadata.

See also: meta-red, assoc-meta

meta-ref

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (meta-ref x)

Type signature:
  • (IMutableMeta) → (I IMutable IReference)

Returns mutable reference to object’s metadata.

reset-meta!

Available since version 1.0 (view source)

Usage:
  • (reset-meta! x m)

Type signature:
  • (IMutableMeta ⨯ KeywordMap) → Any

Resets metadata to m. Returns new metadata. Mutates x.

See also: alter-meta!, meta-ref, meta

update-meta

Available since version 1.0 (view source)

Usage:
  • (update-meta x f & args)

Type signature:
  • (IPersistentMeta ⨯ AnyFn ⨯ (Va Any)) → IPersistentMeta

Returns an object of the same type and value as x, with (apply f (meta x) args) as its metadata.

See also: assoc-meta, meta

Configuration

alter-config!

Available since version 1.0 (view source)

Usage:
  • (alter-config! x f & args)

Type signature:
  • (IMutableConfig ⨯ AnyFn ⨯ (Va Any)) → Any

Changes configuration with (apply f config args). Returns new configuration. Mutates x.

assoc-config

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (assoc-config x conf)

Type signature:
  • (IPersistentConfig ⨯ KeywordMap) → IPersistentConfig

Returns an object of the same type and value as x, with conf as its configuration.

See also: update-config, config

config

Available since version 1.0 (view source)

Usage:
  • (config x)

Type signature:
  • (Any) → KeywordMap

Returns configuration map for a given object, or nil if no configuration is attached to the object. Falls back to (:config x) if x does not satisfy IConfig protocol.

config-ref

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (config-ref x)

Type signature:
  • (IMutableConfig) → (I IMutable IReference)

Returns mutable reference to object’s configuration.

Returned reference also usually implements IAdjustable protocol.

reset-config!

Available since version 1.0 (view source)

Usage:
  • (reset-config! x conf)

Type signature:
  • (IMutableConfig ⨯ KeywordMap) → Any

Resets configuration to conf. Returns new configuration. Mutates x.

update-config

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (update-config x f & args)

Type signature:
  • (IPersistentConfig ⨯ AnyFn ⨯ (Va Any)) → IPersistentConfig

Returns an object of the same type and value as x, with (apply f (config x) args) as its configuration.

See also: assoc-config, config

Other

In this section: validable? validator

validable?

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (validable? x)

Type signature: Predicate

Returns true if object x satisfies IValidator protocol, false otherwise.

See also: IValidator, validator

validator

Available since version 1.0 (view source)

Usage:
  • (validator x)

Type signature:
  • (IValidator) → (I IMutable IReference)

Returns mutable reference to the current validator fn attached to x. Referenced value is nil if no validator is set.

See also: validable?