Fork me on GitHub
#missionary
<
2021-09-14
>
Johan23:09:36

Highly recommend reading this http://sarabander.github.io/sicp/html/4_002e3.xhtml#g_t4_002e3 to understand the amb macro. Would the forms in amb be granted to run only once ?

leonoel12:09:00

> Would the forms in amb be granted to run only once ? no. ambs can be cancelled, if there are pending branches they will not run and an exception will be thrown

Johan12:09:08

Have you discovered other use case for amb related to async ? The retry is quite elegant.

leonoel12:09:19

it is a gold mine, especially in combination with loop to keep track of state. e.g when you need to emit a value and continue with state that depends on that value, (amb> value (recur value)) is very efficient (cf how-to iterative queries for a similar pattern). It is also a good fit to implement clocks