|(require datacell)||package: datacell|
This package gives a simple embedded dataflow language based around the notion of “cells”, similar to the concept of a cell in a Spreadsheet.
A simple example:
> (define-cell a 0) > (define-cell b 2) > (define-cell c 0) > (define-cell d (- (expt b 2) (* 4 a c))) > d
> (set-cell! a 1) > (set-cell! c 1) > d
(define-cell name body ...)
A cells value is computed on demand, which is to say that body is only evaluated when the value of named is needed. The value of a cell is almost memoized, meaning body is only evaluated if the current value is not known or a cell used by the body has changed.
(set-cell! cell body)