Miscellaneous functions¶
Uncategorized
This page references all other functions that don't fit in the previous categories. Over time, they might be moved to a different or new category.
->¶
Groups multiple shards together (as if they were a single shard). Also called shard-container.
This is useful for cases where you need multiple shards (to transform your data) but is allowed to have only one: for example, as the return value of a function (see function print-messages
below).
1 2 3 4 5 |
|
[info] [2022-07-06 14:14:43.056] [T-2168] [logging.cpp::98] [main] Hello World!
[info] [2022-07-06 14:14:43.058] [T-2168] [logging.cpp::98] [main] Hello Universe!
apply¶
(apply f args) (apply f x args) (apply f x y args) (apply f x y z args)(apply f a b c d & args)
Applies fn f to the argument list formed by prepending intervening arguments to args.
1 2 3 4 5 6 7 8 9 10 11 |
|
atom¶
(atom x)
Creates and returns an Atom with an initial value of x and zero or more options (in any order). An Atom is a data type in Clojure that provides a way to manage shared, synchronous, independent state. An atom is just like any reference type in any other programming language.
1 2 3 4 5 6 |
|
deref¶
(deref ref)
Returns the most current state of the atom.
1 2 |
|
fn?¶
(fn? f)
Return true if f is a function.
1 2 |
|
hex¶
(hex number)
Returns a hexadecimal representation for an input number.
1 2 |
|
keyword¶
(keyword s)
Returns a keyword with a given s string. Do not use :
in the keyword strings, it will be added automatically.
1 2 |
|
macro?¶
(macro? value)
Checks if a value is a macro.
1 2 |
|
meta¶
1 |
|
read-string¶
(read-string s)
Reads one object from the string s.
1 2 3 |
|
readline¶
(readline prompt)
Reads a line from stdin and returns it. Accepts prompt string.
1 |
|
reset!¶
(reset! atom newval)
Sets the value of the atom to newval without regard for the current value. Returns newval.
1 |
|
run¶
Executes all the wires that have been scheduled on a given mesh
.
(run <params>)
takes two arguments: name of the mesh, and mesh iteration interval (no. of seconds between two mesh iterations).
An optional 3rd argument defines the maximum mesh iterations to run. This argument is a debug parameter - do not use it for production.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
[info] [2022-03-07 21:42:12.324] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
[info] [2022-03-07 21:42:12.325] [T-18096] [logging.cpp::94] [wire-bye] Goodbye World
[info] [2022-03-07 21:42:12.351] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
[info] [2022-03-07 21:42:12.367] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
[info] [2022-03-07 21:42:12.397] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
[info] [2022-03-07 21:42:12.413] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
schedule¶
Queues a wire for execution on a given mesh.
Multiple wires can be scheduled on the same mesh
. When a mesh is run, all the wires on it are executed.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
[info] [2022-03-07 21:42:12.324] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
[info] [2022-03-07 21:42:12.325] [T-18096] [logging.cpp::94] [wire-bye] Goodbye World
[info] [2022-03-07 21:42:12.351] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
[info] [2022-03-07 21:42:12.367] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
[info] [2022-03-07 21:42:12.397] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
[info] [2022-03-07 21:42:12.413] [T-18096] [logging.cpp::94] [wire-hi] Hello World!
swap!¶
(swap! atom f) (swap! atom f x) (swap! atom f x y) (swap! atom f x y & args)
Atomically swaps the value of atom to be: (apply f current-value-of-atom args). Returns the value that was swapped in.
1 2 |
|
symbol¶
(symbol name)
Convert string name to a symbol.
1 2 |
|
throw¶
Throws Error using input argument as an error message.
1 2 |
|
time-ms¶
1 |
|
with-meta¶
(with-meta obj m)
Returns an object of the same type and value as obj, with an object as its metadata.
1 |
|