Avoid (cdr '()) for patches from drivers - for msd.rkt this time

This commit is contained in:
Tony Garnock-Jones 2017-08-13 20:52:29 -04:00
parent af30c19ee0
commit e2d1ae853c
1 changed files with 14 additions and 7 deletions

View File

@ -51,13 +51,20 @@
[('action-interpreted 'quit)
(write-event! source sink 'quit)]
[('event (list cause (? patch? p)))
(write-event! source sink 'event
'patch
(format-patch '#hash() (cdr (spacetime-space sink)) p)
cause
(set-map (extract-patch-pids p)
(lambda (local-pid)
(cons local-pid (cdr (spacetime-space sink))))))]
(match (spacetime-space sink)
['()
(write-event! source sink 'event
'patch
(patch->pretty-string p)
cause
(list (spacetime-space cause)))]
[(cons _ context-path)
(write-event! source sink 'event
'patch
(format-patch '#hash() context-path p)
cause
(set-map (extract-patch-pids p)
(lambda (local-pid) (cons local-pid context-path))))])]
[('event (list cause (message body)))
(write-event! source sink 'event
'message