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 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

Installation

Note

Live-Cells-CL is available on Quicklisp. However, it is recommended that you download the source manually to get the latest version.

  1. Download the source code from the latest release.

  2. Extract the tarball to your Quicklisp local project directory.

  3. Load the LIVE-CELLS system with the following:

    (ql:quickload :live-cells)
    

Documentation

Indices and tables