Reactive programming

Reactive programming creates an internal mechanism that automatically updates things when a special kind of object* is changed. No need to call functions or subroutines do do that. You change object A, and B is automatically changed too.

* I understand only objects can be reactors(?).

Reactor: is the object that, when changed, triggers the changes in other objects. Created by make reactor! .

Reactive expression: changes when the reactor changes. Created by is .

make reactor! & is

This is the most simple program I could think of using reactive programming:


A reactor can update itself:


Be careful not create an endless loop: If a change triggers a change in itself.


Just like copy has the refinement /deep to reach nested values (blocks within the main block), so does reactor!.

This program is supposed to repeat what you type on the console, but it does not work:

no change
no change

However, if you change to deep-reactor!:



This is a command used for creating reactive GUIs. Please look at GUI- Advanced topics.

Cut-and-pasted from the documentation:


Removes all defined reactions, unconditionally.


Checks if an object’s field is a reactive source . If it is, the first reaction found where that object’s field is present as a source, will be returned, otherwise none is returned./target refinement checks if the field is a target instead of a source, and will return the first reaction found targeting that field or none if none matches.


Outputs a list of registered reactions for debug purposes.

results matching ""

    No results matching ""