mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
Merge branch 'newbreach' of github.com:urbit/urbit into newbreach
Conflicts: urb/zod/arvo/hoon.hoon
This commit is contained in:
commit
67bc1d59da
@ -1545,7 +1545,7 @@
|
||||
:_ fox
|
||||
:~ :+ [~ %iron p.p.bon]
|
||||
(claw p.p.bon)
|
||||
`card`[%wart q.p.bon i.t.q.q.bon t.t.q.q.bon r.bon]
|
||||
`card`[%wart p.bon i.t.q.q.bon t.t.q.q.bon r.bon]
|
||||
==
|
||||
::
|
||||
%pi :: ping
|
||||
@ -1554,7 +1554,7 @@
|
||||
?(%pr %pc) :: %pr, %pc
|
||||
:_ fox
|
||||
:~ :- [~ %iron p.p.bon]
|
||||
[[/e hen] `card`[%wart q.p.bon i.t.q.q.bon t.t.q.q.bon r.bon]]
|
||||
[[/e hen] `card`[%wart p.bon i.t.q.q.bon t.t.q.q.bon r.bon]]
|
||||
==
|
||||
::
|
||||
%ta
|
||||
@ -1570,7 +1570,7 @@
|
||||
%re :: %re
|
||||
:_ fox
|
||||
:~ :- [~ %iron p.p.bon]
|
||||
[[/c hen] `card`[%wart q.p.bon i.t.q.q.bon t.t.q.q.bon r.bon]]
|
||||
[[/c hen] `card`[%wart p.bon i.t.q.q.bon t.t.q.q.bon r.bon]]
|
||||
==
|
||||
::
|
||||
%ye :: %ye
|
||||
|
@ -220,10 +220,10 @@
|
||||
=+(a=(lead tea hen) abet:(gall:q.a p.a rot))
|
||||
::
|
||||
++ lion :: lion:be
|
||||
|= [hen=duct him=@p cak=@tas sic=path val=*] :: handle request
|
||||
|= [hen=duct soc=sock cak=@tas sic=path val=*] :: handle request
|
||||
^- [(list move) brat]
|
||||
=+ yes=(~(get by sev) cak)
|
||||
?~ yes (leon hen him cak sic val)
|
||||
?~ yes (leon hen q.soc cak sic val)
|
||||
=+ sey=(~(tap by u.yes) *(list ,[p=@ud q=@ud r=wire]))
|
||||
|- ^- [(list move) brat]
|
||||
?~ sey [~ +<.^^^$]
|
||||
@ -233,7 +233,7 @@
|
||||
=< abet
|
||||
=< abet
|
||||
%- pong:(ox:(past:(fest p.i.sey hen) q.i.sey) r.i.sey)
|
||||
[%wart him cak sic val]
|
||||
[%wart soc cak sic val]
|
||||
=^ vun +<.^^^$ $(sey t.sey)
|
||||
[(weld von vun) +<.^^^$]
|
||||
::
|
||||
@ -694,7 +694,7 @@
|
||||
::
|
||||
++ gull :: request control
|
||||
|= [tea=wire him=ship ryf=riff]
|
||||
(gram ~[/c [%b tea]] [%warp him ryf])
|
||||
(gram ~[/c [%b tea]] [%warp [who him] ryf])
|
||||
::
|
||||
++ gulf :: stop request
|
||||
|= [tea=wire kit=kite]
|
||||
@ -917,7 +917,7 @@
|
||||
::
|
||||
%lq
|
||||
?> ?=(%wart -.fav)
|
||||
+>.$(+>.$ (glib lap [%lq p.fav r.fav s.fav]))
|
||||
+>.$(+>.$ (glib lap [%lq q.p.fav r.fav s.fav]))
|
||||
::
|
||||
%rt
|
||||
?: ?=(%went -.fav)
|
||||
|
@ -384,7 +384,8 @@
|
||||
%init
|
||||
:: [[%tell %0 %leaf "clay: home for {~(rend co ~ %p q.u.wru)}"] ~]
|
||||
?> ?=(^ wru)
|
||||
[~ ..^$(fat.ruf (~(put by fat.ruf) q.u.wru [hen ~ ~ ~]))]
|
||||
?> =(q.u.wru p.fav)
|
||||
[~ ..^$(fat.ruf (~(put by fat.ruf) p.fav [hen ~ ~ ~]))]
|
||||
::
|
||||
?(%info %into)
|
||||
=. wru
|
||||
@ -404,7 +405,6 @@
|
||||
::
|
||||
%waft
|
||||
?> ?=([@ @ ~] tea)
|
||||
?> ?=(^ wru)
|
||||
=+ syd=(need (slaw %tas i.tea))
|
||||
=+ inx=(need (slaw %ud i.t.tea))
|
||||
=^ mos ruf
|
||||
@ -416,25 +416,23 @@
|
||||
[mos ..^$]
|
||||
::
|
||||
%warp
|
||||
?> ?=(^ wru)
|
||||
=^ mos ruf
|
||||
=< abet
|
||||
=+ une=(un q.u.wru now ruf)
|
||||
=+ une=(un p.p.fav now ruf)
|
||||
:: ~& [%clay-warp q.u.wru fav]
|
||||
=+ wex=?.(=(q.u.wru p.fav) (do:une p.fav p.q.fav) (di:une p.q.fav))
|
||||
=+ wex=?.(=(p.p.fav q.p.fav) (do:une q.p.fav p.q.fav) (di:une p.q.fav))
|
||||
?~ q.q.fav
|
||||
abet:(ease:wex hen)
|
||||
abet:(eave:wex hen u.q.q.fav)
|
||||
[mos ..^$]
|
||||
::
|
||||
%wart
|
||||
?> ?=(^ wru)
|
||||
?> ?=(%re q.fav)
|
||||
=+ ryf=((hard riff) s.fav)
|
||||
:_ ..^$
|
||||
:~ :+ [~ %iron q.u.wru]
|
||||
[/c [%c (scot %p p.fav) r.fav] hen]
|
||||
`card`[%warp q.u.wru ryf]
|
||||
:~ :+ [~ %iron p.p.fav]
|
||||
[/c [%c (scot %p q.p.fav) r.fav] hen]
|
||||
`card`[%warp [p.p.fav p.p.fav] ryf]
|
||||
==
|
||||
::
|
||||
%writ
|
||||
|
@ -280,8 +280,8 @@
|
||||
~& [%strange-wart p.fav q.fav]
|
||||
+.$
|
||||
::
|
||||
%pr (hare r.fav p.fav s.fav)
|
||||
%pc (here q.u.wru p.fav s.fav)
|
||||
%pr (hare r.fav q.p.fav s.fav)
|
||||
%pc (here p.p.fav q.p.fav s.fav)
|
||||
==
|
||||
::
|
||||
%waft
|
||||
@ -417,7 +417,7 @@
|
||||
:_ mow
|
||||
:+ [~ %gold our]
|
||||
[/c [%e %hoot ses (scot %ud num) ~] hen]
|
||||
[%warp our rif]
|
||||
[%warp [our our] rif]
|
||||
==
|
||||
::
|
||||
++ hone :: kill ford
|
||||
|
@ -165,7 +165,7 @@
|
||||
mow :_ mow
|
||||
:+ [~ %iron our]
|
||||
[/c [%f (scot %ud num) (scot %ud p.i.kiz) ~] hen]
|
||||
[%warp p.q.i.kiz q.q.i.kiz ~]
|
||||
[%warp [our p.q.i.kiz] q.q.i.kiz ~]
|
||||
==
|
||||
::
|
||||
++ camp :: request a file
|
||||
@ -179,7 +179,7 @@
|
||||
mow :_ mow
|
||||
:+ [~ %iron our]
|
||||
[/c [%f (scot %ud num) (scot %ud tik) ~] hen]
|
||||
[%warp p.bem q.bem [~ %& %x r.bem s.bem]]
|
||||
[%warp [our p.bem] q.bem [~ %& %x r.bem s.bem]]
|
||||
==
|
||||
::
|
||||
++ clef :: cache a result
|
||||
|
357
arvo/gall.hoon
357
arvo/gall.hoon
@ -4,96 +4,327 @@
|
||||
|= pit=vase
|
||||
^- vane
|
||||
=> =~
|
||||
|% :: structures
|
||||
|% :: clams
|
||||
++ axle :: all %gall state
|
||||
$: ven=%0 ::
|
||||
own=(map ship mast) :: apps by ship
|
||||
pol=(map ship mast) :: apps by ship
|
||||
== ::
|
||||
++ bone ,@ud :: opaque duct
|
||||
++ crow ,[p=bone q=hawk] ::
|
||||
++ gaff :: hive product
|
||||
|* a=$+(* *) ::
|
||||
$% [%call p=term q=a] :: advance card
|
||||
[%drip p=a] :: return card
|
||||
[%stop ~] :: reset duct
|
||||
== ::
|
||||
++ seat :: living app
|
||||
$: hiv=vase :: the hive
|
||||
$: huv=(unit vase) :: current hive
|
||||
dep=(set beak) :: dependencies
|
||||
orm=(unit ,@da) :: requested at
|
||||
eny=@ :: entropy
|
||||
now=@da :: hive time
|
||||
tik=@ud :: pokes computed
|
||||
zud=bone :: opaque duct
|
||||
zos=(map bone hen) :: duct table
|
||||
wok=(unit ,@ud) :: awaiting / next
|
||||
vey=(qeu ,[p=@da q=move]) :: blocked queue
|
||||
lat=@da :: time of last tick
|
||||
tik=@ud :: tick computed
|
||||
zos=(map bone ,[p=nave q=duct]) :: bone to duct
|
||||
zam=[p=@ud q=(map duct ,@ud)] :: duct to bone
|
||||
vey=(qeu ,[p=bone q=path r=vase]) :: blocked queue
|
||||
== ::
|
||||
++ mast :: apps by ship
|
||||
$: bus=(map term seat) :: apps by name
|
||||
$: bum=(map term seat) :: apps by name
|
||||
== ::
|
||||
++ hawk ::
|
||||
$% [%call p=bone q=wire r=card] :: advance card
|
||||
[%give p=bone q=card] :: produce card
|
||||
[%play p=bone q=card] :: revisit card
|
||||
[%lose p=bone] :: tear down duct
|
||||
++ mitt :: execution context
|
||||
$: $: bun=bone :: source
|
||||
pax=path :: hivepath
|
||||
god=nave :: rights
|
||||
== ::
|
||||
++ wren :: waiting card
|
||||
$: tig=mitt :: context
|
||||
fav=card :: content
|
||||
== ::
|
||||
-- ::
|
||||
|% :: implicit clams
|
||||
++ cork ?(%u %v %w %x %y %z) :: view angle
|
||||
++ hawk (gaff card) ::
|
||||
++ hide :: engine state
|
||||
$: own=[p=ship q=@tas] :: static identity
|
||||
bec=beak :: installation path
|
||||
^= seq :: dynamic sequence
|
||||
$: num=@ud :: change number
|
||||
eny=@ :: entropy
|
||||
now=@da :: date
|
||||
lat=@da :: date of last tick
|
||||
== == ::
|
||||
++ hive :: typed engine
|
||||
$_ ^? ::
|
||||
|_ hide ::
|
||||
++ pack vase :: save as bag
|
||||
++ poke :: apply
|
||||
|+ $: kyz=(unit (set keel)) :: authorizers
|
||||
tea=wire :: internal position
|
||||
fav=card :: present event
|
||||
== ::
|
||||
[*(list hawk) +>] :: effects
|
||||
++ peek :: view
|
||||
|+ $: kyz=(unit (set keel)) :: inspectors
|
||||
asp=? :: desired aspect
|
||||
tea=wire :: internal position
|
||||
== ::
|
||||
[*?(%view %diff) *vase] ::
|
||||
++ prep :: restore from bag
|
||||
|+ bux=vase ::
|
||||
+> ::
|
||||
|_ hide :: hive state
|
||||
++ pack * :: save
|
||||
++ poke |+(lima [*(list ,[p=bone q=hawk]) +>]) :: do
|
||||
++ peek |+(lira *(unit (unit luge))) :: see
|
||||
++ prep |+(* +>) :: load
|
||||
== ::
|
||||
--
|
||||
|%
|
||||
++ ye :: per event
|
||||
=| $: $: $: wru=(unit writ) :: event authority
|
||||
tea=wire :: event place
|
||||
hen=duct :: event floor
|
||||
fav=card :: event data
|
||||
== ::
|
||||
$: now=@da :: event date
|
||||
eny=@ :: unique entropy
|
||||
ska=$+(* (unit (unit))) :: system namespace
|
||||
== ::
|
||||
mow=(list move) :: pending actions
|
||||
== ::
|
||||
axle :: all vane state
|
||||
++ lima :: wren other side
|
||||
$: $: bun=bone :: source
|
||||
god=nave :: permissions
|
||||
pax=path :: logical position
|
||||
==
|
||||
fav=* :: present event
|
||||
== ::
|
||||
++ lira :: general query
|
||||
$: use=(set monk) :: inspectors
|
||||
roc=cork :: desired aspect
|
||||
pax=path :: internal path
|
||||
== ::
|
||||
-- ::
|
||||
|% ::
|
||||
++ ho :: per card
|
||||
=| $: bun=bone :: opaque cause
|
||||
hen=duct :: kernel cause
|
||||
god=nave :: rights
|
||||
mow=(list move) :: direct moves
|
||||
now=@da :: current date
|
||||
eny=@ :: current entropy
|
||||
our=@p :: ship
|
||||
app=@tas :: application name
|
||||
sat=seat :: application state
|
||||
== ::
|
||||
=* lex ->
|
||||
|%
|
||||
++ abet
|
||||
^- [(list move) axle]
|
||||
[(flop mow) lex]
|
||||
^- [(list move) seat]
|
||||
[(flop mow) sat]
|
||||
::
|
||||
++ apex :: execute card
|
||||
|= rew=wren
|
||||
?~ pax.rew
|
||||
(babe rew)
|
||||
=+ tem=i.pax.rew
|
||||
=. pax.rew t.pax.rew
|
||||
?+ tem !!
|
||||
%used (babe rew)
|
||||
%boot (boot rew)
|
||||
%poke (poke rew)
|
||||
==
|
||||
::
|
||||
++ babe :: poke or wait
|
||||
|= [pax=path fav=card]
|
||||
?~ huv.sat
|
||||
(bait pax fav)
|
||||
%= +>
|
||||
huv.sat ~
|
||||
=+ gat=(slap u.huv.sat [%cnzy %poke])
|
||||
=+ sam=:(slop !>(god) !>(pax) cav)
|
||||
=+
|
||||
::
|
||||
++ boot :: boot result
|
||||
|= rew=wren
|
||||
?> ?=(%made -.fav.rew)
|
||||
?- -.p.fav.rew
|
||||
| (drip [%crud %gall p.p.fav])
|
||||
& (dear p.fav q.q.fav)
|
||||
==
|
||||
::
|
||||
++ poke :: poke result
|
||||
|= rew=wren
|
||||
?> ?=(%made -.fav.rew)
|
||||
?- -.p.fav.rew
|
||||
| (drip [%crud %gall p.p.fav])
|
||||
& (pone q.q.p.fav)
|
||||
==
|
||||
::
|
||||
++ pone :: poke product
|
||||
|= vax=vase
|
||||
^+ +>
|
||||
?~ q.vax +>
|
||||
=+ hed=(slot 2 vax)
|
||||
=. +>.$ (poof (slot 2 vax))
|
||||
$(vax (slot 3 vax))
|
||||
::
|
||||
++ poof :: apply effect
|
||||
|= vax=vase
|
||||
=+ nab=(,@ q:(slot 2 vax))
|
||||
|
||||
::
|
||||
++ puss :: poke gaff
|
||||
|= vax=vase
|
||||
=. vax (spec vax)
|
||||
?+ -.q.vax !!
|
||||
%call
|
||||
=+ ney=`@tas`(sane %tas ((hard ,@) q:(slot 6 vax)))
|
||||
=+ cav=(quod (slot 7 vax))
|
||||
(call
|
||||
|
||||
|
||||
%drip
|
||||
%stop
|
||||
==
|
||||
::
|
||||
++ quod :: typecheck hive
|
||||
|= vax=vase
|
||||
vax :: XX
|
||||
::
|
||||
?: ?=([%boot *] pax)
|
||||
?> ?=(%made -.fav)
|
||||
?- -.p.fav
|
||||
| (drip [%crud %gall p.p.fav])
|
||||
& (dear p.fav q.fav)
|
||||
==
|
||||
?> ?=([%
|
||||
==
|
||||
::
|
||||
++ axon
|
||||
[
|
||||
::
|
||||
++ kick :: run engine
|
||||
|- ^+ +
|
||||
?~ vey.sat +.$
|
||||
?~ huv.sat +.$
|
||||
=^ lef vey.sat ~(get to vey.sat)
|
||||
|
||||
=^
|
||||
|
||||
++ blam :: block on slam
|
||||
|= [cod=@tas gat=vase sam=vase]
|
||||
^+ +>
|
||||
|
||||
++ dear :: reset
|
||||
|= [dep=(set beam) cay=cage]
|
||||
?> ?=(~ huv.sat)
|
||||
more(huv.sat [~ q.p.cay])
|
||||
::
|
||||
++ call :: advance a card
|
||||
|= [vay=term
|
||||
::
|
||||
++ drip :: return a card
|
||||
|= fav=card
|
||||
^+ +>
|
||||
+>(mow :_(mow [[~ %iron our] hen fav]))
|
||||
::
|
||||
++ spec :: specialize kelp
|
||||
|= vax=vase
|
||||
^- vase
|
||||
?. &(?=(^ q.vax) ?=(@ -.q.vax))
|
||||
vax
|
||||
%+ slap vax
|
||||
^- twig
|
||||
:+ %wtgr
|
||||
[%wtts [%dtzz %tas -.q.vax] [%$ 2]]
|
||||
[%$ 1]
|
||||
::
|
||||
++ poke :: poke the vase
|
||||
|= rew=wren
|
||||
=+
|
||||
::
|
||||
++ more
|
||||
|- ^+ +
|
||||
?> ?=(^ huv.sat)
|
||||
?~ vey.sat +.$
|
||||
=^ lef vey.sat ~(get to vey.sat)
|
||||
::
|
||||
++ axon :: advancing card
|
||||
|= fav=card
|
||||
?~ huv.sat :: if blocked
|
||||
(bait pax cav)
|
||||
?~ pax :: call, essentially
|
||||
=+ ^= sam
|
||||
;: slop
|
||||
!>(god)
|
||||
==
|
||||
=+ gat=(slap u.huv.sat [%cnzy %poke])
|
||||
!!
|
||||
::
|
||||
::
|
||||
++ bait :: boot/wait
|
||||
|= [pax=path cav=vase]
|
||||
^+ +>
|
||||
?> ?=(~ huv.sat)
|
||||
=+ new==(~ vey.sat)
|
||||
=. vey.sat (~(put to vey.sat) `wren
|
||||
?: =(~ vey.sat)
|
||||
::
|
||||
++ boob ::
|
||||
::
|
||||
++ boot :: send boot
|
||||
^+ .
|
||||
(dyke %boot %boil %core [(scot %p our) %main (scot %da now) %app ~])
|
||||
::
|
||||
++ dyke :: send to compute
|
||||
|= [pan=@tas kas=silk]
|
||||
^+ +>
|
||||
%= +> mow :_ mow
|
||||
^- move
|
||||
:+ [~ %iron our]
|
||||
^- duct
|
||||
[/f [/g (scot %p our) app pan ~]
|
||||
^- card
|
||||
[%exec kas]
|
||||
==
|
||||
::
|
||||
++ feed
|
||||
|=
|
||||
|
||||
--
|
||||
--
|
||||
. ==
|
||||
=| axle
|
||||
=* lex -
|
||||
|= [now=@da eny=@ sky=$+(* (unit))] :: activate
|
||||
|= [now=@da eny=@ ska=$+(* (unit (unit)))] :: activate
|
||||
^? :: opaque core
|
||||
|% ::
|
||||
++ beat :: process move
|
||||
|= [wru=(unit writ) tea=wire hen=duct fav=curd]
|
||||
=> .(fav ((hard card) fav))
|
||||
|= [wru=(unit writ) tea=wire hen=duct fav=card]
|
||||
^- [p=(list move) q=vane]
|
||||
?> ?=(
|
||||
=+ ^= kul ^- (unit keel)
|
||||
?: |(?=(%
|
||||
=+ ^= def
|
||||
|. ^- seat
|
||||
%* . *seat
|
||||
eny (shax (mix now eny))
|
||||
lat now
|
||||
==
|
||||
=^ mos lex
|
||||
abet:apex:~(adit ye [[wru tea hen fav] [now eny sky] ~] lex)
|
||||
[mos ..^$]
|
||||
?: =(~ tea)
|
||||
?. ?=(%mean -.fav) ~|(%gall-what !!)
|
||||
=+ ^= mat ^- mast
|
||||
=+ mat=(~(get by pol.lex) p.fav)
|
||||
?~(mat *mast u.mat)
|
||||
=+ ^= sat ^- seat
|
||||
=+ sat=(~(get by bum.mat) q.fav)
|
||||
?~(sat *def u.sat)
|
||||
=^ bun sat
|
||||
^- [bone seat]
|
||||
=+ byn=(~(get by zam.sat) hen)
|
||||
?^ byn u.byn
|
||||
[p.zam.sat sat(p.zam +(p.zam), q.zam (~(put by q.sam) hen p.zam.sat)]
|
||||
=+ ^= tox
|
||||
:* bun
|
||||
now
|
||||
eny
|
||||
r.fav
|
||||
*(list move)
|
||||
p.fav
|
||||
q.fav
|
||||
sat
|
||||
==
|
||||
=^ mos sat abet:(~(axon za tox) fav)
|
||||
:- mos
|
||||
%= lex
|
||||
pol (~(put by pol.lex) p.fav mat(bum (~(put by bum.mat) q.fav sat)))
|
||||
==
|
||||
?> ?=([@ @ *] tea)
|
||||
=+ [our=(need (slaw %p i.tea)) app=(need (slaw %tas i.t.tea))]
|
||||
=+ mat=(need (~(get by pol.lex) our))
|
||||
=+ sat=(need (~(get by bum.mat) app))
|
||||
=+ bun=(need (~(get by q.zam.sat) hen))
|
||||
=+ god=p:(need (~(get by zos.sat) bun))
|
||||
=+ ^= tox
|
||||
:* bun
|
||||
now
|
||||
eny
|
||||
god
|
||||
*(list move)
|
||||
our
|
||||
app
|
||||
sat
|
||||
==
|
||||
=^ mos sat abet:(~(axon za tox) t.t.tea fav)
|
||||
:- mos
|
||||
lex(pol (~(put by pol.lex) p.fav mat(bum (~(put by bum.mat) q.fav sat))))
|
||||
==
|
||||
[`(list move)`mos ..^$]
|
||||
::
|
||||
++ come
|
||||
|= [sam=? old=vase]
|
||||
@ -109,7 +340,7 @@
|
||||
|= old=vase
|
||||
^- vane
|
||||
?. (~(nest ut -:!>(`axle`+>-.^$)) | p.old)
|
||||
~& %eyre-reset
|
||||
~& %ford-reset
|
||||
..^$
|
||||
..^$(+>- (axle q.old))
|
||||
::
|
||||
@ -118,8 +349,8 @@
|
||||
..$(+>- *axle)
|
||||
::
|
||||
++ scry
|
||||
|= [our=ship ren=@tas who=ship syd=disc lot=coin tyl=path]
|
||||
^- (unit)
|
||||
|= [our=ship ren=@tas who=ship syd=desk lot=coin tyl=path]
|
||||
^- (unit (unit))
|
||||
~
|
||||
::
|
||||
++ stay
|
||||
|
@ -2148,7 +2148,11 @@
|
||||
++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah))))
|
||||
++ gaq ;~(pose (just `@`10) ;~(plug gah ;~(pose gah vul)) vul)
|
||||
++ gay ;~(pose gap (easy ~))
|
||||
++ vul (cold ~ ;~(plug col col (star (shim 32 126)) (just ^-(@ 10))))
|
||||
++ vul %- cold :- ~
|
||||
;~ plug col col
|
||||
(star ;~(pose (shim 32 126) (shim 128 255)))
|
||||
(just `@`10)
|
||||
==
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 2eH, parsing (idioms) ::
|
||||
::
|
||||
@ -2260,6 +2264,7 @@
|
||||
=+ cur=(cut 3 [inx 1] b)
|
||||
?& ?| &((gte cur 'a') (lte cur 'z'))
|
||||
&(=('-' cur) !=(0 inx) !=(len inx))
|
||||
&(&((gte cur '0') (lte cur '9')) !=(0 inx))
|
||||
==
|
||||
$(inx +(inx))
|
||||
==
|
||||
@ -2269,6 +2274,7 @@
|
||||
=+ cur=(cut 3 [inx 1] b)
|
||||
?& ?| &((gte cur 'a') (lte cur 'z'))
|
||||
&((gte cur 'A') (lte cur 'Z'))
|
||||
&(&((gte cur '0') (lte cur '9')) !=(0 inx))
|
||||
|(=('-' cur) =('~' cur) =('_' cur) =('.' cur))
|
||||
==
|
||||
$(inx +(inx))
|
||||
@ -3722,7 +3728,7 @@
|
||||
(mink [[-.gat [sam +>.gat]] -.gat] sky)
|
||||
::
|
||||
++ mule :: typed virtual
|
||||
~\ %mule
|
||||
~/ %mule
|
||||
|* taq=_|.(_*)
|
||||
=+ mud=(mute taq)
|
||||
?- -.mud
|
||||
|
118
arvo/zuse.hoon
118
arvo/zuse.hoon
@ -231,6 +231,122 @@
|
||||
?. &(?=(^ tin) =(key p.u.tin) =(msg q.u.tin))
|
||||
~|(%test-fail-seal !!)
|
||||
msg
|
||||
::
|
||||
++ crub !: :: cryptosuite B (Ed)
|
||||
^- acru
|
||||
=| [puc=pass sed=ring]
|
||||
=> |%
|
||||
++ 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] ~)
|
||||
--
|
||||
|%
|
||||
++ as
|
||||
=> |%
|
||||
++ haul :: revealing haul
|
||||
|= a=pass
|
||||
!!
|
||||
--
|
||||
^?
|
||||
|% ++ seal
|
||||
|= [a=pass b=@ c=@]
|
||||
^- @
|
||||
!!
|
||||
++ sign
|
||||
|= [a=@ b=@] ^- @
|
||||
!!
|
||||
++ sure
|
||||
|= [a=@ b=@]
|
||||
^- (unit ,@)
|
||||
!!
|
||||
++ tear
|
||||
|= [a=pass b=@]
|
||||
^- (unit ,[p=@ q=@])
|
||||
!!
|
||||
--
|
||||
::
|
||||
++ de
|
||||
|+ [key=@ cep=@] ^- (unit ,@)
|
||||
!!
|
||||
::
|
||||
++ dy
|
||||
|+ [a=@ b=@] ^- @
|
||||
!!
|
||||
++ en
|
||||
|+ [key=@ msg=@] ^- @ux
|
||||
!!
|
||||
::
|
||||
++ ex ^?
|
||||
|% ++ fig ^- @uvH (shaf %bfig puc)
|
||||
++ pac ^- @uvG (end 6 1 (shaf %acod sec))
|
||||
++ pub ^- pass (cat 3 'b' puc)
|
||||
++ sec ^- ring sed
|
||||
--
|
||||
::
|
||||
++ nu
|
||||
^?
|
||||
|% ++ com
|
||||
|= a=@
|
||||
^+ ^?(..nu)
|
||||
!!
|
||||
::
|
||||
++ pit
|
||||
|= [a=@ b=@]
|
||||
^+ ^?(..nu)
|
||||
!!
|
||||
::
|
||||
++ nol
|
||||
|= a=@
|
||||
^+ ^?(..nu)
|
||||
!!
|
||||
--
|
||||
--
|
||||
++ brew :: create keypair
|
||||
|= [a=@ b=@] :: width seed
|
||||
^- acru
|
||||
(pit:nu:crub a b)
|
||||
::
|
||||
++ hail :: activate public key
|
||||
|= a=pass
|
||||
^- acru
|
||||
=+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
|
||||
?> =('b' mag)
|
||||
(com:nu:crub bod)
|
||||
::
|
||||
++ wear :: activate secret key
|
||||
|= a=ring
|
||||
^- acru
|
||||
=+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
|
||||
?> =('b' mag)
|
||||
(nol:nu:crub bod)
|
||||
::
|
||||
++ trub :: test ed
|
||||
|= msg=@tas
|
||||
^- @
|
||||
=+ ali=(brew 1.024 (shax 'ali'))
|
||||
=+ bob=(brew 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, UTC :: Gregorian only
|
||||
::
|
||||
@ -1283,7 +1399,7 @@
|
||||
;~ pose :: proper query
|
||||
%+ more
|
||||
;~(pose pam sem)
|
||||
;~(plug fque ;~(pfix tis fquu))
|
||||
;~(plug fque ;~(pose ;~(pfix tis fquu) (easy '')))
|
||||
::
|
||||
%+ cook :: funky query
|
||||
|=(a=tape [[%$ (crip a)] ~])
|
||||
|
@ -6,7 +6,7 @@
|
||||
:_ ~
|
||||
:_ ~
|
||||
^- gift
|
||||
:+ %mu [%atom %t]
|
||||
:- %te
|
||||
=- |- ^- (list ,@t)
|
||||
?~(foz ~ (weld i.foz $(foz t.foz)))
|
||||
^= foz
|
||||
|
@ -33,6 +33,7 @@
|
||||
;~ pose
|
||||
(stag %do ;~(pfix pat text))
|
||||
(stag %ex ;~(pfix hax expn))
|
||||
(stag %do (full (easy '')))
|
||||
(stag %qu text)
|
||||
==
|
||||
++ text (boss 256 (star ;~(pose (shim 32 126) (shim 128 255))))
|
||||
@ -43,7 +44,7 @@
|
||||
^- tank
|
||||
?- -.dum
|
||||
%do =+ msg=?:(=(0 p.dum) "remains quietly present" (trip p.dum))
|
||||
[%leaf "{chr}{nym} {(trip p.dum)}"]
|
||||
[%leaf "{chr}{nym} {msg}"]
|
||||
%ex [%rose [" " "" ""] [%leaf "{chr}{nym} {(trip p.dum)}"] q.dum ~]
|
||||
%qu [%leaf "{chr}{nym}: {(trip p.dum)}"]
|
||||
==
|
||||
@ -169,7 +170,6 @@
|
||||
++ toke :: user action
|
||||
|= txt=@t
|
||||
^+ +>
|
||||
?: =(0 txt) +>
|
||||
=+ rey=(rush txt chat)
|
||||
?~ rey
|
||||
(show %leaf "invalid input")
|
||||
|
@ -92,6 +92,18 @@
|
||||
(wcat ;~(plug ;~(plug pam hax ;~(sfix (plus nud) sem)) (easy ";")))
|
||||
inlt
|
||||
==
|
||||
;~ mcat
|
||||
%- wcat
|
||||
;~ plug
|
||||
;~ plug
|
||||
pam hax
|
||||
;~(pose (just 'x') (just 'X'))
|
||||
;~(sfix (plus ;~(pose nud low hig)) sem)
|
||||
==
|
||||
(easy ";")
|
||||
==
|
||||
inlt
|
||||
==
|
||||
;~ mcat
|
||||
(wcat ;~(plug ;~(plug pam ;~(sfix (plus alf) sem)) (easy ";")))
|
||||
inlt
|
||||
|
Loading…
Reference in New Issue
Block a user