diff --git a/bin/solid.pill b/bin/solid.pill index f1abb8a757..12c0234ad4 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4e075d6c51dc81db5831da7ec1c0ea78140fc6e0d0f27f681097a96f7254dee1 -size 12469200 +oid sha256:99ac1fbddddaad25d3275d1308f5f3814f4e586501fb0233915b8191c8221415 +size 12589812 diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index e1e291ac0a..d4ae90e57a 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -1974,9 +1974,9 @@ ?=([%'~_~' *] path.binding) :: runtime == [| bindings.state] - (insert-binding [binding duct action] bindings.state) + [& (insert-binding [binding duct action] bindings.state)] :_ state - [duct %give %bound success binding]~ + [duct %give %bound & binding]~ :: +remove-binding: removes a binding if it exists and is owned by this duct :: ++ remove-binding @@ -2097,28 +2097,29 @@ |= url=@t ^- [[ext=(unit @ta) site=(list @t)] args=(list [key=@t value=@t])] (fall (rush url ;~(plug apat:de-purl:html yque:de-purl:html)) [[~ ~] ~]) +:: +insert-binding: add a new binding, replacing any existing at its path :: ++ insert-binding - |= [[=binding =duct =action] bindings=(list [=binding =duct =action])] - =/ to-search bindings - |- ^- [? _bindings] - ?^ to-search - ?: =(binding binding.i.to-search) - [| bindings] - :: - $(to-search t.to-search) - :- & - :: store in reverse alphabetical order so that longer paths are first + |= $: new=[=binding =duct =action] + bindings=(list [=binding =duct =action]) + == + ^+ bindings + ?~ bindings [new]~ + =* bid binding.i.bindings + :: replace already bound paths :: - %- flop - %+ sort [[binding duct action] bindings] - |= [[a=^binding *] [b=^binding *]] + ?: =([site path]:bid [site path]:binding.new) + ~> %slog.[0 leaf+"eyre: replacing existing binding at {<`path`path.bid>}"] + [new t.bindings] + :: if new comes before bid, prepend it. + :: otherwise, continue our search. :: - ?: =(site.a site.b) - (aor path.a path.b) - :: alphabetize based on site - :: - (aor ?~(site.a '' u.site.a) ?~(site.b '' u.site.b)) + =; new-before-bid=? + ?: new-before-bid [new bindings] + [i.bindings $(bindings t.bindings)] + ?: =(site.binding.new site.bid) + (aor path.binding.new path.bid) + (aor (fall site.binding.new '') (fall site.bid '')) :: ++ channel-wire |= [channel-id=@t request-id=@ud]