($ varname-or-map suffix)Constructs a variable name from varname-or-map and suffix.
When varname-or-map is a map, uses its ::q/var-name-prefix as the base.
Equivalent to (mk-qvar varname-or-map suffix).
Constructs a variable name from `varname-or-map` and `suffix`. When `varname-or-map` is a map, uses its `::q/var-name-prefix` as the base. Equivalent to `(mk-qvar varname-or-map suffix)`.
($# varname-or-map suffix)Like $, but produces a TEMP.-prefixed variable name that is stripped from solver results.
Use for intermediate variables that should not appear in the final solution map.
Like `$`, but produces a `TEMP.`-prefixed variable name that is stripped from solver results. Use for intermediate variables that should not appear in the final solution map.
(dqsl-process-body env? body)Walks the body forms of a qdsl macro call. Maps become domain entries; vectors become
equation entries. Variable names are resolved: $-prefixed symbols are expanded via
mk-qvar; other symbols are kept as eval-time expressions if resolvable or in env?.
Walks the `body` forms of a `qdsl` macro call. Maps become domain entries; vectors become equation entries. Variable names are resolved: `$`-prefixed symbols are expanded via `mk-qvar`; other symbols are kept as eval-time expressions if resolvable or in `env?`.
(flatten-to-polynomial expr)Flatten or convert a s-expression (or additions and multiplications) to a vector-based polynomial. Example Usage: (flatten-to-polynomial '(* (+ a b) (+ a b))) => [[1 "a" "a"] [2 "a" "b"] [1 "b" "b"]]
Flatten or convert a s-expression (or additions and multiplications) to a vector-based polynomial. Example Usage: (flatten-to-polynomial '(* (+ a b) (+ a b))) => [[1 "a" "a"] [2 "a" "b"] [1 "b" "b"]]
(min-max-domain domain-spec)Returns [min max] for a domain spec. Handles :boolean → [0 1],
[:range lo hi] → [lo hi], and enumerated value vectors → [min max].
Returns `[min max]` for a domain spec. Handles `:boolean` → `[0 1]`, `[:range lo hi]` → `[lo hi]`, and enumerated value vectors → `[min max]`.
(mk-qvar o suffix)(mk-qvar o suffix temp?)Constructs a fully-qualified variable name string from o (a string prefix or a map
with ::q/var-name-prefix) and a suffix. Pass :temp as the third arg to produce a
TEMP.-prefixed name, which the solver strips from results.
Constructs a fully-qualified variable name string from `o` (a string prefix or a map with `::q/var-name-prefix`) and a `suffix`. Pass `:temp` as the third arg to produce a `TEMP.`-prefixed name, which the solver strips from results.
(parse-var-name s)Parses a DSL variable name string, returning a map of:
:full-name, :varname (last segment), and optionally
:dollar? (prefixed with $), :dollar-hash? (prefixed with $#),
:prefix0 (first dot-segment), :suffix (remaining dot-segments joined).
Returns nil if s is nil or does not match the expected pattern.
Parses a DSL variable name string, returning a map of: `:full-name`, `:varname` (last segment), and optionally `:dollar?` (prefixed with `$`), `:dollar-hash?` (prefixed with `$#`), `:prefix0` (first dot-segment), `:suffix` (remaining dot-segments joined). Returns nil if `s` is nil or does not match the expected pattern.
(qdsl-internal {:keys [tap-entries initial-context] :as options} entries)Transforms a sequence of DSL entries (domain maps + equation vectors) into a single
collated {:domain … :equations …} map, expanding arithmetic s-expressions into the
internal polynomial term format. Called by the qdsl macro after macro-expansion.
Transforms a sequence of DSL entries (domain maps + equation vectors) into a single
collated `{:domain … :equations …}` map, expanding arithmetic s-expressions into the
internal polynomial term format. Called by the `qdsl` macro after macro-expansion.(read-all-edn-objects-from-file path)Reads all EDN objects from the classpath resource at path, returning them as a vector.
Reads all EDN objects from the classpath resource at `path`, returning them as a vector.
(remove-coeffcient-of-one polynomial)Removes a leading coefficient of 1 from polynomial terms where there is at least one
variable (e.g. [1 "x"] → ["x"]). Constant-only terms like [5] are left unchanged.
Removes a leading coefficient of 1 from polynomial terms where there is at least one variable (e.g. `[1 "x"]` → `["x"]`). Constant-only terms like `[5]` are left unchanged.
(temp-int-var {:keys [domain] :as context} v1 v2 txt)Returns a single-entry domain map {varname [:range t-min t-max]} for a new TEMP variable
whose range spans all possible products of the domains of v1 and v2 in context.
Returns a single-entry domain map `{varname [:range t-min t-max]}` for a new TEMP variable
whose range spans all possible products of the domains of `v1` and `v2` in `context`.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 |