Merge branch 'master' of github.com:urbit/urbit

This commit is contained in:
Gavin Whelan 2014-03-07 16:38:19 -08:00
commit d8af5d339b
5 changed files with 91 additions and 19 deletions

View File

@ -726,6 +726,13 @@
|-
?~ a b
[i=i.a $(a t.a)]
::
++ zing :: promote
|* a=(list (list))
^+ ?>(?=(^ a) (homo i.a))
|-
?~ a ~
(weld i.a $(a t.a))
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2bC, gears ::
::
@ -3154,16 +3161,6 @@
?. &(?=(^ gat) ?=(^ +.gat))
[%2 ~]
(mink [[-.gat [sam +>.gat]] -.gat] sky)
::
++ myng
|= [gat=* sam=*]
^- (each ,* (list tank))
=+ ton=(mong [gat sam] |=(* ~))
?- -.ton
%0 [%& p.ton]
%1 [%| (turn p.ton |=(a=* (smyt (path a))))]
%2 [%| p.ton]
==
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eO, diff (move me) ::
::
@ -4081,6 +4078,7 @@
++ onan |=(vix=vise (seer vix))
++ rain
|= [bon=path txt=@]
^- twig
=+ vaz=vast
~| bon
(scan (trip txt) (full (ifix [gay gay] tall:vaz(wer bon))))
@ -4996,11 +4994,12 @@
==
::
++ dish
|= [ham=calf lum=*] ^- tank
|= [ham=calf lum=*] ^- tank !:
~| [%dish-h ?@(q.ham q.ham -.q.ham)]
:: ~| [%lump lum]
~| [%lump lum]
~| [%ham ham]
%- need
=| gil=(set ,@ud)
=| gil=(set ,[@ud *])
|- ^- (unit tank)
?- q.ham
%noun
@ -5133,11 +5132,11 @@
[~ %leaf ?:(=(['~' ~] fox) fox ['%' fox])]
::
[%stop *]
?: (~(has in gil) p.q.ham) ~
?: (~(has in gil) [p.q.ham lum]) ~
=+ kep=(~(get by p.ham) p.q.ham)
?~ kep
~|([%stop-loss p.q.ham] !!)
$(gil (~(put in gil) p.q.ham), q.ham u.kep)
$(gil (~(put in gil) [p.q.ham lum]), q.ham u.kep)
::
[%tree *]
=- ?~ tok

View File

@ -1192,7 +1192,7 @@
--
::
++ feel :: simple file write
|= [pax=path val=*] !:
|= [pax=path val=*]
^- miso
=+ dir=((hard arch) .^(%cy pax))
?~ q.dir [%ins val]
@ -1206,6 +1206,28 @@
=+ dir=((hard arch) .^(%cy pax))
?~(q.dir ~ [~ .^(%cx pax)])
::
++ foal :: high-level write
|= [pax=path val=*]
^- toro
?> ?=([* * * *] pax)
[i.t.pax [%& ~ [*cart [[t.t.t.pax (feel pax val)] ~]]]]
::
++ fray :: high-level delete
|= pax=path
^- toro
?> ?=([* * * *] pax)
[i.t.pax [%& ~ [*cart [[t.t.t.pax [%del .^(%cx pax)]] ~]]]]
::
++ furl :: unify changes
|= [one=toro two=toro] !:
^- toro
~| %furl
?> ?& =(p.one p.two) :: same path
&(?=(& -.q.one) ?=(& -.q.two)) :: both deltas
&(?=(~ p.q.one) ?=(~ p.q.two)) :: not merges
==
[p.one [%& ~ [*cart (weld q.q.q.one q.q.q.two)]]]
::
++ glam
|= zar=@p ^- tape
%+ snag zar
@ -1495,6 +1517,21 @@
^- path
[(cat 3 'c' p.kit) (scot %p r.kit) s.kit (scot (dime q.kit)) t.kit]
::
++ mush :: high-level call
|= [pax=path sam=vase]
^- (each vase (list tank))
!!
::
++ mute :: easy virtual
|= taq=_^?(|.(_*))
^- (each ,* (list tank))
=+ ton=(mock [taq [0 2]] |=(* ~))
?- -.ton
%0 [%& p.ton]
%1 [%| (turn p.ton |=(a=* (smyt (path a))))]
%2 [%| p.ton]
==
::
++ numb
|= [him=@p now=@da] ^- @t
=+ yow=(scot %p him)
@ -1838,7 +1875,7 @@
[%lo p=(list tank)] :: multiple statement
[%mu p=type q=(list)] :: batch emit
[%mx p=(list gift)] :: batch gift
[%ok p=disc q=nori] :: save changes
[%ok p=@ta q=nori] :: save changes
[%sc p=(unit skit)] :: stack library
[%sp p=(list lark)] :: spawn task(s)
[%sq p=ship q=@tas r=path s=*] :: send request
@ -1889,8 +1926,8 @@
++ gram ,@uw :: physical datagram
++ gyro ,[p=@ud q=wire r=prod] :: live prompt
++ hand ,@uvH :: hash of code
++ hate ,[p=purl q=@p r=moth] :: cooked request
++ heel ,[p=scud q=moth] :: cooked input
++ hate ,[p=purl q=@p r=moth] :: semi-cooked request
++ heel ,[p=scud q=moth] :: cooked request
++ heir ,[p=@ud q=math r=(unit love)] :: status/headers/data
++ hiss ,[p=purl q=moth] :: outbound request
++ hist ,[p=@ud q=(list ,@t)] :: depth texts
@ -2149,6 +2186,7 @@
== ::
++ taxi ,[p=lane q=rock] :: routed packet
++ tick ,@ud :: process id
++ toro ,[p=@ta q=nori] :: general change
++ town :: all security state
$: lit=@ud :: imperial modulus
any=@ :: entropy

10
main/bin/cp.hoon Normal file
View File

@ -0,0 +1,10 @@
!: :: /=main=/bin/cp/hoon
!? 164
::::
|= *
|= [input=path output=path ~]
^- bowl
::::
:_ ~ :_ ~
^- gift
[%ok (foal output .^(%cx input))]

10
main/bin/mv.hoon Normal file
View File

@ -0,0 +1,10 @@
!: :: /=main=/bin/mv/hoon
!? 164
::::
|= *
|= [input=path output=path ~]
^- bowl
::::
:_ ~ :_ ~
^- gift
[%ok (furl (foal output .^(%cx input)) (fray input))]

15
main/bin/rm.hoon Normal file
View File

@ -0,0 +1,15 @@
!: :: /=main=/bin/rm/hoon
!? 164
::::
|= *
|= files=(list path)
^- bowl
::::
:_ ~
=+ cag=(turn files fray)
?~ cag ~
:_ ~
:- %ok
|- ^- toro
?~ t.cag i.cag
(furl i.t.cag $(t.cag t.t.cag))