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->present (add-assertion! (dataspace-routing-table ds) a)]
|
||||||
;; 'absent->absent and 'present->absent absurd
|
;; 'absent->absent and 'present->absent absurd
|
||||||
['present->present (void)])) ;; i.e. no visible change
|
['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
|
(add-facet! #f
|
||||||
the-actor
|
the-actor
|
||||||
#f
|
#f
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(boot-proc)
|
;; The "true root", user-visible facet.
|
||||||
|
(add-facet! #f
|
||||||
|
the-actor
|
||||||
|
(current-facet)
|
||||||
|
(lambda ()
|
||||||
|
(boot-proc)))
|
||||||
(for [(a filtered-initial-assertions)]
|
(for [(a filtered-initial-assertions)]
|
||||||
(adhoc-retract! the-actor a)))))
|
(adhoc-retract! the-actor a)))))
|
||||||
|
|
||||||
|
@ -410,9 +416,12 @@
|
||||||
(set-facet-children! parent (set-add (facet-children parent) f))
|
(set-facet-children! parent (set-add (facet-children parent) f))
|
||||||
(begin
|
(begin
|
||||||
(when (actor-root-facet actor)
|
(when (actor-root-facet actor)
|
||||||
;; TODO: consider whether this is legit. For example, (stop-facet the-root-facet
|
;; This should never happen. We deliberately create an
|
||||||
;; (react ...) (react ...)) should probably be admissible, so perhaps more than one
|
;; otherwise-dummy root facet for each actor specifically to
|
||||||
;; root facet should be allowed?
|
;; 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"))
|
(error 'add-facet! "INTERNAL ERROR: Attempt to add second root facet"))
|
||||||
(set-actor-root-facet! actor f)))
|
(set-actor-root-facet! actor f)))
|
||||||
(with-current-facet [f]
|
(with-current-facet [f]
|
||||||
|
|
Loading…
Reference in New Issue