Skip to content

plops/cl-learn-cells

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

a ruled cell

`defmodel` `:initform (c? .. self ..)` `:unchanged-if #’equal`

`^<slot-name>` is a short cut for `(<slot-name> self)

`(cells-reset)`

family

`defmodel <node-name> (<family>)`

`make-instance ‘<node-name> :val (c? ..) :kids (c? (the-kids (make-kid ‘<node-name> :md-name …`

observer

`defobserver <slot-name> [self [old-value [new-value [old-value-boundp]]]]`

lazy cells

evaluate when needed

`:once-asked` evaluated first time and when read by application code

`:until-asked` becomes unlazy after asked by application code the first time

`:always` only evaluated when read

eval during creationwhen dependencies changeupon readcode :initform
non-lazyyyn(c? …
:once-askedyny(c-formula (:lazy :one-asked) …)
:until-askednyn (?)(c_? ..)
:alwaysnny(c?_ ..)

long names are more descriptive c-formula instead of c?/c_?/c?_ c-input instead of c-in

drifter cells

increment the value

`(c… (0) <code>)` `(c… (<intial value>) <body>)`

ruled cells with cyclic dependencies

use `with-integrity` in the observer. this prevents an observer to be still running, when it is called next

use `(cells-reset)` to recover from errors involving cycles

synapses

specify sensitivity of when to propagate change

`(c? (f-sensitivity <synapse-name> <threshold> <value>))`

code in <value> will always be executed on dependency change but result will only be propagated if the change with respect to the previously stored value is larger than threshold

there is also

`f-delta f-plusp f-zerop`

and new synapses can be defined:

`with-synapse <id> ([var1] [var2] ..) <body>

var1.. will be initialized during when <body> is first run. they retain the value between calls

<body> returns (values <return-value> :propagate) if the newly computed value is to be passed to other dependent cells otherwise it should return (values nil :no-propagate)

About

Try to understand Kenny Tilton's dataflow progamming extension for Common Lisp

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors