Merge pull request #4036 from urbit/m/listless-generators

various: start threads with unit of tuple args
This commit is contained in:
Joe Bryan 2020-12-04 00:21:00 -08:00 committed by GitHub
commit bbaeafe751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 40 additions and 28 deletions

View File

@ -728,6 +728,16 @@
:: ::
++ dy-cage |=(num=@ud (~(got by rez) num)) :: known cage ++ dy-cage |=(num=@ud (~(got by rez) num)) :: known cage
++ dy-vase |=(num=@ud q:(dy-cage num)) :: known vase ++ dy-vase |=(num=@ud q:(dy-cage num)) :: known vase
::
++ dy-some
|= src=(list dojo-source)
^- vase
?~ src !>(~)
%+ slop !>(~)
|-
?~ t.src (dy-vase p.i.src)
(slop (dy-vase p.i.src) $(src t.src))
::
++ dy-sore ++ dy-sore
|= src=(list dojo-source) |= src=(list dojo-source)
^- vase ^- vase
@ -850,7 +860,7 @@
[%pass /wool %agent [our.hid %spider] %watch /thread-result/[tid]] [%pass /wool %agent [our.hid %spider] %watch /thread-result/[tid]]
%- he-card %- he-card
=/ =cage :: also sub =/ =cage :: also sub
[%spider-start !>([~ `tid fil (dy-sore src)])] [%spider-start !>([~ `tid fil (dy-some src)])]
[%pass /wool %agent [our.hid %spider] %poke cage] [%pass /wool %agent [our.hid %spider] %poke cage]
:: ::
++ dy-make :: build step ++ dy-make :: build step

View File

@ -183,7 +183,7 @@
^- (quip card _this) ^- (quip card _this)
?: ?=([%start ~] wire) ?: ?=([%start ~] wire)
=/ new-tid=@ta (cat 3 'glob--' (scot %uv eny.bowl)) =/ new-tid=@ta (cat 3 'glob--' (scot %uv eny.bowl))
=/ args [~ `new-tid %glob !>([hash.state ~])] =/ args [~ `new-tid %glob !>([~ hash.state])]
=/ action !>([%unserve-dir serve-path]) =/ action !>([%unserve-dir serve-path])
:_ this(glob.state `[%| new-tid]) :_ this(glob.state `[%| new-tid])
:~ (poke-file-server our.bowl %file-server-action action) :~ (poke-file-server our.bowl %file-server-action action)

View File

@ -179,7 +179,7 @@
[our.bowl %spider] [our.bowl %spider]
%poke %poke
%spider-start %spider-start
!>([~ `tid thread.observer (slop q.cage.sign !>(~))]) !>([~ `tid thread.observer (slop !>(~) q.cage.sign)])
== == == ==
== ==
:: ::

View File

@ -290,7 +290,7 @@
=/ body=json =/ body=json
(need (de-json:html q.u.body.request.inbound-request)) (need (de-json:html q.u.body.request.inbound-request))
=/ input=vase =/ input=vase
(slop (tube !>(body)) !>(~)) (slop !>(~) (tube !>(body)))
=/ =start-args =/ =start-args
[~ `tid thread input] [~ `tid thread input]
=^ cards state =^ cards state

View File

@ -5,7 +5,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([pax=path ~] arg) =+ !<([~ pax=path] arg)
?~ bem=(de-beam:format pax) ?~ bem=(de-beam:format pax)
(strand-fail:strand %path-not-beam >pax< ~) (strand-fail:strand %path-not-beam >pax< ~)
=/ =mars:clay [i i.t]:?>(?=([@ @ ~] s.u.bem) s.u.bem) =/ =mars:clay [i i.t]:?>(?=([@ @ ~] s.u.bem) s.u.bem)

View File

@ -5,7 +5,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([pax=path ~] arg) =+ !<([~ pax=path] arg)
?^ bem=(de-beam:format pax) ?^ bem=(de-beam:format pax)
(build-file:strandio u.bem) (build-file:strandio u.bem)
(strand-fail:strand %path-not-beam >pax< ~) (strand-fail:strand %path-not-beam >pax< ~)

View File

@ -5,7 +5,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([pax=path ~] arg) =+ !<([~ pax=path] arg)
?~ bem=(de-beam:format pax) ?~ bem=(de-beam:format pax)
(strand-fail:strand %path-not-beam >pax< ~) (strand-fail:strand %path-not-beam >pax< ~)
=/ =mark (rear s.u.bem) =/ =mark (rear s.u.bem)

View File

@ -6,7 +6,7 @@
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
|^ |^
=+ !<([=a=path =b=path ~] arg) =+ !<([~ =a=path =b=path] arg)
=/ a-mark=mark -:(flop a-path) =/ a-mark=mark -:(flop a-path)
=/ b-mark=mark -:(flop b-path) =/ b-mark=mark -:(flop b-path)
?. =(a-mark b-mark) ?. =(a-mark b-mark)

View File

@ -6,7 +6,7 @@
|^ |^
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !< [adr=address:dns ~] arg =+ !< [~ adr=address:dns] arg
:: ::
;< our=ship bind:m get-our:strandio ;< our=ship bind:m get-our:strandio
=/ rac (clan:title our) =/ rac (clan:title our)

View File

@ -5,7 +5,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([hash=@uv ~] arg) =+ !<([~ hash=@uv] arg)
=/ url "https://bootstrap.urbit.org/glob-{(scow %uv hash)}.glob" =/ url "https://bootstrap.urbit.org/glob-{(scow %uv hash)}.glob"
;< =cord bind:m (fetch-cord:strandio url) ;< =cord bind:m (fetch-cord:strandio url)
=+ ;;(=glob:glob (cue cord)) =+ ;;(=glob:glob (cue cord))

