Flatten action tree
This commit is contained in:
parent
4eeaf3dcbb
commit
44898b09b2
6
os2.rkt
6
os2.rkt
|
@ -3,6 +3,7 @@
|
|||
|
||||
(require racket/set)
|
||||
(require racket/match)
|
||||
(require (only-in racket/list flatten))
|
||||
(require "unify.rkt")
|
||||
|
||||
;; Endpoints are the units of deduplication.
|
||||
|
@ -53,7 +54,8 @@
|
|||
;; MessageHandler = TrapK<EID * Topic * Message>
|
||||
(struct handlers (presence absence message) #:transparent)
|
||||
|
||||
;; actions is a plain old List<Action>, not a QuasiQueue.
|
||||
;; actions is a plain old ordered ConsTreeOf<Action>, not a
|
||||
;; QuasiQueue.
|
||||
(struct transition (state actions) #:transparent)
|
||||
|
||||
;; Preactions.
|
||||
|
@ -260,7 +262,7 @@
|
|||
|
||||
(define (enqueue-actions state pid actions)
|
||||
(struct-copy vm state
|
||||
[pending-actions (quasi-enqueue-many (for/list ([a actions]) (cons pid a))
|
||||
[pending-actions (quasi-enqueue-many (for/list ([a (flatten actions)]) (cons pid a))
|
||||
(vm-pending-actions state))]))
|
||||
|
||||
(define (wrap-trapk pid trapk)
|
||||
|
|
Loading…
Reference in New Issue