metam.core

boolean?

(boolean? x)
Predicate to check if a value is either true or false.

coll

(coll pred)(coll key-pred val-pred)
The single arity version returns a predicate that checks
if all x in xs comply to the predicate.
The 2-arity version returns a predicate that checks if all
keys and all values comply to key-pred and val-pred, respectively.

defdefaults

macro

(defdefaults sym metamodel default-mappings)
Creates a multimethod for the metamodel that provides defaults from
the given map.

defmetamodel

macro

(defmetamodel sym hierarchy typemap)(defmetamodel sym hierarchy typemap default-fn-var)
Defines several vars in the current namespace:
- The sym-hierarchy var contains the type hierarchy.
- The sym-metamodel var contains a map with keys/values :hierarchy and :types.
- For each type a factory function that creates and checks a model element for that type.

docstring

(docstring type-key attrmap)
Returns the docstring for a model element factory function.
Needs to be public to be available to code genererated by macro.

inherited-attributes

(inherited-attributes {:keys [hierarchy types], :as meta-model} type-keyword)
Merges attribute maps to implement field inheritance for the type
specified by `type-keyword`.
Needs to be public to be available to code genererated by macro.

instance-factory

(instance-factory {:keys [hierarchy types default-fn-var], :as meta-model} type-keyword attrmap)
Returns a factory function that is used to create model elements of the
type described by type-keyword and attrmap.
Needs to be public to be available to code genererated by macro.

metatype

(metatype me)
Returns the type-keyword of the model-element me.

metatype?

(metatype? type-keyword me)
Returns true if me is of the meta-type specified by type-keyword.

no-defaults

pr-model

(pr-model me)
Returns a readable representation of the model element as Clojure data.

required

type-of

(type-of type-keyword)
Returns a predicate that checks if x is of the metatype specified
by type-keyword.

value-of

(value-of & values)
Returns a predicate that checks if a given value is contained in
the set of keys.