mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-21 23:47:35 +03:00
Merge branch 'master' of github.com:urbit/urbit
Conflicts: urb/zod/arvo/eyre.hoon urb/zod/arvo/hoon.hoon
This commit is contained in:
commit
2676054930
@ -61,7 +61,7 @@
|
||||
^- (unit hole)
|
||||
=+ ^= cok ^- (list ,@t)
|
||||
=+ cok=(~(get by mah) 'cookie')
|
||||
?~(cok ~ u.cok)
|
||||
?~(cok ~ u.cok)
|
||||
|- ^- (unit hole)
|
||||
?~ cok ~
|
||||
=+ mar=`(unit (list ,[p=@t q=@t]))`(rush i.cok cock:epur)
|
||||
@ -97,14 +97,14 @@
|
||||
~[content-type/'text/plain']
|
||||
:- ~
|
||||
%- tell
|
||||
|- ^- wall
|
||||
?~ q.luv ~
|
||||
|- ^- wall
|
||||
?~ q.luv ~
|
||||
(weld (~(win re i.q.luv) 0 120) $(q.luv t.q.luv))
|
||||
==
|
||||
--
|
||||
|% :: functions
|
||||
++ ye :: per event
|
||||
=| $: $: $: wru=(unit writ) :: event authority
|
||||
=| $: $: $: wru=(unit writ) :: event authority
|
||||
tea=wire :: event place
|
||||
hen=duct :: event floor
|
||||
fav=card :: event data
|
||||
@ -112,7 +112,7 @@
|
||||
$: now=@da :: event date
|
||||
eny=@ :: unique entropy
|
||||
sky=$+(* (unit)) :: system namespace
|
||||
== ::
|
||||
== ::
|
||||
mow=(list move) :: pending actions
|
||||
== ::
|
||||
bolo :: all vane state
|
||||
@ -198,7 +198,7 @@
|
||||
~& [%strange-wart p.fav q.fav]
|
||||
+.$
|
||||
::
|
||||
%pr
|
||||
%pr
|
||||
(hare r.fav p.fav s.fav)
|
||||
==
|
||||
::
|
||||
@ -317,7 +317,7 @@
|
||||
[%want him [%q %pr %e %hork mun ~] hyx]
|
||||
::
|
||||
fon
|
||||
%+ ~(put by fon) him
|
||||
%+ ~(put by fon) him
|
||||
%_ rot
|
||||
cnt +(cnt.rot)
|
||||
p.rem +(p.rem.rot)
|
||||
@ -339,7 +339,7 @@
|
||||
^- httr
|
||||
[200 ~[content-type/'text/plain'] [~ (taco rob)]]
|
||||
(fail 400 "urbit: url {<pul>} does not match a vessel")
|
||||
:*
|
||||
:*
|
||||
^= rob
|
||||
%- role
|
||||
:~ 'User-agent: *'
|
||||
@ -476,7 +476,7 @@
|
||||
|- ^- (list coin)
|
||||
?~ quy ~
|
||||
[[%$ %t p.i.quy] [%$ %t q.i.quy] $(quy t.quy)]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ foin :: version request
|
||||
|= [fur=(unit term) paw=(list ,@t) quy=quay]
|
||||
@ -520,9 +520,9 @@
|
||||
== ~
|
||||
:+ ~ ?~(fur %html u.fur)
|
||||
^- tube
|
||||
:* (scot %p our)
|
||||
i.q.u.zac
|
||||
p.u.zac
|
||||
:* (scot %p our)
|
||||
i.q.u.zac
|
||||
p.u.zac
|
||||
t.q.u.zac
|
||||
==
|
||||
|= [for=logo toe=tube]
|
||||
@ -616,11 +616,11 @@
|
||||
=+ ank=((hard ankh) u.ans)
|
||||
?~ q.ank [~ +>.$]
|
||||
=+ huc=(~(get by cah.sef) p.u.q.ank)
|
||||
?^ huc
|
||||
?^ huc
|
||||
[[~ %& u.huc] +>.$]
|
||||
=+ mud=(much pax q.u.q.ank)
|
||||
:- [~ mud]
|
||||
?: ?=(| -.mud) +>.$
|
||||
?: ?=(| -.mud) +>.$
|
||||
+>.$(cah.sef (~(put by cah.sef) p.u.q.ank p.mud))
|
||||
::
|
||||
++ lend :: load directory node
|
||||
@ -720,7 +720,7 @@
|
||||
:_ +>.$
|
||||
?: ?=(| -.mud) mud
|
||||
[%& %mid (mite -.q.p.mud) (octs +.q.p.mud)]
|
||||
::
|
||||
::
|
||||
++ loch :: validate vase
|
||||
|= [for=@tas pre=path vax=vase]
|
||||
^- [gank _+>]
|
||||
@ -788,7 +788,7 @@
|
||||
++ loud :: synthesis search
|
||||
|= [syn=? for=logo pre=path mid=path]
|
||||
^- (list ,[p=path q=path r=loco])
|
||||
=| suf=path
|
||||
=| suf=path
|
||||
|- ^- (list ,[p=path q=path r=loco])
|
||||
=+ pax=(weld pre (flop mid))
|
||||
=+ lot=(loot pax ?:(syn ~ [~ for]))
|
||||
@ -825,11 +825,11 @@
|
||||
?~ luc [~ ~ ~ ~]
|
||||
=+ mor=$(luc t.luc)
|
||||
?- -.r.i.luc
|
||||
& ?~ q.r.i.luc
|
||||
& ?~ q.r.i.luc
|
||||
[[[p.i.luc q.i.luc r.r.i.luc] p.mor] q.mor r.mor s.mor]
|
||||
:+ p.mor q.mor
|
||||
:+ p.mor q.mor
|
||||
[[[p.i.luc q.i.luc u.q.r.i.luc r.r.i.luc] r.mor] s.mor]
|
||||
| ?~ q.r.i.luc
|
||||
| ?~ q.r.i.luc
|
||||
[p.mor [[p.i.luc q.i.luc r.r.i.luc] q.mor] r.mor s.mor]
|
||||
:+ p.mor q.mor
|
||||
[r.mor [[p.i.luc q.i.luc u.q.r.i.luc r.r.i.luc] s.mor]]
|
||||
@ -897,7 +897,7 @@
|
||||
::
|
||||
%fun
|
||||
=^ syt +>.$ (lude p.som.pip q.som.pip)
|
||||
:_ +>.$
|
||||
:_ +>.$
|
||||
:- ~
|
||||
%= pip
|
||||
pez
|
||||
@ -938,6 +938,22 @@
|
||||
=+ sez=step
|
||||
?: =(rey.sez rey) sez
|
||||
$(+ sez)
|
||||
::
|
||||
++ into
|
||||
|= [pul=purl moh=moth]
|
||||
^+ +>
|
||||
=+ num=p.rey
|
||||
%= +>.$
|
||||
p.rey +(num)
|
||||
q.rey
|
||||
%+ ~(put by q.rey) num
|
||||
^- pimp
|
||||
:* !?=(%head p.moh)
|
||||
hen
|
||||
*seam
|
||||
`pest`[%raw pul moh]
|
||||
==
|
||||
==
|
||||
--
|
||||
--
|
||||
--
|
||||
@ -954,7 +970,7 @@
|
||||
[[[wru [/d hen] %flog fav] ~] ..^$]
|
||||
^- [p=(list move) q=vane]
|
||||
=. gub ?.(=(0 gub) gub (cat 3 (rsh 3 1 (scot %p (end 6 1 eny))) '-'))
|
||||
=^ mos bol
|
||||
=^ mos bol
|
||||
abet:apex:~(adit ye [[wru tea hen fav] [now eny sky] ~] bol)
|
||||
[mos ..^$]
|
||||
::
|
||||
@ -971,7 +987,7 @@
|
||||
++ load
|
||||
|= new=vase
|
||||
^- vane
|
||||
?. (~(nest ut -:!>(`bolo`+>-.^$)) | p.new)
|
||||
?. (~(nest ut -:!>(`bolo`+>-.^$)) | p.new)
|
||||
~& %eyre-reset
|
||||
..^$
|
||||
..^$(+>- (bolo q.new))
|
||||
@ -985,7 +1001,7 @@
|
||||
^- (unit)
|
||||
~
|
||||
::
|
||||
++ stay
|
||||
++ stay
|
||||
`vase`!>((colt `bolo`+>-.$))
|
||||
++ vern [164 0]
|
||||
--
|
||||
|
136
arvo/hoon.hoon
136
arvo/hoon.hoon
@ -87,9 +87,9 @@
|
||||
?@ +.b ~ ::
|
||||
:- ~ ::
|
||||
u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] ::
|
||||
++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) ::
|
||||
++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) ::
|
||||
++ line ,[p=[%leaf p=odor q=@] q=tile] :: %kelp case
|
||||
++ list |* a=_,* :: null-term list
|
||||
++ list |* a=_,* :: null-term list
|
||||
$|(~ [i=a t=(list a)]) ::
|
||||
++ mane $|(@tas [@tas @tas]) :: XML name/space
|
||||
++ mano ,[g=marx c=marl] :: normalized manx
|
||||
@ -106,9 +106,9 @@
|
||||
$|(~ [n=a l=(tree a) r=(tree a)]) ::
|
||||
++ nail ,[p=hair q=tape] :: parsing input
|
||||
++ numb ,@ :: just a number
|
||||
++ pass ,@ :: public key
|
||||
++ pass ,@ :: public key
|
||||
++ path (list span) :: filesys location
|
||||
++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range
|
||||
++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range
|
||||
++ port $: p=axis ::
|
||||
$= q ::
|
||||
$% [%& p=type] ::
|
||||
@ -135,7 +135,7 @@
|
||||
[%spot p=spot] ::
|
||||
== ::
|
||||
++ span ,@ta :: text-atom (ASCII)
|
||||
++ spot ,[p=path q=pint] :: range in file
|
||||
++ spot ,[p=path q=pint] :: range in file
|
||||
++ tank $% [%leaf p=tape] :: printing formats
|
||||
[%palm p=[p=tape q=tape r=tape s=tape] q=(list tank)]
|
||||
[%rose p=[p=tape q=tape r=tape] q=(list tank)]
|
||||
@ -202,16 +202,14 @@
|
||||
[%clsg p=tusk] :: [p ~]
|
||||
[%cltr p=tusk] :: p as a tuple
|
||||
[%clzz p=tusk] :: macro
|
||||
:: ::
|
||||
:: :::::: invocations
|
||||
:: ::
|
||||
:: :::::: invocations
|
||||
[%cncb p=wing q=tram] :: %=, then cast to p
|
||||
[%cncl p=twig q=twig] :: pull $.p w/ sample q
|
||||
[%cndt p=twig q=twig] :: %-(q p)
|
||||
[%cnhp p=twig q=tusk] :: slam p w/ sample q
|
||||
[%cntr p=wing q=twig r=tram] ::
|
||||
[%cntr p=wing q=twig r=tram] ::
|
||||
[%cnkt p=twig q=twig r=twig s=twig] :: slam p w/ %*(q r s)
|
||||
[%cnls p=twig q=twig r=twig] :: slam p w/ %*(q r)
|
||||
[%cnls p=twig q=twig r=twig] :: slam p w/ %*(q r)
|
||||
[%cnsg p=wing q=twig r=twig] :: pull p from q with r
|
||||
[%cnts p=wing q=tram] :: eval. p w/ q changes
|
||||
[%cnzy p=term] :: pulls limb p
|
||||
@ -253,7 +251,7 @@
|
||||
[%sgzp p=twig q=twig] :: type in stacktrace
|
||||
:: :: miscellaneous
|
||||
[%smcl p=twig q=tusk] :: binary to n-ary
|
||||
[%smdt p=twig q=tusk] ::
|
||||
[%smdt p=twig q=tusk] ::
|
||||
[%smdq p=(list beer)] :: assemble string
|
||||
[%smsg p=twig q=tusk] :: gonads
|
||||
[%smsm p=twig q=twig] :: make sure q is a p
|
||||
@ -335,11 +333,11 @@
|
||||
[%2 p=(list ,[@ta *])] ::
|
||||
== ::
|
||||
++ twin ,[p=term q=wing r=axis s=type] ::
|
||||
++ type $| ?(%noun %void) :: set all or set none
|
||||
++ type $| ?(%noun %void) :: set all or set none
|
||||
$% [%atom p=term] :: number and format
|
||||
[%bull p=twin q=type] :: wing synonym
|
||||
[%cell p=type q=type] :: ordered pair
|
||||
[%core p=type q=coil] ::
|
||||
[%core p=type q=coil] ::
|
||||
[%cube p=* q=type] :: constant
|
||||
[%face p=term q=type] :: name
|
||||
[%fork p=type q=type] :: union/branch
|
||||
@ -382,7 +380,7 @@
|
||||
++ vise ,[p=typo q=*] :: old vase
|
||||
++ wall (list tape) :: text lines (no \n)
|
||||
++ wain (list cord) :: text lines (no \n)
|
||||
++ wing (list limb) ::
|
||||
++ wing (list limb) ::
|
||||
++ wine $| ?(%noun %path %tank %void %wall %wool %yarn)
|
||||
$% [%atom p=term] ::
|
||||
[%core p=(list ,@ta) q=wine] ::
|
||||
@ -1290,7 +1288,7 @@
|
||||
|= yer=@ud ^- ?
|
||||
&(=(0 (mod yer 4)) |(!=(0 (mod yer 100)) =(0 (mod yer 400))))
|
||||
::
|
||||
++ yo :: time constants
|
||||
++ yo :: time constants
|
||||
|% ++ cet 36.524 :: (add 24 (mul 100 365))
|
||||
++ day 86.400 :: (mul 24 hor)
|
||||
++ era 146.097 :: (add 1 (mul 4 cet))
|
||||
@ -1885,9 +1883,9 @@
|
||||
::
|
||||
++ stet
|
||||
|* leh=(list ,[?(@ [@ @]) _rule])
|
||||
|-
|
||||
?~ leh
|
||||
~
|
||||
|-
|
||||
?~ leh
|
||||
~
|
||||
[i=[p=-.i.leh q=+.i.leh] t=$(leh t.leh)]
|
||||
::
|
||||
++ stew
|
||||
@ -2412,7 +2410,7 @@
|
||||
=('-' c)
|
||||
==
|
||||
[c d]
|
||||
?+ c
|
||||
?+ c
|
||||
:- '~'
|
||||
=+ e=(met 2 c)
|
||||
|- ^- tape
|
||||
@ -2572,10 +2570,10 @@
|
||||
++ til (boss 256 (stun [3 3] low))
|
||||
++ urs %+ cook
|
||||
|=(a=tape (rap 3 ^-((list ,@) a)))
|
||||
(star ;~(pose nud low hep dot sig cab))
|
||||
(star ;~(pose nud low hep dot sig cab))
|
||||
++ urt %+ cook
|
||||
|=(a=tape (rap 3 ^-((list ,@) a)))
|
||||
(star ;~(pose nud low hep dot sig))
|
||||
(star ;~(pose nud low hep dot sig))
|
||||
++ voy ;~(pfix bas ;~(pose bas soq bix))
|
||||
++ vym (bass 256 ;~(plug low (star ;~(pose low nud))))
|
||||
++ vyn (bass 256 ;~(plug hep vym (easy ~)))
|
||||
@ -2883,7 +2881,7 @@
|
||||
==
|
||||
++ nuck
|
||||
%+ knee *coin |. ~+
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ :- ['a' 'z'] (cook |=(a=@ta [~ %tas a]) sym)
|
||||
:- ['0' '9'] (stag ~ bisk)
|
||||
@ -4245,7 +4243,7 @@
|
||||
++ ah
|
||||
|_ tig=tiki
|
||||
++ blue
|
||||
|= gen=twig
|
||||
|= gen=twig
|
||||
^- twig
|
||||
?. &(?=(| -.tig) ?=(~ p.tig)) gen
|
||||
[%tsgr [~ 3] gen]
|
||||
@ -4543,13 +4541,13 @@
|
||||
::
|
||||
[%ktdt *] [%ktls [%cnhp p.gen q.gen ~] q.gen]
|
||||
[%kthp *] [%ktls ~(bunt al p.gen) q.gen]
|
||||
[%sgbr *]
|
||||
[%sgbr *]
|
||||
:+ %sggr
|
||||
:- %mean
|
||||
=+ fek=~(feck ap p.gen)
|
||||
?^ fek [%dtzz %tas u.fek]
|
||||
[%brdt [%cnhp [%cnzy %cain] [%zpgr p.gen] ~]]
|
||||
q.gen
|
||||
q.gen
|
||||
::
|
||||
[%sgcb *] [%sggr [%mean [%brdt p.gen]] q.gen]
|
||||
[%sgcn *]
|
||||
@ -4728,7 +4726,7 @@
|
||||
[%wtsg *] [%wtcl [%wtts [%axil %null] p.gen] q.gen r.gen]
|
||||
[%wtzp *] [%wtcl p.gen [%dtzz %f 1] [%dtzz %f 0]]
|
||||
::
|
||||
[%wthz *]
|
||||
[%wthz *]
|
||||
=+ vaw=~(. ah p.gen)
|
||||
%- gray:vaw
|
||||
[%wthp puce:vaw (turn q.gen |=([a=tile b=twig] [a (blue:vaw b)]))]
|
||||
@ -4737,7 +4735,7 @@
|
||||
=+ vaw=~(. ah p.gen)
|
||||
%- gray:vaw
|
||||
^- twig
|
||||
:+ %wtls puce:vaw
|
||||
:+ %wtls puce:vaw
|
||||
[(blue:vaw q.gen) (turn r.gen |=([a=tile b=twig] [a (blue:vaw b)]))]
|
||||
::
|
||||
[%wtsz *]
|
||||
@ -4756,14 +4754,14 @@
|
||||
[%wtpt puce:vaw (blue:vaw q.gen) (blue:vaw r.gen)]
|
||||
::
|
||||
[%zpcb *] q.gen
|
||||
[%zpgr *]
|
||||
[%zpgr *]
|
||||
[%cnhp [%cnzy %onan] [%zpsm [%bctr [%herb [%cnzy %abel]]] p.gen] ~]
|
||||
::
|
||||
[%zpwt *]
|
||||
?: ?: ?=(@ p.gen)
|
||||
(lte stub p.gen)
|
||||
&((lte stub p.p.gen) (gte stub q.p.gen))
|
||||
q.gen
|
||||
q.gen
|
||||
~|([%stub-fail stub p.gen] !!)
|
||||
::
|
||||
* gen
|
||||
@ -4867,7 +4865,7 @@
|
||||
1 [%face p.got $(got q.got)]
|
||||
2 ?> |(!vet (nest(sut [%cell %noun %noun]) & sut))
|
||||
:+ %cell
|
||||
$(got p.got, sut (peek %both 2))
|
||||
$(got p.got, sut (peek %both 2))
|
||||
$(got q.got, sut (peek %both 3))
|
||||
==
|
||||
::
|
||||
@ -4963,8 +4961,8 @@
|
||||
| (face q.i.peh ^$(peh t.peh, sut p.q.poz))
|
||||
==
|
||||
1 ^$(peh t.peh)
|
||||
2 %+ bull
|
||||
[p.p.q.poz q.p.q.poz r.p.q.poz ^$(peh t.peh, sut s.p.q.poz)]
|
||||
2 %+ bull
|
||||
[p.p.q.poz q.p.q.poz r.p.q.poz ^$(peh t.peh, sut s.p.q.poz)]
|
||||
q.q.poz
|
||||
==
|
||||
=+ [now=(cap p.poz) lat=(mas p.poz)]
|
||||
@ -5112,8 +5110,8 @@
|
||||
?. ?=(@ lum)
|
||||
~
|
||||
:+ ~
|
||||
%leaf
|
||||
?: =(%$ p.q.ham) ~(rend co [~ %ud lum])
|
||||
%leaf
|
||||
?: =(%$ p.q.ham) ~(rend co [~ %ud lum])
|
||||
?: =(%t p.q.ham) ['\'' (weld (rip 3 lum) `tape`['\'' ~])]
|
||||
?: =(%tas p.q.ham) ['%' ?.(=(0 lum) (rip 3 lum) ['$' ~])]
|
||||
~(rend co [~ p.q.ham lum])
|
||||
@ -5441,7 +5439,7 @@
|
||||
[~ p.u.q.hax %0 (fork p.q.u.q.hax p.q.u.q.yor)]
|
||||
1 ?> &(?=(1 -.q.u.q.yor) =(p.q.u.q.yor p.q.u.q.hax))
|
||||
[~ p.u.q.hax %1 p.q.u.q.hax (weld q.q.u.q.hax q.q.u.q.yor)]
|
||||
2 ?> ?& ?=(2 -.q.u.q.yor)
|
||||
2 ?> ?& ?=(2 -.q.u.q.yor)
|
||||
=(p.p.q.u.q.hax p.p.q.u.q.yor)
|
||||
=(q.p.q.u.q.hax q.p.q.u.q.yor)
|
||||
=(r.p.q.u.q.hax r.p.q.u.q.yor)
|
||||
@ -5449,9 +5447,9 @@
|
||||
:* ~
|
||||
p.u.q.hax
|
||||
%2
|
||||
:* p.p.q.u.q.hax
|
||||
q.p.q.u.q.hax
|
||||
r.p.q.u.q.hax
|
||||
:* p.p.q.u.q.hax
|
||||
q.p.q.u.q.hax
|
||||
r.p.q.u.q.hax
|
||||
(fork s.p.q.u.q.hax s.p.q.u.q.yor)
|
||||
==
|
||||
(fork q.q.u.q.hax q.q.u.q.yor)
|
||||
@ -5810,7 +5808,7 @@
|
||||
::
|
||||
[%wtts *]
|
||||
:- (nice bean)
|
||||
%- fish(sut (play ~(bunt al p.gen)))
|
||||
%- fish(sut (play ~(bunt al p.gen)))
|
||||
(cove q:$(gen [%cnzz q.gen], gol %noun))
|
||||
::
|
||||
[%zpcb *]
|
||||
@ -6161,8 +6159,8 @@
|
||||
=(p.sut p.ref)
|
||||
sint
|
||||
::
|
||||
[%bull *]
|
||||
?& dext(sut q.sut)
|
||||
[%bull *]
|
||||
?& dext(sut q.sut)
|
||||
dext(sut s.p.sut, ref (peek(sut ref) %free r.p.sut))
|
||||
==
|
||||
[%face *] dext(sut q.sut)
|
||||
@ -6634,7 +6632,7 @@
|
||||
++ fry :: mane as twig
|
||||
%+ cook
|
||||
|= [a=@tas b=(unit ,@tas)]
|
||||
?~ b
|
||||
?~ b
|
||||
[%dtzz %tas a]
|
||||
[[%dtzz %tas a] [%dtzz %tas u.b]]
|
||||
;~(plug sym ;~(pose (stag ~ ;~(pfix cab sym)) (easy ~)))
|
||||
@ -6814,7 +6812,7 @@
|
||||
::
|
||||
++ scat
|
||||
%+ knee *twig |. ~+
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~
|
||||
:- '!'
|
||||
@ -6996,7 +6994,7 @@
|
||||
++ noil
|
||||
|= tol=?
|
||||
=< ;~ pfix buc
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~
|
||||
['|' (rung bar %reed exqb)]
|
||||
@ -7024,7 +7022,7 @@
|
||||
(toad exqc)
|
||||
==
|
||||
:- ':'
|
||||
;~ pfix col
|
||||
;~ pfix col
|
||||
%+ cook
|
||||
|=(a=(list tile) ?~(a !! ?~(t.a i.a [i.a $(a t.a)])))
|
||||
(toad exqc)
|
||||
@ -7058,7 +7056,7 @@
|
||||
^. stet ^. limo
|
||||
:~ :- '|'
|
||||
;~ pfix bar
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ ['_' (rune cab %brcb expu)]
|
||||
['%' (rune cen %brcn expe)]
|
||||
@ -7074,7 +7072,7 @@
|
||||
==
|
||||
:- '%'
|
||||
;~ pfix cen
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ ['_' (rune cab %cncb exph)]
|
||||
[':' (rune col %cncl expb)]
|
||||
@ -7095,7 +7093,7 @@
|
||||
==
|
||||
:- ':'
|
||||
;~ pfix col
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ ['_' (rune cab %clcb expb)]
|
||||
:: ['~' (rune cen %clcn exps)]
|
||||
@ -7109,7 +7107,7 @@
|
||||
==
|
||||
:- '.'
|
||||
;~ pfix dot
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ ['+' (rune lus %dtls expa)]
|
||||
['*' (rune tar %dttr expb)]
|
||||
@ -7120,7 +7118,7 @@
|
||||
==
|
||||
:- '^'
|
||||
;~ pfix ket
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ ['|' (rune bar %ktbr expa)]
|
||||
['.' (rune dot %ktdt expb)]
|
||||
@ -7134,7 +7132,7 @@
|
||||
==
|
||||
:- '~'
|
||||
;~ pfix sig
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ ['|' (rune bar %sgbr expb)]
|
||||
['$' (rune buc %sgbc expg)]
|
||||
@ -7152,7 +7150,7 @@
|
||||
==
|
||||
:- ';'
|
||||
;~ pfix sem
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ [':' (rune col %smcl expi)]
|
||||
['.' (rune dot %smdt expi)]
|
||||
@ -7162,7 +7160,7 @@
|
||||
==
|
||||
:- '='
|
||||
;~ pfix tis
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ ['|' (rune bar %tsbr expo)]
|
||||
['.' (rune dot %tsdt expq)]
|
||||
@ -7178,7 +7176,7 @@
|
||||
==
|
||||
:- '?'
|
||||
;~ pfix wut
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ ['|' (rune bar %wtbr exps)]
|
||||
[':' (rune col %wtcl expc)]
|
||||
@ -7197,7 +7195,7 @@
|
||||
==
|
||||
:- '!'
|
||||
;~ pfix zap
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~ [':' ;~(pfix col (toad expz))]
|
||||
[',' (rune com %zpcm expb)]
|
||||
@ -7270,9 +7268,9 @@
|
||||
^- tiki
|
||||
?-(-.b %& [%& [~ a] p.b], %| [%| [~ a] p.b])
|
||||
=+ ^= wyp
|
||||
;~ pose
|
||||
;~ pose
|
||||
%+ cook gub
|
||||
;~ plug
|
||||
;~ plug
|
||||
sym
|
||||
;~(pfix tis ;~(pose (stag %& rope) (stag %| wide)))
|
||||
==
|
||||
@ -7287,7 +7285,7 @@
|
||||
;~ pfix
|
||||
;~(plug ket tis gap)
|
||||
%+ cook gub
|
||||
;~ plug
|
||||
;~ plug
|
||||
sym
|
||||
;~(pfix gap ;~(pose (stag %& rope) (stag %| tall)))
|
||||
==
|
||||
@ -7348,15 +7346,15 @@
|
||||
==
|
||||
==
|
||||
++ hinh |.
|
||||
;~ gunk
|
||||
;~ pose
|
||||
dem
|
||||
;~ gunk
|
||||
;~ pose
|
||||
dem
|
||||
(ifix [sel ser] ;~(plug dem ;~(pfix ace dem)))
|
||||
==
|
||||
loaf
|
||||
==
|
||||
++ bont ;~ (bend)
|
||||
;~(pfix cen sym)
|
||||
++ bont ;~ (bend)
|
||||
;~(pfix cen sym)
|
||||
;~(pfix dot ;~(pose wide ;~(pfix muck loaf)))
|
||||
==
|
||||
++ bony (cook |=(a=(list) (lent a)) (plus tis))
|
||||
@ -7445,7 +7443,7 @@
|
||||
++ howl (knee *tile |.(~+(;~(pose (noil &) toil))))
|
||||
++ toil
|
||||
%+ knee *tile |. ~+
|
||||
%- stew
|
||||
%- stew
|
||||
^. stet ^. limo
|
||||
:~
|
||||
:- '%'
|
||||
@ -7486,14 +7484,14 @@
|
||||
==
|
||||
:- '('
|
||||
(stag %herb wide)
|
||||
:- '.'
|
||||
:- '.'
|
||||
(stag %herb (stag %cnzz rope))
|
||||
:- '['
|
||||
%+ ifix [sel ser]
|
||||
%+ cook
|
||||
|= a=(list tile)
|
||||
?~(a !! ?~(t.a i.a [i.a $(a t.a)]))
|
||||
(most ace toil)
|
||||
(most ace toil)
|
||||
:- '_'
|
||||
(stag %weed ;~(pfix cab wide))
|
||||
:- ['0' '9']
|
||||
@ -7512,7 +7510,7 @@
|
||||
(stag %leaf (stag %f (cold | bar)))
|
||||
:- '~'
|
||||
(stag %leaf (stag %n (cold ~ sig)))
|
||||
==
|
||||
==
|
||||
++ wart
|
||||
|* zor=_rule
|
||||
%+ here
|
||||
@ -7791,7 +7789,7 @@
|
||||
=+ vil=(vial p.bud) ::
|
||||
=| eny=@ :: entropy
|
||||
=| fan=(list ,[p=@tas q=vase]) ::
|
||||
=| hom=path :: source path
|
||||
=| hom=path :: source path
|
||||
=| haz=@uw :: hash
|
||||
=< |%
|
||||
++ come |= [@ (list ovum) pone] :: 11
|
||||
@ -7866,7 +7864,7 @@
|
||||
~& [%vega-start hap]
|
||||
=+ src=((hard ,@t) (need (peek now cx/pax)))
|
||||
=+ saz=(shax src)
|
||||
=+ gen=(rain hap src)
|
||||
=+ gen=(rain hap src)
|
||||
~& %vega-parsed
|
||||
=+ ken=.*(0 q:(~(mint ut %noun) %noun gen))
|
||||
=+ ^= nex
|
||||
|
207
arvo/zuse.hoon
207
arvo/zuse.hoon
@ -372,6 +372,159 @@
|
||||
?~(cow ~ [~ p.pig u.cow])
|
||||
--
|
||||
--
|
||||
++ crua :: new-style crya
|
||||
:: ^- acru :: XX user must cast
|
||||
=| [mos=@ pon=(unit ,[p=@ q=@ r=[p=@ q=@] s=_*fu])]
|
||||
=> |%
|
||||
++ mx (dec (met 0 mos)) :: bit length
|
||||
++ dap :: OEAP decode
|
||||
|= [wid=@ xar=@ dog=@] ^- [p=@ q=@]
|
||||
=+ pav=(sub wid xar)
|
||||
=+ qoy=(cut 0 [xar pav] dog)
|
||||
=+ dez=(mix (end 0 xar dog) (shaw %pad-b xar qoy))
|
||||
[dez (mix qoy (shaw %pad-a pav dez))]
|
||||
::
|
||||
++ pad :: OEAP encode
|
||||
|= [wid=@ rax=[p=@ q=@] meg=@] ^- @
|
||||
=+ pav=(sub wid p.rax)
|
||||
?> (gte pav (met 0 meg))
|
||||
^- @
|
||||
=+ qoy=(mix meg (shaw %pad-a pav q.rax))
|
||||
=+ dez=(mix q.rax (shaw %pad-b p.rax qoy))
|
||||
(can 0 [p.rax dez] [pav qoy] ~)
|
||||
::
|
||||
++ pull |=(a=@ (~(exp fo mos) 3 a))
|
||||
++ push |=(a=@ (~(exp fo mos) 5 a))
|
||||
++ pump
|
||||
|= a=@ ^- @
|
||||
?~ pon !!
|
||||
(out.s.u.pon (exp.s.u.pon p.r.u.pon (sit.s.u.pon a)))
|
||||
::
|
||||
++ punt
|
||||
|= a=@ ^- @
|
||||
?~ pon !!
|
||||
(out.s.u.pon (exp.s.u.pon q.r.u.pon (sit.s.u.pon a)))
|
||||
--
|
||||
|%
|
||||
++ as
|
||||
=> |%
|
||||
++ haul
|
||||
|= a=pass
|
||||
=+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
|
||||
?> =('a' mag)
|
||||
..as(mos bod, pon ~)
|
||||
--
|
||||
^?
|
||||
|% ++ seal
|
||||
|= [a=pass b=@ c=@]
|
||||
^- @
|
||||
=+ her=(haul a)
|
||||
=+ det=(lte (add 256 (met 0 c)) mx.her)
|
||||
=+ lip=?:(det c 0)
|
||||
=- (sign *code (add ?:(p.mav 0 1) (lsh 0 1 q.mav)))
|
||||
^= mav ^- [p=? q=@]
|
||||
:- det
|
||||
=+ dog=(pad mx.her [256 b] lip)
|
||||
=+ hog=(push.her dog)
|
||||
=+ ben=(en b c)
|
||||
?:(det hog (jam hog ben))
|
||||
++ sign
|
||||
|= [a=@ b=@] ^- @
|
||||
=- (add ?:(p.mav 0 1) (lsh 0 1 q.mav))
|
||||
^= mav ^- [p=? q=@]
|
||||
=+ det=(lte (add 128 (met 0 b)) mx)
|
||||
:- det
|
||||
=+ hec=(shaf (mix %agis a) b)
|
||||
=+ dog=(pad mx [128 hec] ?:(det b 0))
|
||||
=+ hog=(pump dog)
|
||||
?:(det hog (jam hog b))
|
||||
++ sure
|
||||
|= [a=@ b=@]
|
||||
^- (unit ,@)
|
||||
=+ [det==(0 (end 0 1 b)) bod=(rsh 0 1 b)]
|
||||
=+ gox=?:(det [p=bod q=0] ((hard ,[p=@ q=@]) (cue bod)))
|
||||
=+ dog=(pull p.gox)
|
||||
=+ pig=(dap mx 128 dog)
|
||||
=+ log=?:(det q.pig q.gox)
|
||||
?.(=(p.pig (shaf (mix %agis a) log)) ~ [~ log])
|
||||
++ tear
|
||||
|= [a=pass b=@]
|
||||
^- (unit ,[p=@ q=@])
|
||||
=+ her=(haul a)
|
||||
=+ rus=(sure:as.her *code b)
|
||||
?~ rus ~
|
||||
=+ ros=u.rus
|
||||
=+ [det==(0 (end 0 1 ros)) bod=(rsh 0 1 ros)]
|
||||
=+ gox=?:(det [p=bod q=0] ((hard ,[p=@ q=@]) (cue bod)))
|
||||
=+ dog=(punt p.gox)
|
||||
=+ pig=(dap mx 256 dog)
|
||||
?: det
|
||||
[~ p.pig q.pig]
|
||||
=+ cow=(de p.pig q.gox)
|
||||
?~(cow ~ [~ p.pig u.cow])
|
||||
--
|
||||
::
|
||||
++ de
|
||||
|+ [key=@ cep=@] ^- (unit ,@)
|
||||
=+ toh=(met 8 cep)
|
||||
?: (lth toh 2)
|
||||
~
|
||||
=+ adj=(dec toh)
|
||||
=+ [hax=(end 8 1 cep) bod=(rsh 8 1 cep)]
|
||||
=+ msg=(mix (~(raw og (mix hax key)) (mul 256 adj)) bod)
|
||||
?. =(hax (shax (mix key (shax (mix adj msg)))))
|
||||
~
|
||||
[~ msg]
|
||||
::
|
||||
++ dy |+([a=@ b=@] (need (de a b)))
|
||||
++ en
|
||||
|+ [key=@ msg=@] ^- @ux
|
||||
=+ len=(met 8 msg)
|
||||
=+ adj=?:(=(0 len) 1 len)
|
||||
=+ hax=(shax (mix key (shax (mix adj msg))))
|
||||
(rap 8 hax (mix msg (~(raw og (mix hax key)) (mul 256 adj))) ~)
|
||||
::
|
||||
++ ex ^?
|
||||
|% ++ fig ^- @uvH (shaf %afig mos)
|
||||
++ pac ^- @uvG (end 6 1 (shaf %acod sec))
|
||||
++ pub ^- pass (cat 3 'a' mos)
|
||||
++ sec ^- ring ?~(pon !! (cat 3 'A' (jam p.u.pon q.u.pon)))
|
||||
--
|
||||
::
|
||||
++ nu
|
||||
=> |%
|
||||
++ elcm
|
||||
|= [a=@ b=@]
|
||||
(div (mul a b) d:(egcd a b))
|
||||
::
|
||||
++ eldm
|
||||
|= [a=@ b=@ c=@]
|
||||
(~(inv fo (elcm (dec b) (dec c))) a)
|
||||
::
|
||||
++ ersa
|
||||
|= [a=@ b=@]
|
||||
[a b [(eldm 3 a b) (eldm 5 a b)] (fu a b)]
|
||||
--
|
||||
^?
|
||||
|% ++ com
|
||||
|= a=@
|
||||
^+ ^?(..nu)
|
||||
..nu(mos a, pon ~)
|
||||
::
|
||||
++ pit
|
||||
|= [a=@ b=@]
|
||||
=+ c=(rsh 0 1 a)
|
||||
=+ [d=(ramp c [3 5 ~] b) e=(ramp c [3 5 ~] +(b))]
|
||||
^+ ^?(..nu)
|
||||
..nu(mos (mul d e), pon [~ (ersa d e)])
|
||||
::
|
||||
++ nol
|
||||
|= a=@
|
||||
^+ ^?(..nu)
|
||||
=+ b=((hard ,[p=@ q=@]) (cue a))
|
||||
..nu(mos (mul p.b q.b), pon [~ (ersa p.b q.b)])
|
||||
--
|
||||
--
|
||||
++ brew :: create keypair
|
||||
|= [a=@ b=@] :: width seed
|
||||
^- acro
|
||||
@ -405,6 +558,22 @@
|
||||
?. &(?=(^ lov) =(msg u.lov))
|
||||
~|(%test-fail-sign !!)
|
||||
msg
|
||||
::
|
||||
++ trua
|
||||
|= msg=@tas
|
||||
^- @
|
||||
=+ ali=(pit:nu:crua 1.024 (shax 'ali'))
|
||||
=+ bob=(pit:nu:crua 1.024 (shax 'bob'))
|
||||
=+ tef=(sign:as.ali [0 msg])
|
||||
=+ lov=(sure:as.ali [0 tef])
|
||||
?. &(?=(^ lov) =(msg u.lov))
|
||||
~|(%test-fail-sign !!)
|
||||
=+ key=(shax (shax (shax msg)))
|
||||
=+ sax=(seal:as.ali pub:ex.bob key msg)
|
||||
=+ tin=(tear:as.bob pub:ex.ali sax)
|
||||
?. &(?=(^ tin) =(key p.u.tin) =(msg q.u.tin))
|
||||
~|(%test-fail-seal !!)
|
||||
msg
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 3bC, JSON and XML ::
|
||||
::
|
||||
@ -1078,7 +1247,7 @@
|
||||
?: =(2 wid) %king
|
||||
?: (lte wid 4) %duke
|
||||
?: (lte wid 8) %earl
|
||||
?> (lte wid 16) %pawn
|
||||
?> (lte wid 16) %pawn
|
||||
::
|
||||
++ deft :: import url path
|
||||
|= rax=(list ,@t)
|
||||
@ -1168,7 +1337,7 @@
|
||||
|= a=coin ^- @t
|
||||
?> ?=([%$ %t @] a)
|
||||
?>(((sane %t) q.p.a) q.p.a)
|
||||
=+ ^= quy
|
||||
=+ ^= quy
|
||||
|- ^- (list ,[p=@t q=@t])
|
||||
?~ gut ~
|
||||
?> ?=(^ t.gut)
|
||||
@ -1176,10 +1345,10 @@
|
||||
?> ?=([@ @ @ ~] pre)
|
||||
%- yax
|
||||
:* quy
|
||||
(need (slaw %p i.pre))
|
||||
(need (slaw %p i.pre))
|
||||
ced
|
||||
pre
|
||||
suf
|
||||
suf
|
||||
t.but
|
||||
for
|
||||
nep
|
||||
@ -1228,7 +1397,7 @@
|
||||
tar lus com sem tis
|
||||
==
|
||||
++ ptok ;~ pose :: 2616 token
|
||||
aln zap hax buc cen pam soq tar lus
|
||||
aln zap hax buc cen pam soq tar lus
|
||||
hep dot ket cab tec bar sig
|
||||
==
|
||||
++ scem :: 2396 scheme
|
||||
@ -1707,7 +1876,7 @@
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 3bF, Arvo models ::
|
||||
::
|
||||
++ acro :: asym cryptosuite
|
||||
++ acro :: old asym cryptosuite
|
||||
$_ ^? |% :: opaque object
|
||||
++ de |+([a=@ b=@] *(unit ,@)) :: symmetric de, soft
|
||||
++ dy |+([a=@ b=@] _@) :: symmetric de, hard
|
||||
@ -1733,7 +1902,31 @@
|
||||
|% ++ sign |=([a=@ b=@] _@) :: certify
|
||||
++ tear |=(a=@ *(unit ,[p=@ q=@])) :: accept
|
||||
-- ::
|
||||
-- ::
|
||||
--
|
||||
++ acru :: asym cryptosuite
|
||||
$_ ^? |% :: opaque object
|
||||
++ as ^? :: asym ops
|
||||
|% ++ seal |=([a=pass b=@ c=@] _@) :: encrypt to a
|
||||
++ sign |=([a=@ b=@] _@) :: certify as us
|
||||
++ sure |=([a=@ b=@] *(unit ,@)) :: authenticate from us
|
||||
++ tear |=([a=pass b=@] *(unit ,[p=@ q=@])) :: accept from a
|
||||
--
|
||||
++ de |+([a=@ b=@] *(unit ,@)) :: symmetric de, soft
|
||||
++ dy |+([a=@ b=@] _@) :: symmetric de, hard
|
||||
++ en |+([a=@ b=@] _@) :: symmetric en
|
||||
++ ex ^? :: export
|
||||
|% ++ fig _@uvH :: fingerprint
|
||||
++ pac _@uvG :: default passcode
|
||||
++ pub *pass :: public key
|
||||
++ sec *ring :: private key
|
||||
--
|
||||
++ ha |+(a=pass _@) :: shared secret
|
||||
++ nu ^? :: reconstructors
|
||||
|% ++ pit |=([a=@ b=@] ^?(..nu)) :: from [width seed]
|
||||
++ nol |=(a=@ ^?(..nu)) :: from naked ring
|
||||
++ com |=(a=@ ^?(..nu)) :: from naked pass
|
||||
--
|
||||
--
|
||||
++ agon (map ,[p=ship q=disc] ,[p=@ud q=@ud]) :: mergepts our/their
|
||||
++ ankh :: fs node (new)
|
||||
$: p=cash :: recursive hash
|
||||
|
@ -27,7 +27,7 @@
|
||||
6
|
||||
--
|
||||
|%
|
||||
++ cott
|
||||
++ cott
|
||||
;~ pose
|
||||
(shim 0 8)
|
||||
(shim 11 37)
|
||||
@ -88,7 +88,7 @@
|
||||
==
|
||||
inlt
|
||||
==
|
||||
;~ mcat
|
||||
;~ mcat
|
||||
(wcat ;~(plug ;~(plug pam hax ;~(sfix (plus nud) sem)) (easy ";")))
|
||||
inlt
|
||||
==
|
||||
@ -132,7 +132,8 @@
|
||||
++ htmb
|
||||
%+ knee *tape |. ~+
|
||||
%+ cook |=(a=(list tape) (reel a |=([p=tape q=tape] (weld p q))))
|
||||
(plus (cook |=(a=tape (weld a "\0a")) ;~(sfix (plus htmc) (just '\0a'))))
|
||||
%- plus
|
||||
(cook |=(a=tape (weld a "\0a")) ;~(sfix (plus htmc) (just '\0a')))
|
||||
++ blok
|
||||
%+ knee *tape |. ~+
|
||||
%+ cook |=(a=[tape tape] (weld a))
|
||||
@ -241,7 +242,7 @@
|
||||
|= [a=@ b=@]
|
||||
%+ knee *down |. ~+
|
||||
;~ pose
|
||||
inli
|
||||
inli
|
||||
hrul
|
||||
;~(pfix (just `@`10) (lmel a b))
|
||||
==
|
||||
@ -266,7 +267,7 @@
|
||||
|= [a=@ b=@]
|
||||
%+ knee *down |. ~+
|
||||
(colk a b ;~(pfix dim:ag dot (plus whit) (lelm a +(b))))
|
||||
++ bark
|
||||
++ bark
|
||||
|= a=@
|
||||
%+ knee *down |. ~+
|
||||
;~ pose
|
||||
|
Loading…
Reference in New Issue
Block a user