Flatten actions, to permit '() and lists of actions
This commit is contained in:
parent
37f242874b
commit
3c1c36facc
|
@ -4,6 +4,7 @@
|
|||
|
||||
(require racket/set)
|
||||
(require racket/match)
|
||||
(require racket/list)
|
||||
(require "os.rkt")
|
||||
|
||||
(provide (struct-out subscribe)
|
||||
|
@ -51,7 +52,7 @@
|
|||
;; -- a (transition WorldState ListOf<Action>) or
|
||||
;; -- a WorldState
|
||||
(struct transition (state actions) #:transparent)
|
||||
(define (make-transition state . actions) (transition state actions))
|
||||
(define (make-transition state . actions) (transition state (flatten actions)))
|
||||
|
||||
;; A World is a (world WorldState Map<SID,Set<EventDescription>>), a
|
||||
;; representation of a suspended world and its active subscriptions.
|
||||
|
@ -124,4 +125,4 @@
|
|||
(define (os-big-bang initial-state . initial-actions)
|
||||
(lambda ()
|
||||
(transition->os-transition (world (void) (hash))
|
||||
(transition initial-state initial-actions))))
|
||||
(transition initial-state (flatten initial-actions)))))
|
||||
|
|
Loading…
Reference in New Issue