[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] ANN: new egg "forcible"

From: Jörg F . Wittenberger
Subject: [Chicken-users] ANN: new egg "forcible"
Date: Mon, 11 Jan 2016 12:41:50 +0100
User-agent: Mozilla/5.0 (X11; Linux armv7l; rv:38.0) Gecko/20100101 Icedove/38.4.0

Hi all,

there is a new egg "forcible" to be added to the coop:
documentation at

It was born out of frustration that `delay` (and srfi-45 `lazy`) will
actually evaluate the expression multiple times (if either the
evaluation is still running while forced from another thread or run into
an exception).  Thus lazy algorithms are actually not that lazy.

This one makes sure evaluation happens just once.

This is essentially srfi-45 for use in conjunction with srfi-18 plus
some more synchronization primitives:

* `future` and `lazy-future`, which are like "delay" but the expression
is evaluated in it's own thread, whereby lazy-future does not start the
thread immediately, `demand` will start such a thread but not `force`
the result.  `force` will start and join the thread.

* `force` is extended to accept an optional second argument, an
exception handler.  Thus you don't need to wrap the call to `force` if
you need to catch those exceptions.

* `expectable` creates a promise and a procedure to fulfil it.

Feedback welcome.

Best Regards


reply via email to

[Prev in Thread] Current Thread [Next in Thread]