hoon: fix +uno:by when map is null

This crashed at runtime when `a` is null because it tried to instantiate
`meg`, and that means bunting its argument, and that calls `node`, where
the assert failed.

Wet gates use the bunt of their formal argument, so we use that.
This commit is contained in:
Philip Monk 2022-03-25 18:06:32 -07:00
parent 68eaf4aed7
commit 50fb239d2f

View File

@ -1453,7 +1453,6 @@
++ by :: map engine
~/ %by
=| a=(tree (pair)) :: (map)
=* node ?>(?=(^ a) n.a)
|@
++ all :: logical AND
~/ %all
@ -1717,14 +1716,14 @@
=+ b=a
|@
++ $
|= meg=$-([_p:node _q:node _q:node] _q:node)
|* meg=$-([* * *] *)
|- ^+ a
?~ b
a
?~ a
b
?: =(p.n.b p.n.a)
:+ [p.n.a (meg p.n.a q.n.a q.n.b)]
:+ [p.n.a `_?>(?=(^ a) q.n.a)`(meg p.n.a q.n.a q.n.b)]
$(b l.b, a l.a)
$(b r.b, a r.a)
?: (mor p.n.a p.n.b)