2017-08-10 19:17:28 +00:00
|
|
|
#lang syndicate
|
2016-06-11 10:34:34 +00:00
|
|
|
;; Illustrates a (now fixed) bug where mutation altering a
|
|
|
|
;; subscription caused the `retracted` half of a during instance to be
|
|
|
|
;; lost.
|
|
|
|
;;
|
|
|
|
;; Symptomatic output:
|
|
|
|
;; x=123 v=999
|
|
|
|
;; x=124 v=999
|
|
|
|
;;
|
|
|
|
;; Correct output:
|
|
|
|
;; x=123 v=999
|
|
|
|
;; x=124 v=999
|
2018-04-29 20:48:49 +00:00
|
|
|
;; finally for x0=123 x=124 v=999
|
2016-06-11 10:34:34 +00:00
|
|
|
;;
|
|
|
|
;; Should eventually be turned into some kind of test case.
|
|
|
|
|
|
|
|
(struct foo (x y) #:prefab)
|
|
|
|
|
2017-02-15 23:18:19 +00:00
|
|
|
(spawn (field [x 123])
|
2016-08-24 16:35:38 +00:00
|
|
|
(assert (foo (x) 999))
|
|
|
|
(during (foo (x) $v)
|
2018-04-29 20:48:49 +00:00
|
|
|
(define x0 (x))
|
2016-08-24 16:35:38 +00:00
|
|
|
(log-info "x=~a v=~a" (x) v)
|
|
|
|
(when (= (x) 123) (x 124))
|
|
|
|
(on-stop
|
2018-04-29 20:48:49 +00:00
|
|
|
(log-info "finally for x0=~a x=~a v=~a" x0 (x) v))))
|