Hi Marijn,<div><br></div><div>FrTime propagates changes asynchronously. When send-event returns, there's no guarantee that the event has finished propagating through the system. And in general, (value-now b) is not well-defined, since asynchronous processing makes it difficult to define what "now" means; programs should only call this if they can tolerate stale values.</div>
<div><br></div><div>(It so happens that evaluating (hold a) blocks your thread until the event finishes propagating, but that's an implementation detail. You can probably achieve the same effect through a call to "sleep", for example.)</div>
<div><br></div><div>Greg<br><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 8:08 AM, Marijn <span dir="ltr"><<a href="mailto:hkBst@gentoo.org" target="_blank">hkBst@gentoo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Hi,<br>
<br>
Consider:<br>
<br>
<br>
#lang racket<br>
<br>
(require frtime)<br>
<br>
(define a (event-receiver))<br>
(define b (hold a))<br>
<br>
(send-event a 3)<br>
<br>
;;; uncomment next line to make it work<br>
;(value-now (hold a))<br>
(value-now b)<br>
<br>
<br>
`a' is an event-stream onto which the value 3 is sent. `b' is the<br>
behavior produced by holding the last value seen on `a'. After the<br>
value 3 arrives on `a', `b' should hold to 3. But it doesn't unless<br>
you ``help'' frtime a bit...<br>
<br>
Marijn<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2.0.18 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
iEYEARECAAYFAk8Ns/8ACgkQp/VmCx0OL2yahwCcDFs/1kL+m4PVhfmPdkjTQTcu<br>
KmMAnjLaAAHPYvCM1eKkLXl0EBCuXRkE<br>
=mrh9<br>
-----END PGP SIGNATURE-----<br>
_________________________<br>
Racket Developers list:<br>
<a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
</blockquote></div><br></div>