View File

@ -29,7 +29,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([=action:graph-view ~] arg) =+ !<([~ =action:graph-view] arg)
?> ?=(%create -.action) ?> ?=(%create -.action)
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
:: ::

View File

@ -57,7 +57,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([=action:graph-view ~] arg) =+ !<([~ =action:graph-view] arg)
?> ?=(%delete -.action) ?> ?=(%delete -.action)
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
?. =(our.bowl entity.rid.action) ?. =(our.bowl entity.rid.action)

View File

@ -43,7 +43,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([=action:graph-view ~] arg) =+ !<([~ =action:graph-view] arg)
?> ?=(%groupify -.action) ?> ?=(%groupify -.action)
;< =group bind:m (scry-group rid.action) ;< =group bind:m (scry-group rid.action)
?. hidden.group ?. hidden.group

View File

@ -28,7 +28,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([=action:graph-view ~] arg) =+ !<([~ =action:graph-view] arg)
?> ?=(%join -.action) ?> ?=(%join -.action)
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
?: =(our.bowl entity.rid.action) ?: =(our.bowl entity.rid.action)

View File

@ -49,7 +49,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([=action:graph-view ~] arg) =+ !<([~ =action:graph-view] arg)
?> ?=(%leave -.action) ?> ?=(%leave -.action)
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
?: =(our.bowl entity.rid.action) ?: =(our.bowl entity.rid.action)

View File

@ -12,7 +12,7 @@
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !< =+ !<
[[rid=resource title=@t description=@t group=resource module=@t ~] ~] [~ rid=resource title=@t description=@t group=resource module=@t ~]
arg arg
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
:: unarchive graph and share it :: unarchive graph and share it

View File

@ -5,7 +5,8 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([who=ship mez=$@(~ [=tape ~])] arg) =+ !<([~ arg=$@(who=ship [who=ship mez=tape])] arg)
=/ message ?~(mez '' (crip tape.mez)) =/ [who=ship message=@t]
?@(arg [who.arg ''] [who.arg (crip mez.arg)])
;< ~ bind:m (poke:strandio [who %hood] %helm-hi !>(message)) ;< ~ bind:m (poke:strandio [who %hood] %helm-hi !>(message))
(pure:m !>("hi {<who>} successful")) (pure:m !>("hi {<who>} successful"))

View File

@ -10,7 +10,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([=update:inv ~] arg) =+ !<([~ =update:inv] arg)
?. ?=(%accepted -.update) ?. ?=(%accepted -.update)
(pure:m !>(~)) (pure:m !>(~))
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
@ -21,8 +21,7 @@
;< ~ bind:m ;< ~ bind:m
%+ poke-our %spider %+ poke-our %spider
=- spider-start+!>([`tid.bowl ~ %graph-join -]) =- spider-start+!>([`tid.bowl ~ %graph-join -])
%+ slop %+ slop !>(~)
!> ^- action:graph-view !> ^- action:graph-view
[%join resource.invite ship.invite] [%join resource.invite ship.invite]
!>(~)
(pure:m !>(~)) (pure:m !>(~))

View File

@ -5,7 +5,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=/ [og-path=path ng-path=path ~] !<([path path ~] arg) =/ [~ og-path=path ng-path=path] !<([~ path path] arg)
;< bol=bowl:spider bind:m get-bowl:strandio ;< bol=bowl:spider bind:m get-bowl:strandio
|^ |^
:: ::

View File

@ -7,7 +7,7 @@
^- form:m ^- form:m
:: Parse arguments as ship, desk, and path :: Parse arguments as ship, desk, and path
:: ::
=+ !<([=care:clay =ship =desk =case =target=path ~] arg) =+ !<([~ =care:clay =ship =desk =case =target=path] arg)
:: Read the file, possibly asyncrhonously :: Read the file, possibly asyncrhonously
:: ::
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio

View File

@ -104,8 +104,10 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=/ paz=(list path)
(tail !<([~ (list path)] arg))
=/ bez=(list beam) =/ bez=(list beam)
(turn !<((list path) arg) |=(p=path (need (de-beam:format p)))) (turn paz |=(p=path (need (de-beam:format p))))
;< fiz=(set [=beam test=(unit term)]) bind:m (find-test-files bez) ;< fiz=(set [=beam test=(unit term)]) bind:m (find-test-files bez)
=> .(fiz (sort ~(tap in fiz) aor)) => .(fiz (sort ~(tap in fiz) aor))
=| test-arms=(map path (list test-arm)) =| test-arms=(map path (list test-arm))

View File

@ -5,7 +5,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([arg=@dr ~] arg) =+ !<([~ arg=@dr] arg)
;< now-1=@da bind:m get-time:strandio ;< now-1=@da bind:m get-time:strandio
;< ~ bind:m (sleep:strandio arg) ;< ~ bind:m (sleep:strandio arg)
;< now-2=@da bind:m get-time:strandio ;< now-2=@da bind:m get-time:strandio

View File

@ -5,7 +5,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<([pax=path ~] arg) =+ !<([~ pax=path] arg)
;< bek=beak bind:m get-beak:strandio ;< bek=beak bind:m get-beak:strandio
;< paz=(list path) bind:m (list-tree:strandio bek (flop pax)) ;< paz=(list path) bind:m (list-tree:strandio bek (flop pax))
(pure:m !>(paz)) (pure:m !>(paz))