zuse: add +got and +has arms to +ordered-map

This commit is contained in:
Logan Allen 2021-04-20 12:09:18 -05:00
parent ae2aefed2a
commit 9247fc247c

View File

@ -5182,7 +5182,6 @@
:: ::
?~ b a ?~ b a
$(b t.b, a (put a i.b)) $(b t.b, a (put a i.b))
::
:: +get: get val at key or return ~ :: +get: get val at key or return ~
:: ::
++ get ++ get
@ -5195,6 +5194,19 @@
?: (compare b key.n.a) ?: (compare b key.n.a)
$(a l.a) $(a l.a)
$(a r.a) $(a r.a)
:: +got: need value at key
::
++ got
|= [a=(tree item) b=key]
^- val
(need (get a b))
:: +has: check for key existence
::
++ has
~/ %has
|= [a=(tree item) b=key]
^- ?
!=(~ (get a b))
:: +nip: remove root; for internal use :: +nip: remove root; for internal use
:: ::
++ nip ++ nip