live-cells-cl documentation¶
Live-Cells-CL is a library that adds reactive programming to lisp. The functionality of the library is ported from Live Cells for Dart.
The source code for this library is available on Github.
Note
This library, and in its name in particular, was inspired by Cells.
Examples¶
Attention
This library is still in beta and may experience breaking changes between releases.
Cells (reactive containers for data) are defined using
DEFCELL
.
(defcell first-name "John")
(defcell last-name "Smith")
Cells can be defined using arbitrary expressions that reference other cells:
(defcell full-name
(format nil "~a ~a" first-name last-name))
Cells are observed with LIVE
:
(live
(format t "Hello ~a~%" full-name))
Changing the value of a cell, using SETF
, results in the
live block being run:
For example changing the values of FIRST-NAME
and LAST-NAME
:
(setf first-name "Jane")
(setf last-name "Doe")
results in the following being printed:
Hello Jane Smith
Hello Jane Doe