Liking cljdoc? Tell your friends :D

sicmutils.expression


abstract-typesclj/s

These keywords reference 'abstract' types that stand in for some concrete data type in the system.

These keywords reference 'abstract' types that stand in for some
concrete data type in the system.
raw docstring

abstract?clj/s

(abstract? x)

Returns true if x is both a Literal and has a type specified in abstract-types, false otherwise.

Returns true if `x` is both a [[Literal]] and has a type specified
in [[abstract-types]], false otherwise.
raw docstring

compareclj/s

(compare l r)

Compare expressions. The rule is that types have the following ordering:

  • empty sequence is < anything (except another empty seq)
  • real < symbol < string < sequence
  • sequences compare element-by-element

Any types NOT in this list compare with the other type using hashes.

Compare expressions. The rule is that types have the following ordering:

- empty sequence is < anything (except another empty seq)
- real < symbol < string < sequence
- sequences compare element-by-element

Any types NOT in this list compare with the other type using hashes.
raw docstring

evaluateclj/s

(evaluate expr sym->var sym->f)

Walk the unwrapped expression x in postorder, replacing symbols found there with their values in the map environment, if present; the functions association is used for elements in function application position (first of a sequence).

Walk the unwrapped expression x in postorder, replacing symbols found there
with their values in the map environment, if present; the functions
association is used for elements in function application position (first of a
sequence).
raw docstring

expression-ofclj/s

(expression-of expr)

If the supplied argument is a Literal (or a symbol, interpreted elsewhere as a numerical literal expression), returns the wrapped expression (or the symbol).

Throws otherwise.

If the supplied argument is a [[Literal]] (or a symbol, interpreted elsewhere
as a numerical literal expression), returns the wrapped expression (or the
symbol).

Throws otherwise.
raw docstring

fmapclj/s

(fmap f e)

Applies f to the expression part of e and creates from that a Literal otherwise like e.

Applies f to the expression part of e and creates from that a Literal
otherwise like e.
raw docstring

Literalcljs


literal-applyclj/s

(literal-apply type op args)

Similar to make-literal, but accepts:

  • some operation
  • the arguments to which it applies

Similar to [[clojure.core/apply]].

For example:

(literal-apply ::numeric 'cos [1 2 3]) ;;=> (cos 1 2 3)

Similar to [[make-literal]], but accepts:

- some operation
- the arguments to which it applies

Similar to [[clojure.core/apply]].

For example:

(literal-apply ::numeric 'cos [1 2 3])
;;=> (cos 1 2 3)
raw docstring

literal-typeclj/s

(literal-type x)

If x is a Literal instance, returns its type. Else, returns nil.

If `x` is a [[Literal]] instance, returns its type. Else, returns nil.
raw docstring

literal?clj/s

(literal? x)

Returns true if x is a Literal instance, false otherwise.

Returns true if `x` is a [[Literal]] instance, false otherwise.
raw docstring

make-literalclj/s

(make-literal type expr)

Constructs a Literal instance with the supplied type and an empty metadata map out of the literal form expr.

Constructs a [[Literal]] instance with the supplied type and an empty metadata
map out of the literal form `expr`.
raw docstring

substituteclj/s

(substitute expr s-map)
(substitute expr old new)

Performs substitutions from the map.

Performs substitutions from the map.
raw docstring

variables-inclj/s

(variables-in expr)

Return the set of 'variables' (e.g. symbols) found in expr. expr is either a symbol, a Literal instance or some sequence representing a symbolic expression.

Return the set of 'variables' (e.g. symbols) found in `expr`. `expr` is either
a symbol, a [[Literal]] instance or some sequence representing a symbolic
expression.
raw docstring

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

× close