Skip to main content


This is a set of examples for various operators. If you want to see their documentation, checkout the Operators page.



Compiles an entire program into a single executable expression. You can define other constants within it.

(mod (value)

;; Doubles the value as the output.
(* value 2)


Includes all of the constants defined in a library file in the module.

cdv clsp retrieve sha256tree
(mod (thing-to-hash)

;; Includes the constants defined in the file.
(include sha256tree.clib)

;; Calls the utility function as the output.
(sha256tree thing-to-hash)


Defines a function that can be called from anywhere within the module.

(mod ()
(defun square (number)
;; Returns the number squared.
(* number number)

(square 16) ; 256


Defines an inline function that can be called from anywhere within the module. It simply replaces the call with the code within (like an easier to write but limited macro).

(mod ()
(defun-inline double (number)
;; Returns twice the number.
(* number 2)

(double 9) ; 18


Compiles a block of code into a single executable expression. Useful for writing functions as arguments to other functions.

(lambda (n1 n2)
;; Returns the two added together.
(+ n1 n2)

defmacro, qq, unquote

Defines a macro that can manually structure the source code it is replaced with. Allows for advanced compile time behavior.

 (defmacro or ARGS
(if ARGS
(qq (if (unquote (f ARGS))
(unquote (c or (r ARGS)))


Defines a constant value that can be referenced by name.

(mod ()
(defconstant MAGIC_NUMBER 314159)

MAGIC_NUMBER ; Replaced with the actual value.