Liking cljdoc? Tell your friends :D

diesel.core


def-bool-propscljmacro

(def-bool-props & syms)
source

def-entity-macroscljmacro

(def-entity-macros & syms)

Creates an entity-generating macro for each symbol in syms, where symbol refers to a function that takes an entity id as its first argument and any number of arguments for the entity's properties. This includes any function created via def-entity-props and functions created via def-entity-maps with the :id option set.

For example (def-entity-macros widget) creates a macro like

(defmacro defwidget [id & body] `(def ~id (widget ~(name id) ~@body)))

Creates an entity-generating macro for each symbol in syms,
where symbol refers to a function that takes an entity id as its
first argument and any number of arguments for the entity's properties.
This includes any function created via def-entity-props and functions
created via def-entity-maps with the :id option set.

For example (def-entity-macros widget) creates a macro like

(defmacro defwidget [id & body]
  `(def ~id (widget ~(name id) ~@body)))
sourceraw docstring

def-entity-mapscljmacro

(def-entity-maps opt & syms)

Creates functions for creating maps representing an entity. The macro accepts one or more symbols possibly preceded by an options map. See def-entity-props for details

Example: (def-entity-maps {:tag 1 :id :id} person)

(person :fred :age 4 :dob 2001) => {:tag :person :id :fred :age 4 :dob 2001}

Creates functions for creating maps representing an entity.  The macro
accepts one or more symbols possibly preceded by an options map.  See
def-entity-props for details

Example:
  (def-entity-maps {:tag 1 :id :id} person)

  (person :fred :age 4 :dob 2001) =>
    {:tag :person :id :fred :age 4 :dob 2001}
sourceraw docstring

def-entity-propscljmacro

(def-entity-props opt & syms)

Accepts one or more symbols possibly preceded by an options map. For each symbol, creates a function that returns an Entity Property. The first argument to each generated function is the Entity name. All remaining arguments describe the Entity's properties. If the :tag option is truthy, generated maps will have a :tag key whose value matches the function name. If :id is supplied, its value will be used as an ID key in generated maps.

Example: (def-entity-props ent1 ent2) (def-entity-props {:tag true} ent3 ent4) (def-entity-props {:id :name} ent5 ent6) (def-entity-props {:id :id, :tag :truthy} ent7)

(ent1 :fred :age 4 :dob 2001) => {:fred {:age 4 :dob 2001}} (ent3 :fred :age 4 :dob 2001) => {:fred {:age 4 :dob 2001 :tag :ent3}} (ent5 :fred :age 4 :dob 2001) => {:fred {:age 4 :dob 2001 :name :fred}} (ent7 :fred :age 4 :dob 2001) => {:fred {:age 4 :dob 2001 :id :fred :tag :ent7}}

Accepts one or more symbols possibly preceded by an options map. For each
symbol, creates a function that returns an Entity Property. The first
argument to each generated function is the Entity name. All remaining
arguments describe the Entity's properties. If the :tag option is truthy,
generated maps will have a :tag key whose value matches the function name.
If :id is supplied, its value will be used as an ID key in generated maps.

Example:
  (def-entity-props ent1 ent2)
  (def-entity-props {:tag true} ent3 ent4)
  (def-entity-props {:id :name} ent5 ent6)
  (def-entity-props {:id :id, :tag :truthy} ent7)

  (ent1 :fred :age 4 :dob 2001) => {:fred {:age 4 :dob 2001}}
  (ent3 :fred :age 4 :dob 2001) => {:fred {:age 4 :dob 2001 :tag :ent3}}
  (ent5 :fred :age 4 :dob 2001) => {:fred {:age 4 :dob 2001 :name :fred}}
  (ent7 :fred :age 4 :dob 2001) =>
    {:fred {:age 4 :dob 2001 :id :fred :tag :ent7}}
sourceraw docstring

def-loc-propscljmacro

(def-loc-props & syms)
source

def-map-propscljmacro

(def-map-props & syms)
source

def-pct-propscljmacro

(def-pct-props & syms)
source

def-propscljmacro

(def-props & syms)
source

def-unit-propscljmacro

(def-unit-props & syms)
source

def-vec-propscljmacro

(def-vec-props & syms)
source

editclj

(edit m & args)

Edits an existing map, m, using mk-map*. See mk-map* for how the arguments are processed

Edits an existing map, m, using mk-map*. See mk-map* for
how the arguments are processed
sourceraw docstring

mk-bool-propclj

(mk-bool-prop k)
(mk-bool-prop k v)
source

mk-loc-propclj

(mk-loc-prop k lat lon)
source

mk-mapclj

(mk-map & args)

Makes a new map using mk-map*. See mk-map* for how the arguments are processed

Makes a new map using mk-map*. See mk-map* for
how the arguments are processed
sourceraw docstring

mk-map*clj

(mk-map* m args)

Process args recursively to edit an existing map, m. Arguments are processed as follows:

  • If args is empty return the current map.
  • If arg is nil, skip it. This lets you use forms like if and when to conditionally edit a map.
  • If arg is a map, merge it into the current map
  • If arg is a collection, splice it into args and continue. This lets you use for comprehensions and such in calls to mk-map*
  • If arg is a function, apply it to the current map.
  • Otherwise, assume arg forms a key/value pair with the next arg. If the value part is a function, apply it to the current value and assoc the result to the existing key. Else, just assoc the new value to the given key. Both ways consume two arguments. It's an error if value is missing.

See [[diesel.core-test]] for examples.

Process args recursively to edit an existing map, m. Arguments are processed
as follows:

 - If args is empty return the current map.
 - If arg is nil, skip it. This lets you use forms like if and when to
   conditionally edit a map.
 - If arg is a map, merge it into the current map
 - If arg is a collection, splice it into args and continue. This lets you
   use for comprehensions and such in calls to mk-map*
 - If arg is a function, apply it to the current map.
 - Otherwise, assume arg forms a key/value pair with the next arg. If the
   value part is a function, apply it to the current value and assoc the
   result to the existing key. Else, just assoc the new value to the given
   key. Both ways consume two arguments. It's an error if value is missing.

See [[diesel.core-test]] for examples.
sourceraw docstring

mk-map-formclj

(mk-map-form {:keys [id tag]} sym)
source

mk-map-propclj

(mk-map-prop k & body)
source

mk-pct-propclj

(mk-pct-prop k v u)
source

mk-propclj

(mk-prop k v)
source

mk-prop-makerscljmacro

(mk-prop-makers mk-prop-func & syms)
source

mk-unit-propclj

(mk-unit-prop k v u)
source

mk-vec-propclj

(mk-vec-prop k & xs)
source

pct-unitsclj

source

propertyclj

(property id & body)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close