[plt-scheme] frtime qn - behaviour depending on evt & another behaviour

From: harsha (harsha.v.r at gmail.com)
Date: Tue Jul 29 08:46:44 EDT 2008

  i was surprised by how the following program behaved and was
wondering about what the semantics of a behaviour whose definition
depends on an event and another behaviour.

(define evt (event-receiver))
(define a (hold evt 0))
(define b (collect-b evt 100 (λ(e old) (+ a old))))

b  => 100
(send-event evt 10)
b  => 110
(send-event evt -10)
b  => 80
(send-event evt 10)
b  => 130

i am not sure if this is a bug or just that collect-b is not supposed
to be used this way.

Posted on the users mailing list.