mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-14 15:04:14 +03:00
zuse: add +got and +has arms to +ordered-map
This commit is contained in:
parent
ae2aefed2a
commit
9247fc247c
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user