syndicate-2017/racket/syndicate/examples/actor/example-bug-rising-edge-tru...

14 lines
418 B
Racket
Raw Normal View History

#lang syndicate
2017-05-04 13:08:47 +00:00
;; Demonstrates a bug: rising-edge of a predicate that starts off true
;; yields a crash.
;;
;; Fixed by commit 1fdd62d: Now both processes print their message and
;; terminate normally, as expected.
2017-05-04 13:08:47 +00:00
(spawn (field [f #t])
(stop-when (rising-edge (f))
(printf "Stopping (via field).\n")))
(spawn (stop-when (rising-edge #t)
(printf "Stopping (direct).\n")))