Allow multiple "root" facets, by creating a dummy root
This commit is contained in:
parent
c85f05ced1
commit
669122766d
|
@ -265,11 +265,17 @@
|
|||
['absent->present (add-assertion! (dataspace-routing-table ds) a)]
|
||||
;; 'absent->absent and 'present->absent absurd
|
||||
['present->present (void)])) ;; i.e. no visible change
|
||||
;; Root facet is a dummy "system" facet that exists to hold one-or-more "user" "root" facets.
|
||||
(add-facet! #f
|
||||
the-actor
|
||||
#f
|
||||
(lambda ()
|
||||
(boot-proc)
|
||||
;; The "true root", user-visible facet.
|
||||
(add-facet! #f
|
||||
the-actor
|
||||
(current-facet)
|
||||
(lambda ()
|
||||
(boot-proc)))
|
||||
(for [(a filtered-initial-assertions)]
|
||||
(adhoc-retract! the-actor a)))))
|
||||
|
||||
|
@ -410,9 +416,12 @@
|
|||
(set-facet-children! parent (set-add (facet-children parent) 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?
|
||||
;; This should never happen. We deliberately create an
|
||||
;; otherwise-dummy root facet for each actor specifically to
|
||||
;; hold user facets, and there should be no way for the user
|
||||
;; to stop that root facet explicitly, which means user code
|
||||
;; can't start any replacements for it at all, let alone
|
||||
;; more than one!
|
||||
(error 'add-facet! "INTERNAL ERROR: Attempt to add second root facet"))
|
||||
(set-actor-root-facet! actor f)))
|
||||
(with-current-facet [f]
|
||||
|
|
Loading…
Reference in New Issue