Notice attempts to install more than one root facet in an actor

This commit is contained in:
Tony Garnock-Jones 2018-04-22 21:03:01 +01:00
parent 4be935a160
commit a3dfb2c5aa
1 changed files with 7 additions and 1 deletions

View File

@ -365,7 +365,13 @@
(seteq)))
(if parent
(set-facet-children! parent (set-add (facet-children parent) f))
(set-actor-root-facet! actor f))
(begin
(when (actor-root-facet actor)
;; TODO: consider whether this is legit. For example, (stop-facet the-root-facet
;; (react ...) (react ...)) should probably be admissible, so perhaps more than one
;; root facet should be allowed?
(error 'add-facet! "INTERNAL ERROR: Attempt to add second root facet"))
(set-actor-root-facet! actor f)))
(with-current-facet [ds actor f #f]
(boot-proc))
(push-script! ds actor (lambda ()