Syntax Experiments

One way I’ve been working on Klee, is to sketch out example programs and explain how they should behave, before the implementation can sufficiently execute the commands I’m drawing out.

During

The during keyword is used in proper syndicate implementations, and plays the same roll in Klee. It takes the default form:

(during P <E_b> <E> <E_r>)

Except

The opposite of during, fires whenever there is no matching assertions to the pattern.

(except P <E_b> <E> <E_r>)

Same idea as during but logically opposite, e.g. P is the pattern, E_b is run for a set amount of time starting whenever the expression is true. E runs as it is true, and E_r is run once a matching assertion is found.

Collect

Reactively collects all matching assertions and puts them into a sorted list.

(collect P)

Used to create reactive lists which can then be mapped over to draw shapes per each element. I generally like this approach better than instead having actors assert and update list data directly because if there is a very large list that is not often changed, a lot of bandwidth is wasted sending the entire list to only actually update a few entries. This strategy means only the direct changes to the list items are passed around.