Merge pull request #1354 from urbit/typed-get-by

adds sample type to +get:by, fixes call-sites
This commit is contained in:
Joe Bryan 2019-07-18 12:18:04 -07:00 committed by GitHub
commit 9286f87cc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 14 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:054d477c7747198b4bbfa1027715ea445696af7eedffb63abe03b8ed80e51546 oid sha256:7fb2efecc5b3fb277e0d634b12afdda6cf9ffab75ac351fefbd7dfa393f7c5cd
size 9211844 size 9299426

View File

@ -149,10 +149,10 @@
=. ..this (give-result path %dns-request i.requests) =. ..this (give-result path %dns-request i.requests)
loop(requests t.requests) loop(requests t.requests)
:: ::
=/ who (slaw %p i.path) =/ who=(unit @p) (slaw %p i.path)
?~ who ?~ who
~| %invalid-path !! ~| %invalid-path !!
?~ dun=(~(get by completed.state) who) ?~ dun=(~(get by completed.state) u.who)
this this
(give-result path %dns-binding u.dun) (give-result path %dns-binding u.dun)
-- --

View File

@ -3293,7 +3293,7 @@
|= {t/telegram c/@ud k/(map serial @ud) s/(map circle (list @ud))} |= {t/telegram c/@ud k/(map serial @ud) s/(map circle (list @ud))}
:+ +(c) (~(put by k) uid.t c) :+ +(c) (~(put by k) uid.t c)
=/ src/circle =/ 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]) ?~ aud.t ~&(%strange-aud [our.bol %inbox])
n.aud.t n.aud.t
%+ ~(put by s) src %+ ~(put by s) src

View File

@ -1391,13 +1391,15 @@
:: ::
:: prints binding details. goes both ways. :: prints binding details. goes both ways.
:: ::
:: XX this type is a misjunction, audience can be ~
::
|= qur/(unit $@(char audience)) |= qur/(unit $@(char audience))
^+ ..sh-work ^+ ..sh-work
?^ qur ?^ qur
?^ u.qur ?^ u.qur
=+ cha=(~(get by bound) u.qur) =+ cha=(~(get by bound) u.qur)
(sh-fact %txt ?~(cha "none" [u.cha]~)) (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 "~") ?: =(~ pan) (sh-fact %txt "~")
=< (sh-fact %mor (turn pan .)) =< (sh-fact %mor (turn pan .))
|=(a/audience [%txt ~(ar-phat ar a)]) |=(a/audience [%txt ~(ar-phat ar a)])

View File

@ -1479,13 +1479,13 @@
:: ::
++ get :: grab value by key ++ get :: grab value by key
~/ %get ~/ %get
|= b/* |* b=*
^- {$@(~ {~ u/_?>(?=(^ a) q.n.a)})} => .(b `_?>(?=(^ a) p.n.a)`b)
=+ 42 |- ^- (unit _?>(?=(^ a) q.n.a))
?~ a ?~ a
~ ~
?: =(b p.n.a) ?: =(b p.n.a)
[~ u=q.n.a] (some q.n.a)
?: (gor b p.n.a) ?: (gor b p.n.a)
$(a l.a) $(a l.a)
$(a r.a) $(a r.a)

View File

@ -2271,7 +2271,7 @@
:: ::
u.existing 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 :: ack dupes except for the last fragment, in which case drop
:: ::
?: already-heard ?: already-heard

View File

@ -2264,7 +2264,7 @@
:: These convert between aeon (version number), tako (commit hash), yaki :: These convert between aeon (version number), tako (commit hash), yaki
:: (commit data structure), lobe (content hash), and blob (content). :: (commit data structure), lobe (content hash), and blob (content).
++ aeon-to-tako ~(got by hit.dom) ++ 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) ++ lobe-to-blob ~(got by lat.ran)
++ tako-to-yaki ~(got by hut.ran) ++ tako-to-yaki ~(got by hut.ran)
++ lobe-to-mark ++ lobe-to-mark
@ -3670,8 +3670,11 @@
|% |%
:: These convert between aeon (version number), tako (commit hash), yaki :: These convert between aeon (version number), tako (commit hash), yaki
:: (commit data structure), lobe (content hash), and blob (content). :: (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-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) ++ lobe-to-blob ~(got by lat.ran)
++ tako-to-yaki ~(got by hut.ran) ++ tako-to-yaki ~(got by hut.ran)
++ page-to-lobe page-to-lobe:util ++ page-to-lobe page-to-lobe:util

View File

@ -1042,7 +1042,7 @@
%.n %.n
:: is this a session that we know about? :: 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 %.n
:: is this session still valid? :: is this session still valid?
:: ::