Here, c is the name of the cell:
var cell c = <expr>. Links to such a cell have type link(T)<var>.cell c = <expr>. Links to such a cell have type link(T).private cell c = <expr>. Links to such a cell have also type link(T).Note that cells are normally only visible for other cells, but not in defs.
var cells are like global variables (but with propagation to other cells). You can get the value and set it. Note that the expression defining the cell is only evaluated once, at definition time.
Define: var cell c = <expr>
Get the value: c
Where is it allowed to get the value?
Alternative: contents(c) - This is possible everywhere, even in defs. The contents(...) notation makes it clear that there is no automatic propagation, i.e. you get the value of the cell it currently has.
Set the value: c = <expr>.
Where is it allowed to set the value?
def with an appstate parameter (proving that it is called from the REPL or an action closure)Normal cells update their value when one of the cells in the defining expression changes its value.
It is not possible to set normal cells.
A normal cell prints the value to the REPL when it changes. When defined inside a module, a normal cell can be linked from the outside of the module.
A private cell does not print values, and is also not accessible at all from outside a module.