mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 18:16:30 +03:00
Merge pull request #1354 from urbit/typed-get-by
adds sample type to +get:by, fixes call-sites
This commit is contained in:
commit
9286f87cc1
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:054d477c7747198b4bbfa1027715ea445696af7eedffb63abe03b8ed80e51546
|
||||
size 9211844
|
||||
oid sha256:7fb2efecc5b3fb277e0d634b12afdda6cf9ffab75ac351fefbd7dfa393f7c5cd
|
||||
size 9299426
|
||||
|
@ -149,10 +149,10 @@
|
||||
=. ..this (give-result path %dns-request i.requests)
|
||||
loop(requests t.requests)
|
||||
::
|
||||
=/ who (slaw %p i.path)
|
||||
=/ who=(unit @p) (slaw %p i.path)
|
||||
?~ who
|
||||
~| %invalid-path !!
|
||||
?~ dun=(~(get by completed.state) who)
|
||||
?~ dun=(~(get by completed.state) u.who)
|
||||
this
|
||||
(give-result path %dns-binding u.dun)
|
||||
--
|
||||
|
@ -3293,7 +3293,7 @@
|
||||
|= {t/telegram c/@ud k/(map serial @ud) s/(map circle (list @ud))}
|
||||
:+ +(c) (~(put by k) uid.t c)
|
||||
=/ src/circle
|
||||
?: (~(has by aud.t) [our.bol nom]) [our.bol nom]
|
||||
?: (~(has in aud.t) [our.bol nom]) [our.bol nom]
|
||||
?~ aud.t ~&(%strange-aud [our.bol %inbox])
|
||||
n.aud.t
|
||||
%+ ~(put by s) src
|
||||
|
@ -1391,13 +1391,15 @@
|
||||
::
|
||||
:: prints binding details. goes both ways.
|
||||
::
|
||||
:: XX this type is a misjunction, audience can be ~
|
||||
::
|
||||
|= qur/(unit $@(char audience))
|
||||
^+ ..sh-work
|
||||
?^ qur
|
||||
?^ u.qur
|
||||
=+ cha=(~(get by bound) u.qur)
|
||||
(sh-fact %txt ?~(cha "none" [u.cha]~))
|
||||
=+ pan=~(tap in (~(get ju binds) u.qur))
|
||||
=+ pan=~(tap in (~(get ju binds) `@t`u.qur))
|
||||
?: =(~ pan) (sh-fact %txt "~")
|
||||
=< (sh-fact %mor (turn pan .))
|
||||
|=(a/audience [%txt ~(ar-phat ar a)])
|
||||
|
@ -1479,13 +1479,13 @@
|
||||
::
|
||||
++ get :: grab value by key
|
||||
~/ %get
|
||||
|= b/*
|
||||
^- {$@(~ {~ u/_?>(?=(^ a) q.n.a)})}
|
||||
=+ 42
|
||||
|* b=*
|
||||
=> .(b `_?>(?=(^ a) p.n.a)`b)
|
||||
|- ^- (unit _?>(?=(^ a) q.n.a))
|
||||
?~ a
|
||||
~
|
||||
?: =(b p.n.a)
|
||||
[~ u=q.n.a]
|
||||
(some q.n.a)
|
||||
?: (gor b p.n.a)
|
||||
$(a l.a)
|
||||
$(a r.a)
|
||||
|
@ -2271,7 +2271,7 @@
|
||||
::
|
||||
u.existing
|
||||
::
|
||||
=/ already-heard=? (~(has by fragments.partial-rcv-message) seq)
|
||||
=/ already-heard=? (~(has by fragments.partial-rcv-message) `^fragment-num``@`seq)
|
||||
:: ack dupes except for the last fragment, in which case drop
|
||||
::
|
||||
?: already-heard
|
||||
|
@ -2264,7 +2264,7 @@
|
||||
:: These convert between aeon (version number), tako (commit hash), yaki
|
||||
:: (commit data structure), lobe (content hash), and blob (content).
|
||||
++ aeon-to-tako ~(got by hit.dom)
|
||||
++ aeon-to-yaki (cork aeon-to-tako tako-to-yaki)
|
||||
++ aeon-to-yaki |=(=aeon (tako-to-yaki (aeon-to-tako aeon)))
|
||||
++ lobe-to-blob ~(got by lat.ran)
|
||||
++ tako-to-yaki ~(got by hut.ran)
|
||||
++ lobe-to-mark
|
||||
@ -3670,8 +3670,11 @@
|
||||
|%
|
||||
:: These convert between aeon (version number), tako (commit hash), yaki
|
||||
:: (commit data structure), lobe (content hash), and blob (content).
|
||||
::
|
||||
:: XX the following are duplicated from the +state core
|
||||
::
|
||||
++ aeon-to-tako ~(got by hit.dom)
|
||||
++ aeon-to-yaki (cork aeon-to-tako tako-to-yaki)
|
||||
++ aeon-to-yaki |=(=aeon (tako-to-yaki (aeon-to-tako aeon)))
|
||||
++ lobe-to-blob ~(got by lat.ran)
|
||||
++ tako-to-yaki ~(got by hut.ran)
|
||||
++ page-to-lobe page-to-lobe:util
|
||||
|
@ -1042,7 +1042,7 @@
|
||||
%.n
|
||||
:: is this a session that we know about?
|
||||
::
|
||||
?~ session=(~(get by sessions.authentication-state.state) u.session-id)
|
||||
?~ session=(~(get by sessions.authentication-state.state) `@uv`u.session-id)
|
||||
%.n
|
||||
:: is this session still valid?
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user