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-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
|= src=(list dojo-source)
^- vase
@ -850,7 +860,7 @@
[%pass /wool %agent [our.hid %spider] %watch /thread-result/[tid]]
%- he-card
=/ =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]
::
++ dy-make :: build step

View File

@ -183,7 +183,7 @@
^- (quip card _this)
?: ?=([%start ~] wire)
=/ 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])
:_ this(glob.state `[%| new-tid])
:~ (poke-file-server our.bowl %file-server-action action)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,7 @@
|= arg=vase
=/ m (strand ,vase)
^- 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
|^
::

View File

@ -7,7 +7,7 @@
^- form:m
:: 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
::
;< =bowl:spider bind:m get-bowl:strandio

View File

@ -104,8 +104,10 @@
|= arg=vase
=/ m (strand ,vase)
^- form:m
=/ paz=(list path)
(tail !<([~ (list path)] arg))
=/ 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 (sort ~(tap in fiz) aor))
=| test-arms=(map path (list test-arm))

View File

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

View File

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