mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 11:40:11 +03:00
Merge in Hoon 151
Complicated merge of Hoon 151. This commit is a major sequence point.
This commit is contained in:
commit
309805f5e7
37
app/ask.hoon
37
app/ask.hoon
@ -1,4 +1,3 @@
|
||||
:: There is no love that is not an echo
|
||||
::
|
||||
:::: /hoon/ask/app
|
||||
::
|
||||
@ -7,25 +6,25 @@
|
||||
[. sole]
|
||||
|%
|
||||
++ card
|
||||
$% [%diff %sole-effect sole-effect]
|
||||
$% {$diff $sole-effect sole-effect}
|
||||
==
|
||||
--
|
||||
!:
|
||||
|_ [bow=bowl adr=(set cord) sos=(map bone sole-share)]
|
||||
|_ {bow/bowl adr/(set cord) sos/(map bone sole-share)}
|
||||
++ peer-sole
|
||||
|= path
|
||||
^- (quip ,[bone card] +>)
|
||||
^- (quip {bone card} +>)
|
||||
~| [%not-in-whitelist src.bow]
|
||||
?> (~(has in (sa (limo ~zod our.bow ~talsur-todres ~))) src.bow)
|
||||
:_ +>.$(sos (~(put by sos) ost.bow *sole-share))
|
||||
=- [(effect %mor pro/[& %$ "<listening>"] -)]~
|
||||
=- [(effect %mor pro+[& %$ "<listening>"] -)]~
|
||||
=+ all=adrs
|
||||
[tan/(turn all message) (turn all put-mail)]
|
||||
[tan+(turn all message) (turn all put-mail)]
|
||||
::
|
||||
++ adrs (sort (~(tap by adr)) aor)
|
||||
++ effect |=(fec=sole-effect [ost.bow %diff %sole-effect fec])
|
||||
++ message |=(ask=@t leaf/"ask: {(trip ask)}")
|
||||
++ put-mail |=(ask=@t =+(pax=(rash ask unix-path) [%sav pax '']))
|
||||
++ effect |=(fec/sole-effect [ost.bow %diff %sole-effect fec])
|
||||
++ message |=(ask/@t leaf+"ask: {(trip ask)}")
|
||||
++ put-mail |=(ask/@t =+(pax=(rash ask unix-path) [%sav pax '']))
|
||||
++ unix-path :: split into path of "name" and "extension"
|
||||
;~ (glue dot)
|
||||
(cook crip (star ;~(less dot next)))
|
||||
@ -33,26 +32,26 @@
|
||||
==
|
||||
::
|
||||
++ poke-ask-mail
|
||||
|= ask=@t
|
||||
^- (quip ,[bone card] +>)
|
||||
~| have-mail/ask
|
||||
|= ask/@t
|
||||
^- (quip {bone card} +>)
|
||||
~| have-mail+ask
|
||||
?< (~(has in adr) ask)
|
||||
:_ +>.$(adr (~(put in adr) ask))
|
||||
=+ [mez=[(message ask)]~ sav=(put-mail ask)]
|
||||
%+ turn (prey /sole bow)
|
||||
|=([ost=bone ^] (effect(ost.bow ost) %mor tan/mez sav ~))
|
||||
|=({ost/bone ^} (effect(ost.bow ost) %mor tan+mez sav ~))
|
||||
::
|
||||
++ poke-sole-action
|
||||
|= act=sole-action
|
||||
^- (quip ,[bone card] +>)
|
||||
|= act/sole-action
|
||||
^- (quip {bone card} +>)
|
||||
?- -.act
|
||||
%clr `+>.$
|
||||
%ret [[(effect tan/(turn adrs message))]~ +>.$] :: re-print list
|
||||
%det :: reject all input
|
||||
$clr `+>.$
|
||||
$ret [[(effect tan+(turn adrs message))]~ +>.$] :: re-print list
|
||||
$det :: reject all input
|
||||
=+ som=(~(got by sos) ost.bow) :: XX this code belongs in a library
|
||||
=^ inv som (~(transceive sole som) +.act)
|
||||
=^ det som (~(transmit sole som) inv)
|
||||
=. sos (~(put by sos) ost.bow som)
|
||||
[[(effect det/det)]~ +>.$]
|
||||
[[(effect det+det)]~ +>.$]
|
||||
==
|
||||
--
|
||||
|
622
app/dojo.hoon
622
app/dojo.hoon
File diff suppressed because it is too large
Load Diff
@ -2,70 +2,70 @@
|
||||
:::: /hoon/hood/app :: ::
|
||||
:: :: ::
|
||||
/? 314 :: zuse version
|
||||
/+ sole, talk, helm, kiln, drum, write :: libraries
|
||||
/+ sole, talk, helm, kiln, drum ::, write :: libraries
|
||||
[. helm kiln drum]
|
||||
:: :: ::
|
||||
:::: :: ::
|
||||
!: :: ::
|
||||
=> |% :: module boilerplate
|
||||
++ hood-0 ::
|
||||
,[%0 lac=(map ,@tas hood-part)] ::
|
||||
{$0 lac/(map @tas hood-part)} ::
|
||||
++ hood-good ::
|
||||
|* hed=hood-head ::
|
||||
|= paw=hood-part ::
|
||||
|* hed/hood-head ::
|
||||
|= paw/hood-part ::
|
||||
?- hed ::
|
||||
%drum ?>(?=(%drum -.paw) `drum-part`paw) ::
|
||||
%helm ?>(?=(%helm -.paw) `helm-part`paw) ::
|
||||
%kiln ?>(?=(%kiln -.paw) `kiln-part`paw) ::
|
||||
%write ?>(?=(%write -.paw) `part:write`paw) ::
|
||||
$drum ?>(?=($drum -.paw) `drum-part`paw) ::
|
||||
$helm ?>(?=($helm -.paw) `helm-part`paw) ::
|
||||
$kiln ?>(?=($kiln -.paw) `kiln-part`paw) ::
|
||||
:: $write ?>(?=($write -.paw) `part:write`paw) ::
|
||||
== ::
|
||||
++ hood-head ,_-:*hood-part ::
|
||||
++ hood-head _-:*hood-part ::
|
||||
++ hood-make ::
|
||||
|* [our=@p hed=hood-head] ::
|
||||
|* {our/@p hed/hood-head} ::
|
||||
?- hed ::
|
||||
%drum (drum-port our) ::
|
||||
%helm *helm-part ::
|
||||
%kiln *kiln-part ::
|
||||
%write *part:write ::
|
||||
$drum (drum-port our) ::
|
||||
$helm *helm-part ::
|
||||
$kiln *kiln-part ::
|
||||
:: $write *part:write ::
|
||||
== ::
|
||||
++ hood-part ::
|
||||
$% [%drum %0 drum-pith] ::
|
||||
[%helm %0 helm-pith] ::
|
||||
[%kiln %0 kiln-pith] ::
|
||||
[%write %0 pith:write] ::
|
||||
$% {$drum $0 drum-pith} ::
|
||||
{$helm $0 helm-pith} ::
|
||||
{$kiln $0 kiln-pith} ::
|
||||
:: {$write $0 pith:write} ::
|
||||
== ::
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
|_ $: hid=bowl :: system state
|
||||
|_ $: hid/bowl :: system state
|
||||
hood-0 :: server state
|
||||
== ::
|
||||
++ able :: find/make part
|
||||
|* hed=hood-head
|
||||
++ able :: find+make part
|
||||
|* hed/hood-head
|
||||
=+ rep=(~(get by lac) hed)
|
||||
=+ par=?^(rep u.rep `hood-part`(hood-make our.hid hed))
|
||||
((hood-good hed) par)
|
||||
::
|
||||
++ ably :: save part
|
||||
|* [moz=(list) rep=hood-part]
|
||||
[(flop moz) %_(+> lac (~(put by lac) -.rep rep))]
|
||||
|* {(list) hood-part}
|
||||
[(flop +<-) %_(+> lac (~(put by lac) +<+< +<+))]
|
||||
:: :: ::
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
++ coup-kiln-fancy (wrap take-coup-fancy):from-kiln
|
||||
++ coup-kiln-spam ::
|
||||
|= [way=wire saw=(unit tang)]
|
||||
|= {way/wire saw/(unit tang)}
|
||||
~? ?=(^ saw) [%kiln-spam-lame u.saw]
|
||||
[~ +>]
|
||||
::
|
||||
++ coup-kiln-reload ::
|
||||
|= [way=wire saw=(unit tang)]
|
||||
|= {way/wire saw/(unit tang)}
|
||||
~? ?=(^ saw) [%kiln-reload-lame u.saw]
|
||||
[~ +>]
|
||||
::
|
||||
++ coup-kiln-overload ::
|
||||
|= [way=wire saw=(unit tang)]
|
||||
|= {way/wire saw/(unit tang)}
|
||||
~? ?=(^ saw) [%kiln-overload-lame u.saw]
|
||||
[~ +>]
|
||||
::
|
||||
@ -73,21 +73,21 @@
|
||||
++ coup-helm-hi (wrap coup-hi):from-helm
|
||||
++ diff-sole-effect-drum-phat (wrap diff-sole-effect-phat):from-drum
|
||||
++ from-lib
|
||||
|* _[%helm ..$ ,_abet]:(helm)
|
||||
|* _[%helm ..$ _abet]:(helm)
|
||||
=> .(+< [identity start finish]=+<)
|
||||
=- [wrap=- *start] :: usage (wrap handle-arm):from-foo
|
||||
|* handle=_finish
|
||||
|* handle/_finish
|
||||
|= _+<.handle
|
||||
=. +>.handle (start hid (able identity))
|
||||
(ably (handle +<))
|
||||
::
|
||||
++ from-drum (from-lib %drum [..$ ,_se-abet]:(drum))
|
||||
++ from-helm (from-lib %helm [..$ ,_abet]:(helm))
|
||||
++ from-kiln (from-lib %kiln [..$ ,_abet]:(kiln))
|
||||
++ from-write (from-lib %write [..$ ,_abet]:(write))
|
||||
++ from-drum (from-lib %drum [..$ _se-abet]:(drum))
|
||||
++ from-helm (from-lib %helm [..$ _abet]:(helm))
|
||||
++ from-kiln (from-lib %kiln [..$ _abet]:(kiln))
|
||||
:: ++ from-write (from-lib %write [..$ _abet]:(write))
|
||||
::
|
||||
++ init-helm |=([way=wire *] [~ +>])
|
||||
++ made-write (wrap made):from-write
|
||||
++ init-helm |=({way/wire *} [~ +>])
|
||||
:: ++ made-write (wrap made):from-write
|
||||
++ made-kiln (wrap take-made):from-kiln
|
||||
++ mere-kiln (wrap take-mere):from-kiln
|
||||
++ mere-kiln-sync (wrap take-mere-sync):from-kiln
|
||||
@ -107,6 +107,7 @@
|
||||
++ poke-helm-reload (wrap poke-reload):from-helm
|
||||
++ poke-helm-reload-desk (wrap poke-reload-desk):from-helm
|
||||
++ poke-helm-reset (wrap poke-reset):from-helm
|
||||
++ poke-helm-deset (wrap poke-deset):from-helm
|
||||
++ poke-helm-serve (wrap poke-serve):from-helm
|
||||
++ poke-helm-send-hi (wrap poke-send-hi):from-helm
|
||||
++ poke-helm-send-ask (wrap poke-send-ask):from-helm
|
||||
@ -128,10 +129,11 @@
|
||||
++ poke-kiln-overload (wrap poke-overload):from-kiln
|
||||
++ poke-kiln-unmount (wrap poke-unmount):from-kiln
|
||||
++ poke-kiln-unsync (wrap poke-unsync):from-kiln
|
||||
++ poke-write-comment (wrap poke-comment):from-write
|
||||
++ poke-write-paste (wrap poke-paste):from-write
|
||||
++ poke-write-tree (wrap poke-tree):from-write
|
||||
++ poke-write-wipe (wrap poke-wipe):from-write
|
||||
:: ++ poke-write-paste (wrap poke-paste):from-write
|
||||
:: ++ poke-write-comment (wrap poke-comment):from-write
|
||||
:: ++ poke-write-paste (wrap poke-paste):from-write
|
||||
:: ++ poke-write-tree (wrap poke-tree):from-write
|
||||
:: ++ poke-write-wipe (wrap poke-wipe):from-write
|
||||
++ poke-will (wrap poke-will):from-helm
|
||||
++ quit-drum-phat (wrap quit-phat):from-drum
|
||||
++ reap-drum-phat (wrap reap-phat):from-drum
|
||||
|
917
app/talk.hoon
917
app/talk.hoon
File diff suppressed because it is too large
Load Diff
552
arvo/ames.hoon
552
arvo/ames.hoon
File diff suppressed because it is too large
Load Diff
115
arvo/behn.hoon
115
arvo/behn.hoon
@ -1,33 +1,33 @@
|
||||
:: :: %behn, just a timer
|
||||
!? 164
|
||||
!:::
|
||||
|= pit=vase
|
||||
::::
|
||||
|= pit/vase
|
||||
=> =~
|
||||
|%
|
||||
++ sqeu |* [a=_,* b=_,*] :: binary skew queno
|
||||
$: r=@u :: rank/depth
|
||||
k=a :: priority
|
||||
n=b :: value
|
||||
c=(broq a b) :: children
|
||||
++ sqeu |* {a/_* b/_*} :: binary skew queno
|
||||
$: r/@u :: rank+depth
|
||||
k/a :: priority
|
||||
n/b :: value
|
||||
c/(broq a b) :: children
|
||||
== ::
|
||||
++ broq |* [a=_,* b=_,*] :: brodal skew qeu
|
||||
++ broq |* {a/_* b/_*} :: brodal skew qeu
|
||||
(list (sqeu a b)) ::
|
||||
++ gift gift-behn :: out result <-$
|
||||
++ kiss :: in request ->$
|
||||
$% [%rest p=@da] :: cancel alarm
|
||||
[%wait p=@da] :: set alarm
|
||||
[%wake ~] :: timer activate
|
||||
[%wegh ~] :: report memory
|
||||
$% {$rest p/@da} :: cancel alarm
|
||||
{$wait p/@da} :: set alarm
|
||||
{$wake $~} :: timer activate
|
||||
{$wegh $~} :: report memory
|
||||
== ::
|
||||
++ move ,[p=duct q=(mold note gift)] :: local move
|
||||
++ note ,~ :: out request $->
|
||||
++ sign ,~ :: in result $<-
|
||||
++ clok (broq ,@da duct) :: stored timers
|
||||
++ move {p/duct q/(mold note gift)} :: local move
|
||||
++ note $~ :: out request $->
|
||||
++ sign $~ :: in result $<-
|
||||
++ clok (broq @da duct) :: stored timers
|
||||
--
|
||||
::
|
||||
|%
|
||||
++ raze
|
||||
|= tym=[p=clok q=clok]
|
||||
|= tym/{p/clok q/clok}
|
||||
^+ tym
|
||||
?~ p.tym tym
|
||||
?~ q.tym tym
|
||||
@ -39,11 +39,11 @@
|
||||
tym
|
||||
::
|
||||
++ up :: priority queue
|
||||
=+ [key=,@da val=duct]
|
||||
=+ [key=@da val=duct]
|
||||
=+ cmp=lte :: lte=min, gte=max
|
||||
=> |%
|
||||
++ link
|
||||
|= [p=(sqeu key val) q=(sqeu key val)] :: link eq rank
|
||||
|= {p/(sqeu key val) q/(sqeu key val)} :: link eq rank
|
||||
^- (sqeu key val)
|
||||
?> =(r.p r.q)
|
||||
?: (cmp k.p k.q)
|
||||
@ -51,7 +51,7 @@
|
||||
[r=+(r.q) k=k.q n=n.q c=[i=p t=c.q]]
|
||||
::
|
||||
++ sink :: skew link
|
||||
|= [p=(sqeu key val) q=(sqeu key val) r=(sqeu key val)]
|
||||
|= {p/(sqeu key val) q/(sqeu key val) r/(sqeu key val)}
|
||||
^- (sqeu key val)
|
||||
?: &((cmp k.q k.p) (cmp k.q k.r))
|
||||
[r=+(r.q) k=k.q n=n.q c=[i=p t=[i=r t=c.q]]]
|
||||
@ -60,7 +60,7 @@
|
||||
[r=+(r.q) k=k.p n=n.p c=[i=q t=[i=r t=~]]]
|
||||
::
|
||||
++ sert :: internal ins op
|
||||
|= [p=(sqeu key val) q=(broq key val)]
|
||||
|= {p/(sqeu key val) q/(broq key val)}
|
||||
^- (broq key val)
|
||||
?~ q [p ~]
|
||||
?> (lte r.p r.i.q)
|
||||
@ -69,12 +69,12 @@
|
||||
$(p (link p i.q), q t.q)
|
||||
::
|
||||
++ uniq :: remove init dup
|
||||
|= q=(broq key val)
|
||||
|= q/(broq key val)
|
||||
?~ q ~
|
||||
(sert i.q t.q)
|
||||
::
|
||||
++ meek :: unique meld
|
||||
|= [p=(broq key val) q=(broq key val)]
|
||||
|= {p/(broq key val) q/(broq key val)}
|
||||
^- (broq key val)
|
||||
?~ p q
|
||||
?~ q p
|
||||
@ -85,8 +85,8 @@
|
||||
(sert (link i.p i.q) $(p t.p, q t.q))
|
||||
::
|
||||
++ mini :: getmin
|
||||
|= q=(broq key val)
|
||||
^- p=[(sqeu key val) (broq key val)]
|
||||
|= q/(broq key val)
|
||||
^- p/{(sqeu key val) (broq key val)}
|
||||
?~ q ~|(%fatal-mini-empty !!)
|
||||
?~ t.q [i=i.q t=~]
|
||||
=+ [l r]=$(q t.q)
|
||||
@ -95,17 +95,17 @@
|
||||
[l [i.q r]]
|
||||
::
|
||||
++ spit :: split
|
||||
|= [p=(broq key val) q=(list ,[k=key n=val]) r=(broq key val)]
|
||||
^- [t=(broq key val) x=(list ,[k=key n=val])]
|
||||
|= {p/(broq key val) q/(list {k/key n/val}) r/(broq key val)}
|
||||
^- {t/(broq key val) x/(list {k/key n/val})}
|
||||
?~ r
|
||||
[t=p x=q]
|
||||
?: =(0 r.i.r)
|
||||
$(q [[k=k.i.r n=n.i.r] q], r t.r)
|
||||
$(p [i.r p], r t.r)
|
||||
--
|
||||
|_ a=(broq key val) :: public interface
|
||||
|_ a/(broq key val) :: public interface
|
||||
++ put :: insert element
|
||||
|= [k=key n=val]
|
||||
|= {k/key n/val}
|
||||
^+ a
|
||||
?~ a [i=[r=0 k=k n=n c=~] t=~]
|
||||
?~ t.a [i=[r=0 k=k n=n c=~] t=a]
|
||||
@ -123,63 +123,63 @@
|
||||
(gas x)
|
||||
::
|
||||
++ gas
|
||||
|= b=(list ,[k=key n=val])
|
||||
|= b/(list {k/key n/val})
|
||||
^+ a
|
||||
q:(roll b |=([[k=key n=val] q=_a] (put(a q) k n)))
|
||||
q:(roll b |=({{k/key n/val} q/_a} (put(a q) k n)))
|
||||
::
|
||||
++ tap
|
||||
^- (list ,[k=key n=val])
|
||||
^- (list {k/key n/val})
|
||||
?~ a ~
|
||||
[get tap(a pop)]
|
||||
::
|
||||
++ get :: retrieve top
|
||||
^- [p=key q=val]
|
||||
^- {p/key q/val}
|
||||
?~ a ~|(%empty-broq-peek !!)
|
||||
?~ t.a [k n]:i.a
|
||||
=+ m=get(a t.a)
|
||||
?.((cmp k.i.a p.m) m [k n]:i.a)
|
||||
::
|
||||
++ uni :: merge
|
||||
|= q=(broq key val)
|
||||
|= q/(broq key val)
|
||||
^+ a
|
||||
(meek (uniq a) (uniq q))
|
||||
--
|
||||
--
|
||||
. ==
|
||||
=| $: %0 ::
|
||||
tym=[p=clok q=clok] :: positive/negative
|
||||
=| $: $0 ::
|
||||
tym/{p/clok q/clok} :: positive+negative
|
||||
== ::
|
||||
|= [now=@da eny=@ ski=sled] :: current invocation
|
||||
|= {now/@da eny/@ ski/sley} :: current invocation
|
||||
^?
|
||||
|% :: poke/peek pattern
|
||||
|% :: poke+peek pattern
|
||||
++ call :: handle request
|
||||
|= $: hen=duct
|
||||
hic=(hypo (hobo kiss))
|
||||
|= $: hen/duct
|
||||
hic/(hypo (hobo kiss))
|
||||
==
|
||||
^- [p=(list move) q=_..^$]
|
||||
^- {p/(list move) q/_..^$}
|
||||
=> %= . :: XX temporary
|
||||
q.hic
|
||||
^- kiss
|
||||
?: ?=(%soft -.q.hic)
|
||||
?: ?=($soft -.q.hic)
|
||||
:: ~& [%behn-call-soft (,@tas `*`-.p.q.hic)]
|
||||
((hard kiss) p.q.hic)
|
||||
?: (~(nest ut -:!>(*kiss)) | p.hic) q.hic
|
||||
~& [%behn-call-flub (,@tas `*`-.q.hic)]
|
||||
~& [%behn-call-flub (@tas `*`-.q.hic)]
|
||||
((hard kiss) q.hic)
|
||||
==
|
||||
=^ mof tym
|
||||
?- -.q.hic
|
||||
%rest
|
||||
$rest
|
||||
=. q.tym (~(put up q.tym) p.q.hic hen)
|
||||
=. tym (raze tym)
|
||||
[~ tym]
|
||||
::
|
||||
%wait
|
||||
$wait
|
||||
=. p.tym (~(put up p.tym) p.q.hic hen)
|
||||
=. tym (raze tym)
|
||||
[~ tym]
|
||||
::
|
||||
%wake
|
||||
$wake
|
||||
|- ^+ [*(list move) tym]
|
||||
=. tym (raze tym)
|
||||
?: =([~ ~] tym) [~ tym] :: XX TMI
|
||||
@ -190,35 +190,32 @@
|
||||
=^ mof tym $(p.tym ~(pop up p.tym))
|
||||
[[`move`[q.nex %give %wake ~] mof] tym]
|
||||
::
|
||||
%wegh
|
||||
$wegh
|
||||
:_ tym :_ ~
|
||||
:^ hen %give %mass
|
||||
:- %behn
|
||||
:- %|
|
||||
:~ tym/`tym
|
||||
:~ tym+[%& tym]
|
||||
==
|
||||
==
|
||||
[mof ..^$]
|
||||
::
|
||||
++ foo
|
||||
%bar
|
||||
::
|
||||
++ doze
|
||||
|= [now=@da hen=duct]
|
||||
^- (unit ,@da)
|
||||
|= {now/@da hen/duct}
|
||||
^- (unit @da)
|
||||
?~ p.tym ~
|
||||
(some p:[~(get up p.tym)])
|
||||
::
|
||||
++ load
|
||||
|= old=[%0 tym=[clok clok]]
|
||||
|= old/{$0 tym/{clok clok}}
|
||||
^+ ..^$
|
||||
..^$(tym tym.old)
|
||||
::
|
||||
++ scry
|
||||
|= [fur=(unit (set monk)) ren=@tas his=ship syd=desk lot=coin tyl=path]
|
||||
^- (unit (unit (pair mark ,*)))
|
||||
|= {fur/(unit (set monk)) ren/@tas his/ship syd/desk lot/coin tyl/path}
|
||||
^- (unit (unit (pair mark *)))
|
||||
=+ ^= liz
|
||||
|- ^- (list ,[@da duct])
|
||||
|- ^- (list {@da duct})
|
||||
=. tym (raze tym)
|
||||
?~ p.tym ~
|
||||
[~(get up p.tym) $(p.tym ~(pop up p.tym))]
|
||||
@ -226,7 +223,7 @@
|
||||
::
|
||||
++ stay [%0 tym]
|
||||
++ take :: process move
|
||||
|= [tea=wire hen=duct hin=(hypo sign)]
|
||||
^- [p=(list move) q=_..^$]
|
||||
|= {tea/wire hen/duct hin/(hypo sign)}
|
||||
^+ [p=*(list move) q=..^$]
|
||||
!!
|
||||
--
|
||||
|
1485
arvo/clay.hoon
1485
arvo/clay.hoon
File diff suppressed because it is too large
Load Diff
302
arvo/dill.hoon
302
arvo/dill.hoon
@ -1,38 +1,38 @@
|
||||
::
|
||||
!:
|
||||
:: dill (4d), terminal handling
|
||||
::
|
||||
|= pit=vase
|
||||
|= pit/vase
|
||||
=> |% :: interface tiles
|
||||
++ gill (pair ship term) :: general contact
|
||||
-- ::
|
||||
=> |% :: console protocol
|
||||
++ all-axle ?(old-axle axle) ::
|
||||
++ old-axle :: all dill state
|
||||
$: %2 ::
|
||||
ore=(unit ship) :: identity once set
|
||||
hey=(unit duct) :: default duct
|
||||
dug=(map duct axon) :: conversations
|
||||
$: $2 ::
|
||||
ore/(unit ship) :: identity once set
|
||||
hey/(unit duct) :: default duct
|
||||
dug/(map duct axon) :: conversations
|
||||
== ::
|
||||
++ axle ::
|
||||
$: %3 ::
|
||||
ore=(unit ship) :: identity once set
|
||||
hey=(unit duct) :: default duct
|
||||
dug=(map duct axon) :: conversations
|
||||
$: $3 ::
|
||||
ore/(unit ship) :: identity once set
|
||||
hey/(unit duct) :: default duct
|
||||
dug/(map duct axon) :: conversations
|
||||
$= hef :: other weights
|
||||
$: a=(unit mass) ::
|
||||
b=(unit mass) ::
|
||||
c=(unit mass) ::
|
||||
e=(unit mass) ::
|
||||
f=(unit mass) ::
|
||||
g=(unit mass) ::
|
||||
$: a/(unit mass) ::
|
||||
b/(unit mass) ::
|
||||
c/(unit mass) ::
|
||||
e/(unit mass) ::
|
||||
f/(unit mass) ::
|
||||
g/(unit mass) ::
|
||||
== ::
|
||||
== ::
|
||||
++ axon :: dill per duct
|
||||
$: ram=term :: console program
|
||||
tem=(unit (list dill-belt)) :: pending, reverse
|
||||
wid=_80 :: terminal width
|
||||
pos=@ud :: cursor position
|
||||
see=(list ,@c) :: current line
|
||||
$: ram/term :: console program
|
||||
tem/(unit (list dill-belt)) :: pending, reverse
|
||||
wid/_80 :: terminal width
|
||||
pos/@ud :: cursor position
|
||||
see/(list @c) :: current line
|
||||
== ::
|
||||
-- => ::
|
||||
|% :: protocol below
|
||||
@ -41,153 +41,153 @@
|
||||
-- => ::
|
||||
|% :: protocol outward
|
||||
++ mess ::
|
||||
$% [%dill-belt p=(hypo dill-belt)] ::
|
||||
$% {$dill-belt p/(hypo dill-belt)} ::
|
||||
== ::
|
||||
++ move ,[p=duct q=(mold note gift)] :: local move
|
||||
++ move {p/duct q/(mold note gift)} :: local move
|
||||
++ note-ames :: weird ames move
|
||||
$% [%make p=(unit ,@t) q=@ud r=@ s=?] ::
|
||||
[%sith p=@p q=@uw r=?] ::
|
||||
$% {$make p/(unit @t) q/@ud r/@ s/?} ::
|
||||
{$sith p/@p q/@uw r/?} ::
|
||||
== ::
|
||||
++ note-clay ::
|
||||
$% [%merg p=@p q=@tas r=@p s=@tas t=case u=germ] :: merge desks
|
||||
[%warp p=sock q=riff] :: wait for clay, hack
|
||||
$% {$merg p/@p q/@tas r/@p s/@tas t/case u/germ} :: merge desks
|
||||
{$warp p/sock q/riff} :: wait for clay hack
|
||||
== ::
|
||||
++ note-dill :: note to self, odd
|
||||
$% [%crud p=@tas q=(list tank)] ::
|
||||
[%heft ~] ::
|
||||
[%init p=ship] ::
|
||||
[%text p=tape] ::
|
||||
[%veer p=@ta q=path r=@t] :: install vane
|
||||
[%vega p=path] :: reboot by path
|
||||
[%verb ~] :: verbose mode
|
||||
$% {$crud p/@tas q/(list tank)} ::
|
||||
{$heft $~} ::
|
||||
{$init p/ship} ::
|
||||
{$text p/tape} ::
|
||||
{$veer p/@ta q/path r/@t} :: install vane
|
||||
{$vega p/path} :: reboot by path
|
||||
{$verb $~} :: verbose mode
|
||||
== ::
|
||||
++ note-gall ::
|
||||
$% [%conf dock %load ship desk] ::
|
||||
[%deal p=sock q=cush] ::
|
||||
$% {$conf dock $load ship desk} ::
|
||||
{$deal p/sock q/cush} ::
|
||||
== ::
|
||||
++ note :: out request $->
|
||||
$? [?(%a %b %c %e %f %g) %wegh ~] ::
|
||||
$% [%a note-ames] ::
|
||||
[%c note-clay] ::
|
||||
[%d note-dill] ::
|
||||
[%g note-gall] ::
|
||||
$? {?($a $b $c $e $f $g) $wegh $~} ::
|
||||
$% {$a note-ames} ::
|
||||
{$c note-clay} ::
|
||||
{$d note-dill} ::
|
||||
{$g note-gall} ::
|
||||
== == ::
|
||||
++ sign-ames ::
|
||||
$% [%nice ~] ::
|
||||
[%init p=ship] ::
|
||||
$% {$nice $~} ::
|
||||
{$init p/ship} ::
|
||||
== ::
|
||||
++ sign-gall :: see %gall
|
||||
$% [%onto p=(unit tang)] ::
|
||||
$% {$onto p/(unit tang)} ::
|
||||
== ::
|
||||
++ sign-clay ::
|
||||
$% [%mere p=(each (set path) (pair term tang))] ::
|
||||
[%note p=@tD q=tank] ::
|
||||
[%writ p=riot] ::
|
||||
$% {$mere p/(each (set path) (pair term tang))} ::
|
||||
{$note p/@tD q/tank} ::
|
||||
{$writ p/riot} ::
|
||||
== ::
|
||||
++ sign-dill ::
|
||||
$% [%blit p=(list blit)] ::
|
||||
$% {$blit p/(list blit)} ::
|
||||
== ::
|
||||
++ sign-gall ::
|
||||
$% [%onto p=(each suss tang)] ::
|
||||
[%unto p=cuft] ::
|
||||
$% {$onto p/(each suss tang)} ::
|
||||
{$unto p/cuft} ::
|
||||
== ::
|
||||
++ sign :: in result $<-
|
||||
$? [?(%a %b %c %e %f %g) %mass p=mass] ::
|
||||
$% [%a sign-ames] ::
|
||||
[%c sign-clay] ::
|
||||
[%d sign-dill] ::
|
||||
[%g sign-gall] ::
|
||||
$? {?($a $b $c $e $f $g) $mass p/mass} ::
|
||||
$% {$a sign-ames} ::
|
||||
{$c sign-clay} ::
|
||||
{$d sign-dill} ::
|
||||
{$g sign-gall} ::
|
||||
== == ::
|
||||
:::::::: :: dill tiles
|
||||
--
|
||||
=| all=axle
|
||||
|= [now=@da eny=@ ski=sled] :: current invocation
|
||||
=| all/axle
|
||||
|= {now/@da eny/@ ski/sley} :: current invocation
|
||||
=> |%
|
||||
++ as :: per cause
|
||||
|_ $: [moz=(list move) hen=duct our=ship]
|
||||
|_ $: {moz/(list move) hen/duct our/ship}
|
||||
axon
|
||||
==
|
||||
++ abet :: resolve
|
||||
^- [(list move) axle]
|
||||
^- {(list move) axle}
|
||||
[(flop moz) all(dug (~(put by dug.all) hen +<+))]
|
||||
::
|
||||
++ call :: receive input
|
||||
|= kyz=kiss
|
||||
|= kyz/kiss
|
||||
^+ +>
|
||||
?+ -.kyz ~& [%strange-kiss -.kyz] +>
|
||||
%flow +>
|
||||
%harm +>
|
||||
%hail (send %hey ~)
|
||||
%belt (send `dill-belt`p.kyz)
|
||||
%text (from %out (tuba p.kyz))
|
||||
%crud :: (send `dill-belt`[%cru p.kyz q.kyz])
|
||||
$flow +>
|
||||
$harm +>
|
||||
$hail (send %hey ~)
|
||||
$belt (send `dill-belt`p.kyz)
|
||||
$text (from %out (tuba p.kyz))
|
||||
$crud :: (send `dill-belt`[%cru p.kyz q.kyz])
|
||||
(crud p.kyz q.kyz)
|
||||
%blew (send %rez p.p.kyz q.p.kyz)
|
||||
%heft heft
|
||||
%tick =+ ^= ges ^- gens
|
||||
$blew (send %rez p.p.kyz q.p.kyz)
|
||||
$heft heft
|
||||
$tick =+ ^= ges ^- gens
|
||||
^- gens
|
||||
:- %en
|
||||
=+ can=(clan p.kyz)
|
||||
?- can
|
||||
%czar [%czar ~]
|
||||
%duke [%duke %anon ~]
|
||||
%earl [%earl (scot %p p.kyz)]
|
||||
%king :- %king
|
||||
$czar [%czar ~]
|
||||
$duke [%duke %anon ~]
|
||||
$earl [%earl (scot %p p.kyz)]
|
||||
$king :- %king
|
||||
?: =(~doznec p.kyz) :: so old tickets work
|
||||
'Urban Republic'
|
||||
(scot %p p.kyz)
|
||||
%pawn [%pawn ~]
|
||||
$pawn [%pawn ~]
|
||||
==
|
||||
=+ yen=(scot %p (shax :(mix %ticket eny now)))
|
||||
=+ ^= beg ^- [his=@p tic=@p yen=@t ges=gens]
|
||||
=+ ^= beg ^- {his/@p tic/@p yen/@t ges/gens}
|
||||
[p.kyz q.kyz yen ges]
|
||||
=+ cmd=[%hood %poke `cage`[%helm-begin !>(beg)]]
|
||||
%= +>.$
|
||||
moz
|
||||
:_(moz [hen %pass ~ %g %deal [our our] cmd])
|
||||
==
|
||||
%veer (dump kyz)
|
||||
%vega (dump kyz)
|
||||
%verb (dump kyz)
|
||||
$veer (dump kyz)
|
||||
$vega (dump kyz)
|
||||
$verb (dump kyz)
|
||||
==
|
||||
::
|
||||
++ crud
|
||||
|= [err=@tas tac=(list tank)]
|
||||
|= {err/@tas tac/(list tank)}
|
||||
=+ ^= wol ^- wall
|
||||
:- (trip err)
|
||||
(zing (turn (flop tac) |=(a=tank (~(win re a) [0 wid]))))
|
||||
(zing (turn (flop tac) |=(a/tank (~(win re a) [0 wid]))))
|
||||
|- ^+ +>.^$
|
||||
?~ wol +>.^$
|
||||
$(wol t.wol, +>.^$ (from %out (tuba i.wol)))
|
||||
::
|
||||
++ dump :: pass down to hey
|
||||
|= git=gift
|
||||
|= git/gift
|
||||
?> ?=(^ hey.all)
|
||||
+>(moz [[u.hey.all %give git] moz])
|
||||
::
|
||||
++ done :: return gift
|
||||
|= git=gift
|
||||
|= git/gift
|
||||
+>(moz :_(moz [hen %give git]))
|
||||
::
|
||||
++ from :: receive belt
|
||||
|= bit=dill-blit
|
||||
|= bit/dill-blit
|
||||
^+ +>
|
||||
?: ?=(%mor -.bit)
|
||||
?: ?=($mor -.bit)
|
||||
|- ^+ +>.^$
|
||||
?~ p.bit +>.^$
|
||||
$(p.bit t.p.bit, +>.^$ ^$(bit i.p.bit))
|
||||
?: ?=(%out -.bit)
|
||||
?: ?=($out -.bit)
|
||||
%+ done %blit
|
||||
:~ [%lin p.bit]
|
||||
[%mor ~]
|
||||
[%lin see]
|
||||
[%hop pos]
|
||||
==
|
||||
?: ?=(%pro -.bit)
|
||||
?: ?=($pro -.bit)
|
||||
(done(see p.bit) %blit [[%lin p.bit] [%hop pos] ~])
|
||||
?: ?=(%hop -.bit)
|
||||
?: ?=($hop -.bit)
|
||||
(done(pos p.bit) %blit [bit ~])
|
||||
?: ?=(%qit -.bit)
|
||||
?: ?=($qit -.bit)
|
||||
(dump %logo ~)
|
||||
(done %blit [bit ~])
|
||||
::
|
||||
@ -209,12 +209,12 @@
|
||||
=+ myt=(flop (need tem))
|
||||
=+ can=(clan our)
|
||||
=. tem ~
|
||||
=. moz :_(moz [hen %pass / %c %merg our %home our %base da/now %init])
|
||||
=. moz :_(moz [hen %pass / %c %merg our %home our %base da+now %init])
|
||||
=. moz :_(moz [hen %pass ~ %g %conf [[our ram] %load our %home]])
|
||||
=. +> ?: ?=(%czar can) +>
|
||||
=. +> ?: ?=(?($czar $pawn) can) +>
|
||||
(sync %base (sein our) %kids)
|
||||
=. +> (sync %home our %base)
|
||||
=. +> ?. ?=(?(%duke %king %czar) can) +>
|
||||
=. +> ?. ?=(?($duke $king $czar) can) +>
|
||||
(sync %kids our %base)
|
||||
=. +> autoload
|
||||
=. +> peer
|
||||
@ -223,9 +223,9 @@
|
||||
$(myt t.myt, +>+ (send i.myt))
|
||||
::
|
||||
++ into :: preinitialize
|
||||
|= gyl=(list gill)
|
||||
|= gyl/(list gill)
|
||||
%_ +>
|
||||
tem `(turn gyl |=(a=gill [%yow a]))
|
||||
tem `(turn gyl |=(a/gill [%yow a]))
|
||||
moz
|
||||
:_ moz
|
||||
:* hen
|
||||
@ -237,7 +237,7 @@
|
||||
==
|
||||
::
|
||||
++ send :: send action
|
||||
|= bet=dill-belt
|
||||
|= bet/dill-belt
|
||||
?^ tem
|
||||
+>(tem `[bet u.tem])
|
||||
%_ +>
|
||||
@ -252,7 +252,7 @@
|
||||
==
|
||||
::
|
||||
++ sync
|
||||
|= syn=[desk ship desk]
|
||||
|= syn/{desk ship desk}
|
||||
%_ +>.$
|
||||
moz
|
||||
:_ moz
|
||||
@ -266,7 +266,7 @@
|
||||
moz
|
||||
:_ moz
|
||||
:* hen %pass /autoload %g %deal [our our]
|
||||
ram %poke %kiln-start-autoload [%cube ~ [%atom %n]] ~
|
||||
ram %poke %kiln-start-autoload [%atom %n `~] ~
|
||||
==
|
||||
==
|
||||
::
|
||||
@ -277,50 +277,50 @@
|
||||
==
|
||||
::
|
||||
++ take :: receive
|
||||
|= sih=sign
|
||||
|= sih/sign
|
||||
^+ +>
|
||||
?- sih
|
||||
[?(%a %b %c %e %f %g) %mass *]
|
||||
{?($a $b $c $e $f $g) $mass *}
|
||||
(wegt -.sih p.sih)
|
||||
::
|
||||
[%a %nice *]
|
||||
{$a $nice *}
|
||||
:: ~& [%take-nice-ames sih]
|
||||
+>
|
||||
::
|
||||
[%a %init *]
|
||||
{$a $init *}
|
||||
+>(moz :_(moz [hen %give +.sih]))
|
||||
::
|
||||
[%c %mere *]
|
||||
?: ?=(%& -.p.sih)
|
||||
{$c $mere *}
|
||||
?: ?=($& -.p.sih)
|
||||
+>.$
|
||||
(mean >%dill-mere-fail< >p.p.p.sih< q.p.p.sih)
|
||||
::
|
||||
[%g %onto *]
|
||||
{$g $onto *}
|
||||
:: ~& [%take-gall-onto +>.sih]
|
||||
?- -.+>.sih
|
||||
%| (crud %onto p.p.+>.sih)
|
||||
%& (done %blit [%lin (tuba "{<p.p.sih>}")]~)
|
||||
$| (crud %onto p.p.+>.sih)
|
||||
$& (done %blit [%lin (tuba "{<p.p.sih>}")]~)
|
||||
==
|
||||
::
|
||||
[%g %unto *]
|
||||
{$g $unto *}
|
||||
:: ~& [%take-gall-unto +>.sih]
|
||||
?- -.+>.sih
|
||||
%coup ?~(p.p.+>.sih +>.$ (crud %coup u.p.p.+>.sih))
|
||||
%quit peer
|
||||
%reap ?~ p.p.+>.sih
|
||||
$coup ?~(p.p.+>.sih +>.$ (crud %coup u.p.p.+>.sih))
|
||||
$quit peer
|
||||
$reap ?~ p.p.+>.sih
|
||||
+>.$
|
||||
(dump:(crud %reap u.p.p.+>.sih) %logo ~)
|
||||
%diff pump:(from ((hard dill-blit) q:`vase`+>+>.sih))
|
||||
%doff !!
|
||||
$diff pump:(from ((hard dill-blit) q:`vase`+>+>.sih))
|
||||
$doff !!
|
||||
==
|
||||
::
|
||||
[%c %note *]
|
||||
{$c $note *}
|
||||
(from %out (tuba p.sih ' ' ~(ram re q.sih)))
|
||||
::
|
||||
[%c %writ *]
|
||||
{$c $writ *}
|
||||
init
|
||||
::
|
||||
[%d %blit *]
|
||||
{$d $blit *}
|
||||
(done +.sih)
|
||||
==
|
||||
::
|
||||
@ -328,20 +328,20 @@
|
||||
^- mass
|
||||
:- %dill
|
||||
:- %|
|
||||
:~ all/`[ore hey dug]:all
|
||||
:~ all+[%& [ore hey dug]:all]
|
||||
==
|
||||
::
|
||||
++ wegt
|
||||
|= [lal=?(%a %b %c %e %f %g) mas=mass]
|
||||
|= {lal/?($a $b $c $e $f $g) mas/mass}
|
||||
^+ +>
|
||||
=. hef.all
|
||||
?- lal
|
||||
%a ~?(?=(^ a.hef.all) %double-mass-a hef.all(a `mas))
|
||||
%b ~?(?=(^ b.hef.all) %double-mass-b hef.all(b `mas))
|
||||
%c ~?(?=(^ c.hef.all) %double-mass-c hef.all(c `mas))
|
||||
%e ~?(?=(^ e.hef.all) %double-mass-e hef.all(e `mas))
|
||||
%f ~?(?=(^ f.hef.all) %double-mass-f hef.all(f `mas))
|
||||
%g ~?(?=(^ g.hef.all) %double-mass-g hef.all(g `mas))
|
||||
$a ~?(?=(^ a.hef.all) %double-mass-a hef.all(a `mas))
|
||||
$b ~?(?=(^ b.hef.all) %double-mass-b hef.all(b `mas))
|
||||
$c ~?(?=(^ c.hef.all) %double-mass-c hef.all(c `mas))
|
||||
$e ~?(?=(^ e.hef.all) %double-mass-e hef.all(e `mas))
|
||||
$f ~?(?=(^ f.hef.all) %double-mass-f hef.all(f `mas))
|
||||
$g ~?(?=(^ g.hef.all) %double-mass-g hef.all(g `mas))
|
||||
==
|
||||
?. ?& ?=(^ a.hef.all)
|
||||
?=(^ b.hef.all)
|
||||
@ -358,51 +358,51 @@
|
||||
--
|
||||
::
|
||||
++ ax :: make ++as
|
||||
|= [hen=duct kyz=kiss] ::
|
||||
|= {hen/duct kyz/kiss} ::
|
||||
?~ ore.all ~
|
||||
=+ nux=(~(get by dug.all) hen)
|
||||
?^ nux
|
||||
(some ~(. as [~ hen u.ore.all] u.nux))
|
||||
?. ?=(%flow -.kyz) ~
|
||||
?. ?=($flow -.kyz) ~
|
||||
%- some
|
||||
%. q.kyz
|
||||
%~ into as
|
||||
:- [~ hen u.ore.all]
|
||||
:* p.kyz
|
||||
[~ ~]
|
||||
80
|
||||
0
|
||||
(tuba "<awaiting {(trip p.kyz)}, this may take a few minutes>")
|
||||
==
|
||||
:- [~ hen u.ore.all]
|
||||
:* p.kyz
|
||||
[~ ~]
|
||||
80
|
||||
0
|
||||
(tuba "<awaiting {(trip p.kyz)}, this may take a few minutes>")
|
||||
== ==
|
||||
--
|
||||
|% :: poke/peek pattern
|
||||
|% :: poke+peek pattern
|
||||
++ call :: handle request
|
||||
|= $: hen=duct
|
||||
hic=(hypo (hobo kiss))
|
||||
|= $: hen/duct
|
||||
hic/(hypo (hobo kiss))
|
||||
==
|
||||
^- [p=(list move) q=_..^$]
|
||||
^+ [p=*(list move) q=..^$]
|
||||
=> %= . :: XX temporary
|
||||
q.hic
|
||||
^- kiss
|
||||
?: ?=(%soft -.q.hic)
|
||||
:: ~& [%dill-call-soft (,@tas `*`-.p.q.hic)]
|
||||
?: ?=($soft -.q.hic)
|
||||
:: ~& [%dill-call-soft (@tas `*`-.p.q.hic)]
|
||||
((hard kiss) p.q.hic)
|
||||
?: (~(nest ut -:!>(*kiss)) | p.hic) q.hic
|
||||
~& [%dill-call-flub (,@tas `*`-.q.hic)]
|
||||
~& [%dill-call-flub (@tas `*`-.q.hic)]
|
||||
((hard kiss) q.hic)
|
||||
==
|
||||
?: ?=(%boot -.q.hic)
|
||||
?: ?=($boot -.q.hic)
|
||||
:_(..^$ [hen %pass ~ (note %a p.q.hic)]~)
|
||||
?: ?=(%flog -.q.hic)
|
||||
?: ?=($flog -.q.hic)
|
||||
:: ~& [%dill-flog +.q.hic]
|
||||
?: ?=([%crud %hax-init [%leaf *] ~] p.q.hic)
|
||||
?: ?=({$crud $hax-init {$leaf *} $~} p.q.hic)
|
||||
=+ him=(slav %p (crip p.i.q.p.q.hic))
|
||||
:_(..^$ ?~(hey.all ~ [u.hey.all %give %init him]~))
|
||||
?: ?=([%crud %hax-heft ~] p.q.hic)
|
||||
?: ?=({$crud $hax-heft $~} p.q.hic)
|
||||
:_(..^$ ?~(hey.all ~ [u.hey.all %slip %d %heft ~]~))
|
||||
:_(..^$ ?~(hey.all ~ [u.hey.all %slip %d p.q.hic]~))
|
||||
=. hey.all ?^(hey.all hey.all `hen)
|
||||
?: ?=(%init -.q.hic)
|
||||
?: ?=($init -.q.hic)
|
||||
:: ~& [%call-init hen]
|
||||
?: =(ore.all `p.q.hic)
|
||||
[[hen %give q.hic]~ ..^$]
|
||||
@ -420,30 +420,30 @@
|
||||
[moz ..^$]
|
||||
::
|
||||
++ doze
|
||||
|= [now=@da hen=duct]
|
||||
^- (unit ,@da)
|
||||
|= {now/@da hen/duct}
|
||||
^- (unit @da)
|
||||
~
|
||||
::
|
||||
++ load :: trivial
|
||||
|= old=all-axle
|
||||
?: ?=(%2 -.old)
|
||||
|= old/all-axle
|
||||
?: ?=($2 -.old)
|
||||
$(old [%3 ore hey dug ~ ~ ~ ~ ~ ~]:old)
|
||||
..^$(all old)
|
||||
:: |= old=* :: diable
|
||||
:: ..^$(ore.all `~zod)
|
||||
::
|
||||
++ scry
|
||||
|= [fur=(unit (set monk)) ren=@tas his=ship syd=desk lot=coin tyl=path]
|
||||
|= {fur/(unit (set monk)) ren/@tas his/ship syd/desk lot/coin tyl/path}
|
||||
^- (unit (unit cage))
|
||||
[~ ~]
|
||||
::
|
||||
++ stay all
|
||||
::
|
||||
++ take :: process move
|
||||
|= [tea=wire hen=duct hin=(hypo sign)]
|
||||
^- [p=(list move) q=_..^$]
|
||||
|= {tea/wire hen/duct hin/(hypo sign)}
|
||||
^+ [p=*(list move) q=..^$]
|
||||
?: =(~ ore.all)
|
||||
?: ?=([%a %init *] q.hin)
|
||||
?: ?=({$a $init *} q.hin)
|
||||
:: ~& [%take-init hen]
|
||||
=. hey.all ?^(hey.all hey.all `hen)
|
||||
[[[hen %give +.q.hin] ~] ..^$]
|
||||
|
1014
arvo/eyre.hoon
1014
arvo/eyre.hoon
File diff suppressed because it is too large
Load Diff
1385
arvo/ford.hoon
1385
arvo/ford.hoon
File diff suppressed because it is too large
Load Diff
704
arvo/gall.hoon
704
arvo/gall.hoon
File diff suppressed because it is too large
Load Diff
8089
arvo/hoon.hoon
8089
arvo/hoon.hoon
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,7 @@
|
||||
:: /userid :: user identity
|
||||
::
|
||||
:: /urb :: urbit secrets
|
||||
:: /tok/hash
|
||||
:: /tok+hash
|
||||
|
||||
|= pit=vase
|
||||
=> =~
|
||||
@ -137,7 +137,7 @@
|
||||
:: actually scry
|
||||
~
|
||||
::
|
||||
++ stay :: save w/o cache
|
||||
++ stay :: save w+o cache
|
||||
`axle`+>-.$(pol (~(run by pol) |=(a=baby [tad.a dym.a ~])))
|
||||
::
|
||||
++ take :: response
|
||||
|
@ -30,7 +30,7 @@
|
||||
[%know p=monk q=(map monk link)] :: set forward links
|
||||
[%nuke ~] :: erase subscriber
|
||||
== ::
|
||||
++ link (pair rank ,@da) :: trust/expiration
|
||||
++ link (pair rank ,@da) :: trust+expiration
|
||||
++ monk (each ship khan) :: general identity
|
||||
++ rank :: privilege ring
|
||||
$? %0 :: complete trust
|
||||
@ -93,7 +93,7 @@
|
||||
(
|
||||
|
||||
::
|
||||
++ stay :: save w/o cache
|
||||
++ stay :: save w+o cache
|
||||
`axle`+>-.$
|
||||
::
|
||||
++ take :: response
|
||||
|
@ -94,7 +94,7 @@
|
||||
^- (unit (unit (pair mark ,*)))
|
||||
~
|
||||
::
|
||||
++ stay :: save w/o cache
|
||||
++ stay :: save w+o cache
|
||||
`axle`+>-.$
|
||||
::
|
||||
++ take :: response
|
||||
|
@ -38,10 +38,10 @@
|
||||
++ rank :: relative privilege
|
||||
$? %0 :: enemy
|
||||
%1 :: neighbor
|
||||
%2 :: guest/customer
|
||||
%3 :: friend/employee
|
||||
%4 :: officer/family
|
||||
%5 :: self/admin
|
||||
%2 :: guest+customer
|
||||
%3 :: friend+employee
|
||||
%4 :: officer+family
|
||||
%5 :: self+admin
|
||||
== ::
|
||||
++ girl ::
|
||||
$: hop=pony :: status
|
||||
@ -84,7 +84,7 @@
|
||||
^- (unit (unit (pair mark ,*)))
|
||||
~
|
||||
::
|
||||
++ stay :: save w/o cache
|
||||
++ stay :: save w+o cache
|
||||
`axle`+>-.$
|
||||
::
|
||||
++ take :: response
|
||||
|
2143
arvo/zuse.hoon
2143
arvo/zuse.hoon
File diff suppressed because it is too large
Load Diff
22
gen/cat.hoon
22
gen/cat.hoon
@ -2,30 +2,32 @@
|
||||
::
|
||||
:::: /hoon/cat/gen
|
||||
::
|
||||
// /%%/ls/subdir
|
||||
// /%%/ls+subdir
|
||||
// /%/pretty
|
||||
!:
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= [^ [arg=(list path)] ~]
|
||||
=- tang/(flop `tang`(zing -))
|
||||
|= {^ {arg/(list path)} $~}
|
||||
=- tang+(flop `tang`(zing -))
|
||||
%+ turn arg
|
||||
|= pax=path
|
||||
|= pax/path
|
||||
^- tang
|
||||
=+ ark=;;(arch .^(%cy pax))
|
||||
?^ fil.ark
|
||||
?: =(%sched -:(flop pax))
|
||||
[>;;((map ,@da cord) .^(%cx pax))<]~
|
||||
[leaf/(spud pax) (pretty-file .^(%cx pax))]
|
||||
[leaf+(spud pax) (pretty-file .^(%cx pax))]
|
||||
?- dir.ark :: handle ambiguity
|
||||
~
|
||||
[rose/[" " `~]^~[leaf/"~" (smyt pax)]]~
|
||||
[[@t ~] ~ ~]
|
||||
$~
|
||||
[rose+[" " `~]^~[leaf+"~" (smyt pax)]]~
|
||||
::
|
||||
{{@t $~} $~ $~}
|
||||
$(pax (welp pax /[p.n.dir.ark]))
|
||||
::
|
||||
*
|
||||
=- [palm/[": " ``~]^-]~
|
||||
:~ rose/[" " `~]^~[leaf/"*" (smyt pax)]
|
||||
=- [palm+[": " ``~]^-]~
|
||||
:~ rose+[" " `~]^~[leaf+"*" (smyt pax)]
|
||||
`tank`(subdir pax dir.ark)
|
||||
==
|
||||
==
|
||||
|
@ -6,10 +6,10 @@
|
||||
++ pretty-noun
|
||||
|= pri=* ^- tank
|
||||
?~ pri
|
||||
leaf/"~"
|
||||
leaf+"~"
|
||||
?@ pri
|
||||
leaf/?:(((sane %tas) pri) <`@tas`pri> <pri>)
|
||||
=< rose/[" " ?:(- "~[" "[") "]"]^+
|
||||
leaf+?:(((sane %tas) pri) <`@tas`pri> <pri>)
|
||||
=< rose+[" " ?:(- "~[" "[") "]"]^+
|
||||
|- ^- [? (list tank)]
|
||||
?~ +.pri
|
||||
[& ^$(pri -.pri) ~]
|
||||
@ -20,7 +20,7 @@
|
||||
++ vale-cord |=(a=cord `?`(levy (trip a) |=(b=@ |((gte b 32) =(10 b)))))
|
||||
::
|
||||
++ pretty-file
|
||||
=+ wain-to-tang=|=(a=wain (turn a |=(b=cord leaf/(trip b))))
|
||||
=+ wain-to-tang=|=(a=wain (turn a |=(b=cord leaf+(trip b))))
|
||||
|= fyl=* ^- tang
|
||||
=+ `(unit wain)`?@(fyl `(lore fyl) ((soft wain) fyl))
|
||||
?^ - (wain-to-tang u)
|
||||
|
90
gen/change.hoon
Normal file
90
gen/change.hoon
Normal file
@ -0,0 +1,90 @@
|
||||
::
|
||||
:::: /hoon+hello+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= *
|
||||
:- %noun
|
||||
=- %+ turn -
|
||||
|= {a/@tas b/@tas}
|
||||
?: |
|
||||
^- @ta
|
||||
%- crip
|
||||
;: weld
|
||||
"s/\\$"
|
||||
(trip a)
|
||||
"/"
|
||||
"?($"
|
||||
(trip a)
|
||||
" $"
|
||||
(trip b)
|
||||
")"
|
||||
"/g"
|
||||
==
|
||||
?: |
|
||||
^- @ta
|
||||
%- crip
|
||||
;: weld
|
||||
"s/%"
|
||||
(trip a)
|
||||
"/"
|
||||
"%"
|
||||
(trip b)
|
||||
"/g"
|
||||
==
|
||||
?: &
|
||||
^- @ta
|
||||
%- crip
|
||||
;: weld
|
||||
"s/\\?(\\$"
|
||||
(trip a)
|
||||
" \\$"
|
||||
(trip b)
|
||||
")/$"
|
||||
(trip b)
|
||||
"/g"
|
||||
==
|
||||
!!
|
||||
^- (list (pair @tas @tas))
|
||||
:~ [%flap %claw] :: used in ames
|
||||
[%slug %shoe]
|
||||
[%rack %bank]
|
||||
[%gate %lamb]
|
||||
[%lock %gill]
|
||||
:: [%lamp %gate] reused
|
||||
[%bud %scon]
|
||||
[%qua %conq]
|
||||
[%dub %cons]
|
||||
[%tri %cont] :: collides with %trip
|
||||
[%ray %conl]
|
||||
[%all %conp]
|
||||
|
||||
[%cold %bunt] :: parser jet
|
||||
[%quid %calq]
|
||||
[%quip %calt]
|
||||
[%with %open]
|
||||
:: [%kick %nock] reused; used in ames
|
||||
[%live %poll] :: also a hint
|
||||
[%show %dump] :: used in %ames
|
||||
|
||||
:: [%fate %show] reused
|
||||
|
||||
[%germ %ddup] :: also a hint
|
||||
[%type %peep]
|
||||
[%fly %fix]
|
||||
[%ram %rev] :: also %ramp
|
||||
[%eat %sip]
|
||||
[%has %pin]
|
||||
[%saw %nip]
|
||||
[%dig %ifcl] :: %digitalocean in ape/cloud
|
||||
[%nay %deny]
|
||||
[%aye %sure]
|
||||
[%deal %deft] :: used in all vanes
|
||||
[%dab %ifat]
|
||||
[%non %ifno] :: also %none
|
||||
[%fit %fits] :: also %fitz
|
||||
[%nock %code] :: reused
|
||||
==
|
@ -3,7 +3,7 @@
|
||||
::
|
||||
/- sole
|
||||
[sole]
|
||||
:- %get |= [^ [a=tape ~] ~]
|
||||
:- %get |= {^ {a/tape $~} $~}
|
||||
%+ sole-at (scan a auri:epur)
|
||||
|= hit=httr
|
||||
|= hit/httr
|
||||
(sole-so %httr hit)
|
||||
|
@ -6,5 +6,5 @@
|
||||
:::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ [arg=tape ~] ~]
|
||||
purl/(scan arg auri:epur)
|
||||
|= {^ {arg/tape $~} $~}
|
||||
purl+(scan arg auri:epur)
|
||||
|
@ -1,11 +1,11 @@
|
||||
::
|
||||
:::: /hoon/hello/gen
|
||||
:::: /hoon+hello+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ [[txt=@tas ~] ~]]
|
||||
|= {^ {{txt/@tas $~} $~}}
|
||||
:- %noun
|
||||
(crip (weld "hello, " (flop (trip txt))))
|
||||
|
@ -2,8 +2,8 @@
|
||||
:::: /hoon/ask/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|= [^ [mel=cord ~] ~]
|
||||
|= {^ {mel/cord $~} $~}
|
||||
=+ adr=(star ;~(less (mask "\"\\()[],:;<>@") prn))
|
||||
=+ dom=[;~(plug dlab dot (most dot dlab))]:urlp
|
||||
=+ ~|(bad-email/mel (rash mel ;~((glue pat) adr dom)))
|
||||
helm-send-ask/mel
|
||||
=+ ~|(bad-email+mel (rash mel ;~((glue pat) adr dom)))
|
||||
helm-send-ask+mel
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/autoload/hood/gen
|
||||
:::: /hoon+autoload+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=?(~ [? ~]) ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/?($~ {? $~}) $~}
|
||||
==
|
||||
:- %kiln-autoload
|
||||
`(unit ,?)`?~(arg ~ `-.arg)
|
||||
`(unit ?)`?~(arg ~ `-.arg)
|
||||
|
@ -7,14 +7,14 @@
|
||||
::::
|
||||
!:
|
||||
=> |%
|
||||
++ begs ,[his=@p tic=@p yen=@t ges=gens]
|
||||
++ scug |*([a=@ b=(pole)] ?~(b ~ ?~(a ~ [-.b $(b +.b, a (dec a))])))
|
||||
++ begs {his/@p tic/@p yen/@t ges/gens}
|
||||
++ scug |*({a/@ b/(pole)} ?~(b ~ ?~(a ~ [-.b $(b +.b, a (dec a))])))
|
||||
--
|
||||
[sole .]
|
||||
:- %ask
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=_(scug *@ ~[his=*@p tic=*@p])]
|
||||
safety=?(%on %off)
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/_(scug *@ ~{his/*@p tic/*@p})}
|
||||
safety/?($on $off)
|
||||
==
|
||||
^- (sole-result (cask begs))
|
||||
?. =(safety %off)
|
||||
@ -29,15 +29,15 @@
|
||||
%+ sole-lo
|
||||
[%& %helm-begin "your urbit: ~"]
|
||||
%+ sole-go fed:ag
|
||||
|= his=@p
|
||||
|= his/@p
|
||||
%+ sole-lo
|
||||
[%& %helm-ticket "your ticket: ~"]
|
||||
%+ sole-go fed:ag
|
||||
|= tic=@p
|
||||
|= tic/@p
|
||||
%+ sole-lo
|
||||
[%& %helm-entropy "some entropy: "]
|
||||
%+ sole-go (boss 256 (more gon qit))
|
||||
|= yen=@t
|
||||
|= yen/@t
|
||||
=+ ney=(shax yen)
|
||||
%+ sole-yo `tank`[%leaf "entropy check: {(scow %p `@p`(mug ney))}"]
|
||||
%+ sole-so %helm-begin
|
||||
@ -49,10 +49,10 @@
|
||||
:- %en
|
||||
=+ can=(clan his)
|
||||
?- can
|
||||
%czar [%czar ~]
|
||||
%duke [%duke %anon ~]
|
||||
%earl [%earl (scot %p his)]
|
||||
%king [%king ?:(=(~doznec his) 'Urban Republic' (scot %p his))]
|
||||
%pawn [%pawn ~]
|
||||
$czar [%czar ~]
|
||||
$duke [%duke %anon ~]
|
||||
$earl [%earl (scot %p his)]
|
||||
$king [%king ?:(=(~doznec his) 'Urban Republic' (scot %p his))]
|
||||
$pawn [%pawn ~]
|
||||
==
|
||||
==
|
||||
|
@ -6,8 +6,8 @@
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=(list term) ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/(list term) $~}
|
||||
==
|
||||
:+ %helm-reload-desk %base
|
||||
arg
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/cancel/hood/gen
|
||||
:::: /hoon+cancel+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[syd=@tas ~] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{{syd/@tas $~} $~}
|
||||
==
|
||||
:- %kiln-cancel
|
||||
syd
|
||||
|
@ -2,4 +2,4 @@
|
||||
:::: /hoon/cp/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [input=path output=path ~] ~] kiln-cp/[input output])
|
||||
|=({^ {input/path output/path $~} $~} kiln-cp+[input output])
|
||||
|
12
gen/hood/deset.hoon
Normal file
12
gen/hood/deset.hoon
Normal file
@ -0,0 +1,12 @@
|
||||
::
|
||||
:::: /hoon+deset+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/$~ $~}
|
||||
==
|
||||
[%helm-deset ~]
|
@ -2,4 +2,4 @@
|
||||
:::: /hoon/hi/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [who=ship mez=$|(~ [a=tape ~])] ~] helm-send-hi/[who ?~(mez ~ `a.mez)])
|
||||
|=({^ {who/ship mez/$@($~ {a/tape $~})} $~} helm-send-hi+[who ?~(mez ~ `a.mez)])
|
||||
|
@ -6,8 +6,8 @@
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[~ ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{$~ $~}
|
||||
==
|
||||
:- %hood-init
|
||||
p.bec
|
||||
|
@ -1,12 +1,12 @@
|
||||
::
|
||||
:::: /hoon/invite/hood/gen
|
||||
:::: /hoon+invite+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[who=@p myl=@t ~] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{{who/@p myl/@t $~} $~}
|
||||
==
|
||||
[%helm-invite who myl]
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/label/hood/gen
|
||||
:::: /hoon+label+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=[syd=desk lab=@tas ~] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/{syd/desk lab/@tas $~} $~}
|
||||
==
|
||||
:- %kiln-label
|
||||
[syd lab]:arg
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/link/hood/gen
|
||||
:::: /hoon+link+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[arg=$?([dap=term ~] [who=ship dap=term ~]) ~]
|
||||
|= $: {now/@da eny/@uvI byk/beak}
|
||||
{arg/$?({dap/term $~} {who/ship dap/term $~}) $~}
|
||||
==
|
||||
:- %drum-link
|
||||
?~ +.arg
|
||||
|
@ -1,12 +1,12 @@
|
||||
::
|
||||
:::: /hoon/mass/hood/gen
|
||||
:::: /hoon+mass+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=~ ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/$~ $~}
|
||||
==
|
||||
[%helm-mass ~]
|
||||
|
@ -4,30 +4,30 @@
|
||||
/? 314
|
||||
!:
|
||||
|%
|
||||
++ beaky ,[span span span ~]
|
||||
++ sorc ?([bek=beaky ~] [her=@p sud=@tas ~])
|
||||
++ beaky {span span span $~}
|
||||
++ sorc ?({bek/beaky $~} {her/@p sud/@tas $~})
|
||||
--
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bek=beak]
|
||||
[arg=[?(sorc [syd=$|(desk beaky) sorc])] cas=case gem=?(%auto germ)]
|
||||
|= $: {now/@da eny/@uvI bek/beak}
|
||||
{arg/{?(sorc {syd/$@(desk beaky) sorc})} cas/case gem/?(%auto germ)}
|
||||
==
|
||||
=. cas ?:(=(*case cas) da/now cas)
|
||||
=* our p.bek
|
||||
|^ :- %kiln-merge
|
||||
^- [syd=desk her=ship sud=desk cas=case gem=?(%auto germ)]
|
||||
^- {syd/desk her/ship sud/desk cas/case gem/?($auto germ)}
|
||||
?- arg
|
||||
[@ @ ~] =+(arg [sud ?.(=(our her) her (sein her)) sud cas gem])
|
||||
[^ ~] =+ (pars bek.arg)
|
||||
[dez ?.(=(our who) who (sein who)) dez cas gem]
|
||||
[* @ @ ~] [(pars-src syd.arg) =+(arg [her sud cas gem])]
|
||||
[* ^ ~] [(pars-src syd.arg) =+((pars bek.arg) [who dez cas gem])]
|
||||
{@ @ $~} =+(arg [sud ?.(=(our her) her (sein her)) sud cas gem])
|
||||
{^ $~} =+ (pars bek.arg)
|
||||
[dez ?.(=(our who) who (sein who)) dez cas gem]
|
||||
{* @ @ $~} [(pars-src syd.arg) =+(arg [her sud cas gem])]
|
||||
{* ^ $~} [(pars-src syd.arg) =+((pars bek.arg) [who dez cas gem])]
|
||||
==
|
||||
++ pars |=(a=beaky =+((need (tome a)) `[who=ship dez=desk]`[p q]))
|
||||
++ pars |=(a/beaky =+((need (tome a)) `{who/ship dez/desk}`{p q}))
|
||||
++ pars-src
|
||||
|= syd=$|(desk beaky)
|
||||
|= syd/$@(desk beaky)
|
||||
?@ syd syd
|
||||
=+ (pars syd)
|
||||
~| [%into-foreign who `path`syd]
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/mount/hood/gen
|
||||
:::: /hoon+mount+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[pax=path pot=$|(~ [v=@tas ~])] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{{pax/path pot/$@($~ {v/@tas $~})} $~}
|
||||
==
|
||||
?~ pot
|
||||
=+ bem=(need (tome pax))
|
||||
|
@ -2,4 +2,4 @@
|
||||
:::: /hoon/mv/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [input=path output=path ~] ~] kiln-mv/[input output])
|
||||
|=({^ {input/path output/path $~} $~} kiln-mv+[input output])
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/overload/hood/gen
|
||||
:::: /hoon+overload+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[arg=term ~] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{{arg/term $~} $~}
|
||||
==
|
||||
:- %kiln-overload
|
||||
arg
|
||||
|
@ -6,7 +6,7 @@
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=~ ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/$~ $~}
|
||||
==
|
||||
[%helm-reload ~[%c]]
|
||||
|
@ -6,7 +6,7 @@
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=~ ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/$~ $~}
|
||||
==
|
||||
[%helm-reload ~[%z %a %b %c %d %e %f %g]]
|
||||
|
@ -6,8 +6,8 @@
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=[desk (list term)] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/{desk (list term)} $~}
|
||||
==
|
||||
:- %helm-reload-desk
|
||||
arg
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/reload/hood/gen
|
||||
:::: /hoon+reload+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=(list term) ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/(list term) $~}
|
||||
==
|
||||
:- %helm-reload
|
||||
arg
|
||||
|
@ -1,12 +1,12 @@
|
||||
::
|
||||
:::: /hoon/reset/hood/gen
|
||||
:::: /hoon+reset+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=~ ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/$~ $~}
|
||||
==
|
||||
[%helm-reset ~]
|
||||
|
@ -6,7 +6,7 @@
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=~ ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/$~ $~}
|
||||
==
|
||||
[%helm-reload ~[%f]]
|
||||
|
@ -2,4 +2,4 @@
|
||||
:::: /hoon/rm/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [input=path ~] ~] kiln-rm/input)
|
||||
|=({^ {input/path $~} $~} kiln-rm+input)
|
||||
|
@ -2,4 +2,4 @@
|
||||
:::: /hoon/schedule/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [where=path tym=@da eve=@t ~] ~] kiln-schedule/[where tym eve])
|
||||
|=({^ {where/path tym/@da eve/@t $~} $~} kiln-schedule+[where tym eve])
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/start/hood/gen
|
||||
:::: /hoon+start+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=[@ $|(~ [@ ~])] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/{@ $@($~ {@ $~})} $~}
|
||||
==
|
||||
:- %drum-start
|
||||
?> ((sane %tas) -.arg)
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/sync/hood/gen
|
||||
:::: /hoon+sync+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=[syd=@tas her=@p sud=@tas ~] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/{syd/@tas her/@p sud/@tas $~} $~}
|
||||
==
|
||||
:- %kiln-sync
|
||||
[syd her sud]:arg
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/unix/hood/gen
|
||||
:::: /hoon+unix+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[syd=@tas syn=?(~ [? ~])] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{{syd/@tas syn/?($~ {? $~})} $~}
|
||||
==
|
||||
:+ %hood-unix
|
||||
syd
|
||||
|
@ -6,8 +6,8 @@
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[arg=$?([dap=term ~] [who=ship dap=term ~]) ~]
|
||||
|= $: {now/@da eny/@uvI byk/beak}
|
||||
{arg/$?({dap/term $~} {who/ship dap/term $~}) $~}
|
||||
==
|
||||
:- %drum-unlink
|
||||
?~ +.arg
|
||||
|
@ -6,8 +6,8 @@
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[mon=$|(term [span path]) ~] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{{mon/$@(term {span path}) $~} $~}
|
||||
==
|
||||
:- %kiln-unmount
|
||||
mon
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/unsync/hood/gen
|
||||
:::: /hoon+unsync+hood+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[arg=[syd=@tas her=@p sud=@tas ~] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{arg/{syd/@tas her/@p sud/@tas $~} $~}
|
||||
==
|
||||
:- %kiln-unsync
|
||||
[syd her sud]:arg
|
||||
|
@ -8,8 +8,8 @@
|
||||
!:
|
||||
[sole .]
|
||||
:- %say
|
||||
|= $: [now=@da eny=@ bec=beak]
|
||||
[~ ~]
|
||||
|= $: {now/@da eny/@ bec/beak}
|
||||
{$~ $~}
|
||||
==
|
||||
~& %helm-verb
|
||||
[%helm-verb ~]
|
||||
|
@ -1,12 +1,12 @@
|
||||
:: LiSt directory subnodes
|
||||
::
|
||||
:::: /hoon/ls/gen
|
||||
:::: /hoon+ls+gen
|
||||
::
|
||||
// /%/subdir
|
||||
!:
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= [^ [arg=path ~] ~]
|
||||
|= {^ {arg/path $~} $~}
|
||||
=+ lon=((hard arch) .^(%cy arg))
|
||||
tang/[?~(dir.lon leaf/"~" (subdir arg dir.lon))]~
|
||||
tang+[?~(dir.lon leaf+"~" (subdir arg dir.lon))]~
|
||||
|
@ -3,21 +3,21 @@
|
||||
::
|
||||
|%
|
||||
++ subdir
|
||||
|= [pax=path des=(map ,@t ,~)]
|
||||
|= {pax/path des/(map @t $~)}
|
||||
^- tank
|
||||
:+ %rose [" " `~]
|
||||
%+ turn (sort (~(tap by des)) aor)
|
||||
|= [kid=@ta ~]
|
||||
|= {kid/@ta $~}
|
||||
=+ paf=`path`/[kid]
|
||||
=- :+ %rose ["/" ~ ?:(dir "/" ~)]
|
||||
(turn paf |=(a=span leaf/(trip a)))
|
||||
|- ^- [dir=? paf=path]
|
||||
(turn paf |=(a/span leaf+(trip a)))
|
||||
|- ^- {dir/? paf/path}
|
||||
=+ arf=;;(arch .^(%cy (weld pax paf)))
|
||||
?^ fil.arf
|
||||
[| paf]
|
||||
?~ dir.arf
|
||||
[& paf] :: !!
|
||||
?. ?=([^ ~ ~] dir.arf)
|
||||
?. ?+({^ $~ $~} dir.arf)
|
||||
[& paf]
|
||||
$(paf (welp paf /[p.n.dir.arf]))
|
||||
--
|
||||
|
@ -2,4 +2,4 @@
|
||||
:::: /hoon/make/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ arg=(list ,@) foo=_`@`1 bar=_`@`2] noun/[arg foo bar])
|
||||
|=({^ arg/(list @) foo/_`@`1 bar/_`@`2} noun+[arg foo bar])
|
||||
|
@ -6,11 +6,11 @@
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[~ ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
[$~ $~]
|
||||
==
|
||||
:- %noun
|
||||
?> =(1 (met 5 p.bec))
|
||||
=+ mon=(mix (lsh 5 1 (end 5 1 eny)) p.bec)
|
||||
=+ tic=((hard ,@p) .^(/a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon)))
|
||||
=+ tic=((hard @p) .^(/a+(scot %p p.bec)/tick+(scot %da now)/(scot %p mon)))
|
||||
"moon: {<`@p`mon>}; ticket: {<tic>}"
|
||||
|
@ -7,21 +7,21 @@
|
||||
=+ cryp=bruw :: XX change to ec2 ++brew eventually
|
||||
=+ [sole]
|
||||
:- %ask
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[who=ship ~] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{{who/ship $~} $~}
|
||||
==
|
||||
^- (sole-result (cask tang))
|
||||
%+ sole-yo leaf/"generating carrier {(scow %p who)} (#{(scow %ud who)})"
|
||||
%+ sole-yo leaf+"generating carrier {(scow %p who)} (#{(scow %ud who)})"
|
||||
%+ sole-lo [%| %pope-pass "passphrase: "]
|
||||
%+ sole-go (boss 256 (star prn))
|
||||
|= fra=@t
|
||||
|= fra/@t
|
||||
%+ sole-lo [%| %pope-none "[press enter to compute]"] :: XX oy
|
||||
%+ sole-go (easy ~)
|
||||
|= ~
|
||||
|= $~
|
||||
=+ bur=(shax (add who (shax fra)))
|
||||
~& %computing-fingerprint
|
||||
=+ arc=(cryp 2.048 bur)
|
||||
%+ sole-so %tang
|
||||
:~ leaf/"generator: {(scow %uw bur)}"
|
||||
leaf/"fingerprint: {(scow %uw fig:ex:arc)}"
|
||||
:~ leaf+"generator: {(scow %uw bur)}"
|
||||
leaf+"fingerprint: {(scow %uw fig:ex:arc)}"
|
||||
==
|
||||
|
@ -1,38 +1,40 @@
|
||||
::
|
||||
:::: /hoon/solid/gen
|
||||
:::: /hoon+solid+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[~ ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{$~ $~}
|
||||
==
|
||||
:- %noun
|
||||
=+ top=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/arvo
|
||||
=+ pax=`path`(weld top `path`[%hoon ~])
|
||||
~& %solid-start
|
||||
=+ gen=(reck pax)
|
||||
:: =+ nig=(rick pax)
|
||||
:: ~& [%mugs gen+(mug gen) nig+(mug nig)]
|
||||
~& %solid-parsed
|
||||
=+ ken=q:(~(mint ut %noun) %noun gen)
|
||||
~& %solid-compiled
|
||||
:- ken
|
||||
=+ all=.*(0 ken)
|
||||
=+ ^= vay ^- (list ,[p=@tas q=@tas])
|
||||
=+ ^= vay ^- (list {p/@tas q/@tas})
|
||||
:~ [%$ %zuse]
|
||||
[%c %clay]
|
||||
[%g %gall]
|
||||
[%f %ford]
|
||||
[%a %ames]
|
||||
[%b %behn]
|
||||
[%c %clay]
|
||||
[%d %dill]
|
||||
[%e %eyre]
|
||||
==
|
||||
|- ^+ all
|
||||
?~ vay all
|
||||
=+ pax=(weld top `path`[q.i.vay ~])
|
||||
=+ txt=((hard ,@) .^(%cx (weld pax `path`[%hoon ~])))
|
||||
=+ txt=.^(@ %cx (weld pax `path`[%hoon ~]))
|
||||
=+ sam=[now `ovum`[[%gold ~] [%veer p.i.vay pax txt]]]
|
||||
~& [%solid-veer i.vay]
|
||||
=+ gat=.*(all .*(all [0 42]))
|
||||
|
@ -1,13 +1,13 @@
|
||||
::
|
||||
:::: /hoon/ticket/gen
|
||||
:::: /hoon+ticket+gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[her=@p ~] ~]
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{{her/@p ~} ~}
|
||||
==
|
||||
:- %noun
|
||||
((hard ,@p) .^(/a/(scot %p p.bec)/tick/(scot %da now)/(scot %p her)))
|
||||
.^(@p /a+(scot %p p.bec)/tick+(scot %da now)/(scot %p her))
|
||||
|
@ -1,21 +1,21 @@
|
||||
:: Tree view recursive directory contents
|
||||
::
|
||||
:::: /hoon/tree/gen
|
||||
:::: /hoon+tree+gen
|
||||
::
|
||||
!:
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= [^ [pax=path fla=$|(~ [%full ~])] ~]
|
||||
|= {^ {pax/path fla/$@($~ {$full $~})} $~}
|
||||
=+ len=(lent pax)
|
||||
=+ rend=?^(fla smyt |=(a=path (smyt (slag len a))))
|
||||
=+ rend=?^(fla smyt |=(a/path (smyt (slag len a))))
|
||||
:- %tang %- flop
|
||||
|- ^- tang
|
||||
=+ ark=;;(arch .^(cy/pax))
|
||||
=+ ark=;;(arch .^(cy+pax))
|
||||
=- ?~ fil.ark -
|
||||
[(rend pax) -]
|
||||
%- zing
|
||||
%+ turn
|
||||
(sort (~(tap by dir.ark)) aor)
|
||||
|= [a=@t ~]
|
||||
|= {a/@t $~}
|
||||
^$(pax (welp pax /[a]))
|
||||
|
@ -6,13 +6,13 @@
|
||||
::::
|
||||
::
|
||||
[markdown .]
|
||||
// /%/parse :: inli donp parse
|
||||
// /%/parse :: inli donp parse
|
||||
// /%/rend :: sing sung sang flat into-inner
|
||||
~% %down ..is ~
|
||||
|%
|
||||
++ mark
|
||||
~/ %mark
|
||||
|= p=@t
|
||||
|= p/@t
|
||||
(normalize (rash p parse))
|
||||
::
|
||||
++ print sing
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,46 +4,49 @@
|
||||
::
|
||||
|%
|
||||
++ into-inner
|
||||
|= [a=marl b=manx]
|
||||
|= {a/marl b/manx}
|
||||
?~ c.b b(c a)
|
||||
$(b i.c.b)
|
||||
::
|
||||
++ flat
|
||||
|= a=marl
|
||||
|= a/marl
|
||||
^- tape
|
||||
?~ a ~
|
||||
%- weld :_ $(a t.a)
|
||||
^- tape
|
||||
?~ n.g.i.a
|
||||
?>(?=(_:/(**) i.a) v.i.a.g.i.a)
|
||||
?+ n.g.i.a $(a c.i.a)
|
||||
%img
|
||||
%- zing ^- wall
|
||||
%+ murn a.g.i.a |= [a=mane b=tape]
|
||||
^- (unit tape)
|
||||
?+ a ~
|
||||
%alt [~ b]
|
||||
%+ weld
|
||||
^- tape
|
||||
?~ n.g.i.a
|
||||
?>(?=(_;/(**) i.a) v.i.a.g.i.a)
|
||||
?+ n.g.i.a $(a c.i.a)
|
||||
$img
|
||||
%- zing ^- wall
|
||||
%+ murn a.g.i.a |= {a/mane b/tape}
|
||||
^- (unit tape)
|
||||
?+ a ~
|
||||
$alt [~ b]
|
||||
==
|
||||
==
|
||||
==
|
||||
$(a t.a)
|
||||
::
|
||||
++ sanitize
|
||||
|= a=marl ^- tape
|
||||
|= a/marl ^- tape
|
||||
=- (zing `wall`(scan (flat a) fel))
|
||||
=< fel=;~(sfix (star ;~(plug (cold '-' -) (plus +))) (star next))
|
||||
[(star ;~(less aln prn)) ;~(pose nud low (cook |=(a=@ (add a ' ')) hig))]
|
||||
[(star ;~(less aln prn)) ;~(pose nud low (cook |=(a/@ (add a ' ')) hig))]
|
||||
::
|
||||
++ sang :: tight item children
|
||||
|= a=(list elem)
|
||||
|= a/(list elem)
|
||||
^- marl
|
||||
?~ a ~
|
||||
%- weld :_ $(a t.a)
|
||||
?. ?=(%para -.i.a)
|
||||
(sing i.a ~)
|
||||
(sung p.i.a)
|
||||
%+ weld
|
||||
?. ?=($para -.i.a)
|
||||
(sing i.a ~)
|
||||
(sung p.i.a)
|
||||
$(a t.a)
|
||||
::
|
||||
++ sing :: elem to manx
|
||||
=> |%
|
||||
++ first-word
|
||||
|= a=tape
|
||||
|= a/tape
|
||||
=. a (trip (crip a)) :: XX valid tapes
|
||||
^- (unit tape)
|
||||
=. a q.q:(need q:((star ace) [1 1] a))
|
||||
@ -52,7 +55,7 @@
|
||||
(some (wonk vex))
|
||||
--
|
||||
=+ [tig=| had=*(unit mane)]
|
||||
|= lum=(list elem)
|
||||
|= lum/(list elem)
|
||||
|^ ^- marl
|
||||
=+ a=apex
|
||||
?~ q.a
|
||||
@ -60,16 +63,16 @@
|
||||
(weld p.a $(lum q.a))
|
||||
::
|
||||
++ apex
|
||||
^- [p=marl q=_lum]
|
||||
^- {p/marl q/_lum}
|
||||
?~ lum
|
||||
?~ had [~ ~]
|
||||
(lose "unclosed {<u.had>}")
|
||||
=> [ele=i.lum .(lum t.lum)]
|
||||
?. ?=(%html -.ele)
|
||||
?. ?=($html -.ele)
|
||||
(push (reso ele) ~)
|
||||
:: begin reparsing of html that the spec jankily lets through ::
|
||||
=+ tex=(trip (role p.ele))
|
||||
=^ mar lum (chomp tex (sear |=(a=marl ?~(a ~ (some a))) many:poxa))
|
||||
=^ mar lum (chomp tex (sear |=(a/marl ?~(a ~ (some a))) many:poxa))
|
||||
?^ mar
|
||||
(push u.mar)
|
||||
=^ hed lum (chomp tex head:poxa)
|
||||
@ -80,7 +83,7 @@
|
||||
?~ tal
|
||||
=^ cha lum (chomp tex prn)
|
||||
?^ cha
|
||||
(push :/([u.cha]~) ~)
|
||||
(push ;/([u.cha]~) ~)
|
||||
(push ;lost:"{tex}" ~)
|
||||
?: =(had tal)
|
||||
[~ lum]
|
||||
@ -90,66 +93,66 @@
|
||||
(lose "close {<u.tal>}")
|
||||
:: end reparsing of html that the spec jankily lets through ::
|
||||
::
|
||||
++ lose |=(a=tape [[;lost:"{a}"]~ lum])
|
||||
++ lose |=(a/tape [[;lost:"{a}"]~ lum])
|
||||
++ chomp
|
||||
|* [tap=tape fel=_rule]
|
||||
^- [(unit ,_(wonk *fel)) _lum]
|
||||
|* {tap/tape fel/rule}
|
||||
^- {(unit _(wonk *fel)) _lum}
|
||||
=+ vex=(fel 1^1 tap)
|
||||
?~ q.vex [~ lum]
|
||||
:- [~ (wonk vex)]
|
||||
?~(q.q.u.q.vex lum [[%html (lore (crip q.q.u.q.vex))] lum])
|
||||
::
|
||||
++ push
|
||||
|= a=marl
|
||||
|= a/marl
|
||||
^+ apex
|
||||
?~ a apex
|
||||
[[b p] q]:[b=i.a (push t.a)]
|
||||
::
|
||||
++ reso
|
||||
|= a=elem
|
||||
|= a/elem
|
||||
?^ -.a
|
||||
=. tig ?.(?=(%list -.p.a) tig p.p.a)
|
||||
?: &(tig ?=(%item -.p.a))
|
||||
=. tig ?.(?=($list -.p.a) tig p.p.a)
|
||||
?: &(tig ?=($item -.p.a))
|
||||
[/li (sang q.a)]
|
||||
%+ into-inner ^$(lum q.a)
|
||||
?- -.p.a
|
||||
%bloq ;blockquote;
|
||||
%item ;li;
|
||||
%list ?@ q.p.a ;ul;
|
||||
$bloq ;blockquote;
|
||||
$item ;li;
|
||||
$list ?@ q.p.a ;ul;
|
||||
?: =(1 p.q.p.a) ;ol;
|
||||
=+ num=(pojo (jone p.q.p.a))
|
||||
;ol(start num);
|
||||
==
|
||||
?- -.a :: :/("unimplemented {<p.a>}")
|
||||
%html !! :: handled earlier XX do type stuff
|
||||
%para [/p (sung p.a)]
|
||||
%head
|
||||
?- -.a :: ;/("unimplemented {<p.a>}")
|
||||
$html !! :: handled earlier XX do type stuff
|
||||
$para [/p (sung p.a)]
|
||||
$head
|
||||
=+ [hed=(add %h0 (lsh 3 1 p.a)) kid=(sung q.a)]
|
||||
[[hed id/(sanitize kid) ~] kid]
|
||||
[[hed id+(sanitize kid) ~] kid]
|
||||
::
|
||||
%hrul ;hr;
|
||||
%meta ?: =(~ p.a) :/(~)
|
||||
=+ jon=`json`o/(~(run by p.a) |=(cord s/+<))
|
||||
$hrul ;hr;
|
||||
$meta ?: =(~ p.a) ;/(~)
|
||||
=+ jon=`json`o+(~(run by p.a) |=(cord s++<))
|
||||
;meta(value "{(pojo jon)}", name "frontmatter", urb_front "");
|
||||
:: %html
|
||||
::=+ tex=(role (turn p.a crip))
|
||||
::=+ (poxa tex)
|
||||
::?^ - u.-
|
||||
::=+ (rush tex (star ;~(pose gah comt:poxa)))
|
||||
::?^ - :/(~)
|
||||
::?^ - ;/(~)
|
||||
::;lost: {<p.a>}
|
||||
:: :/([(role (turn p.a crip))]~) :: XX haaaaaaack
|
||||
%defn :/(~)
|
||||
%code =+ lan=?~(p.a ~ (first-word r.u.p.a))
|
||||
:: ;/([(role (turn p.a crip))]~) :: XX haaaaaaack
|
||||
$defn ;/(~)
|
||||
$code =+ lan=?~(p.a ~ (first-word r.u.p.a))
|
||||
=+ tex=(trip (role q.a))
|
||||
?~ lan ;pre:code:"{tex}"
|
||||
;pre:code(class "language-{u.lan}"):"{tex}"
|
||||
|
||||
==
|
||||
--
|
||||
::
|
||||
::
|
||||
++ sung
|
||||
|= lim=kids
|
||||
|= lim/kids
|
||||
=+ had=*(unit mane)
|
||||
|^ ^- marl
|
||||
=+ a=apex
|
||||
@ -158,14 +161,14 @@
|
||||
(weld p.a $(lim q.a))
|
||||
::
|
||||
++ apex
|
||||
^- [p=marl q=_lim]
|
||||
^- {p/marl q/_lim}
|
||||
?~ lim
|
||||
?~ had [~ ~]
|
||||
(lose "unclosed {<u.had>}")
|
||||
=> [ele=i.lim .(lim t.lim)]
|
||||
?. ?=(%htmt -.ele)
|
||||
?: &(?=(%$ -.ele) ?=([[%$ *] *] lim))
|
||||
apex(p.i.lim (weld p.ele p.i.lim))
|
||||
?. ?=($htmt -.ele)
|
||||
?: &(?=($$ -.ele) ?=({{$$ *} *} lim))
|
||||
apex(p.i.lim (weld p.ele p.i.lim))
|
||||
(push (reso ele) ~)
|
||||
=+ tex=(trip p.ele)
|
||||
=^ emo lim (chomp tex empt:poxa)
|
||||
@ -186,55 +189,54 @@
|
||||
(lose "unclosed {<u.had>}")
|
||||
(lose "unopened {<u.tal>}")
|
||||
::
|
||||
++ lose |=(a=tape [[;lost:"{a}"]~ lim])
|
||||
++ lose |=(a/tape [[;lost:"{a}"]~ lim])
|
||||
++ chomp
|
||||
|* [tap=tape fel=_rule]
|
||||
^- [(unit ,_(wonk *fel)) _lim]
|
||||
|* {tap/tape fel/rule}
|
||||
^- {(unit _(wonk *fel)) _lim}
|
||||
=+ vex=(fel 1^1 tap)
|
||||
?~ q.vex [~ lim]
|
||||
:- [~ (wonk vex)]
|
||||
?~(q.q.u.q.vex lim [[%htmt (crip q.q.u.q.vex)] lim])
|
||||
::
|
||||
++ push
|
||||
|= a=marl
|
||||
|= a/marl
|
||||
^+ apex
|
||||
?~ a apex
|
||||
[[b p] q]:[b=i.a (push t.a)]
|
||||
::
|
||||
++ urly
|
||||
|= a=tape ^- tape
|
||||
|= a/tape ^- tape
|
||||
?~ a ~
|
||||
:: ?: (gth i.a 0xff) "XX" :: XX
|
||||
?: ?| [?=(^ q)]:(alp 1^1 a)
|
||||
(~(has in (sa "!*'();:@&=+$,/?#%.~_")) i.a) :: XX reparse
|
||||
(~(has in (silt "!*'();:@&=+$,/?/%.~_")) i.a) :: XX reparse
|
||||
==
|
||||
[i.a $(a t.a)]
|
||||
(weld (urle (trip i.a)) $(a t.a))
|
||||
::
|
||||
++ reso
|
||||
|= b=inline
|
||||
|= b/inline
|
||||
^- manx
|
||||
?@ -.b
|
||||
?- -.b
|
||||
%$ :/(p.b)
|
||||
%line ;br;
|
||||
%code ;code:"{p.b}"
|
||||
%htmt !! ::p.b :: handled earlier :: XX do type stuff
|
||||
$$ ;/(p.b)
|
||||
$line ;br;
|
||||
$code ;code:"{p.b}"
|
||||
$htmt !! ::p.b :: handled earlier :: XX do type stuff
|
||||
==
|
||||
?: ?=(%blot -.p.b)
|
||||
?: ?=($blot -.p.b)
|
||||
=+ res=`manx`;img(src (urly p.p.b), alt (flat (turn q.b ..$)));
|
||||
:: ;img@"{p.p.b}";
|
||||
?~ q.p.b res
|
||||
res(a.g (welp a.g.res title/u.q.p.b ~))
|
||||
res(a.g (welp a.g.res title+u.q.p.b ~))
|
||||
=+ kid=(sung q.b)
|
||||
%+ into-inner kid
|
||||
?- p.b
|
||||
[%emph ?] ?.(p.p.b ;em; ;strong;)
|
||||
[%delt ~] ;del;
|
||||
[%link ^] =+ url=(urly p.p.b)
|
||||
=. url ?^(url url "#{(sanitize kid)}")
|
||||
?~ q.p.b ;a/"{url}";
|
||||
;a/"{url}"(title u.q.p.b);
|
||||
{$emph ?} ?.(p.p.b ;em; ;strong;)
|
||||
{$delt $~} ;del;
|
||||
{$link ^} =+ url=(urly p.p.b)
|
||||
=. url ?^(url url "#{(sanitize kid)}")
|
||||
?~ q.p.b ;a/"{url}";
|
||||
;a/"{url}"(title u.q.p.b);
|
||||
==
|
||||
--
|
||||
--
|
||||
|
361
lib/drum.hoon
361
lib/drum.hoon
@ -9,53 +9,53 @@
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
|% :: ::
|
||||
++ drum-part ,[%drum %0 drum-pith] ::
|
||||
++ drum-part {$drum $0 drum-pith} ::
|
||||
++ drum-pith ::
|
||||
$: eel=(set gill) :: connect to
|
||||
ray=(set well) ::
|
||||
fur=(map dude (unit server)) :: servers
|
||||
bin=(map bone source) :: terminals
|
||||
$: eel/(set gill) :: connect to
|
||||
ray/(set well) ::
|
||||
fur/(map dude (unit server)) :: servers
|
||||
bin/(map bone source) :: terminals
|
||||
== ::
|
||||
++ drum-start well :: start (local) server
|
||||
:: :: ::
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
++ server :: running server
|
||||
$: syd=desk :: app identity
|
||||
cas=case :: boot case
|
||||
$: syd/desk :: app identity
|
||||
cas/case :: boot case
|
||||
== ::
|
||||
++ source :: input device
|
||||
$: edg=_80 :: terminal columns
|
||||
off=@ud :: window offset
|
||||
kil=(unit (list ,@c)) :: kill buffer
|
||||
inx=@ud :: ring index
|
||||
fug=(map gill (unit target)) :: connections
|
||||
mir=(pair ,@ud (list ,@c)) :: mirrored terminal
|
||||
$: edg/_80 :: terminal columns
|
||||
off/@ud :: window offset
|
||||
kil/(unit (list @c)) :: kill buffer
|
||||
inx/@ud :: ring index
|
||||
fug/(map gill (unit target)) :: connections
|
||||
mir/(pair @ud (list @c)) :: mirrored terminal
|
||||
== ::
|
||||
++ master :: master buffer
|
||||
$: liv=? :: master is live
|
||||
tar=target :: master target
|
||||
$: liv/? :: master is live
|
||||
tar/target :: master target
|
||||
== ::
|
||||
++ history :: past input
|
||||
$: pos=@ud :: input position
|
||||
num=@ud :: number of entries
|
||||
lay=(map ,@ud (list ,@c)) :: editing overlay
|
||||
old=(list (list ,@c)) :: entries proper
|
||||
$: pos/@ud :: input position
|
||||
num/@ud :: number of entries
|
||||
lay/(map @ud (list @c)) :: editing overlay
|
||||
old/(list (list @c)) :: entries proper
|
||||
== ::
|
||||
++ search :: reverse-i-search
|
||||
$: pos=@ud :: search position
|
||||
str=(list ,@c) :: search string
|
||||
$: pos/@ud :: search position
|
||||
str/(list @c) :: search string
|
||||
== ::
|
||||
++ target :: application target
|
||||
$: ris=(unit search) :: reverse-i-search
|
||||
hit=history :: all past input
|
||||
pom=sole-prompt :: static prompt
|
||||
inp=sole-command :: input state
|
||||
$: ris/(unit search) :: reverse-i-search
|
||||
hit/history :: all past input
|
||||
pom/sole-prompt :: static prompt
|
||||
inp/sole-command :: input state
|
||||
== ::
|
||||
++ ukase :: master command
|
||||
$% [%add p=(list gill)] :: attach to
|
||||
[%del p=(list gill)] :: detach from
|
||||
[%new p=(list well)] :: create
|
||||
$% {$add p/(list gill)} :: attach to
|
||||
{$del p/(list gill)} :: detach from
|
||||
{$new p/(list well)} :: create
|
||||
== ::
|
||||
--
|
||||
:: :: ::
|
||||
@ -63,7 +63,7 @@
|
||||
:: :: ::
|
||||
|%
|
||||
++ deft-apes :: default servers
|
||||
|= our=ship
|
||||
|= our/ship
|
||||
%- ~(gas in *(set well))
|
||||
=+ myr=(clan our)
|
||||
?: =(%pawn myr)
|
||||
@ -73,7 +73,7 @@
|
||||
[[%home %talk] [%home %dojo] ~]
|
||||
::
|
||||
++ deft-fish :: default connects
|
||||
|= our=ship
|
||||
|= our/ship
|
||||
%- ~(gas in *(set gill))
|
||||
^- (list gill)
|
||||
=+ myr=(clan our)
|
||||
@ -82,17 +82,17 @@
|
||||
[[our %talk] [our %dojo] ~]
|
||||
::
|
||||
++ deft-mast :: default master
|
||||
|= our=ship
|
||||
|= our/ship
|
||||
^- master
|
||||
:* %&
|
||||
*(unit search)
|
||||
*history
|
||||
[%& %sole "{(scow %p our)}# "]
|
||||
[%& %sole "{(scow %p our)}/ "]
|
||||
*sole-command
|
||||
==
|
||||
::
|
||||
++ deft-pipe :: default source
|
||||
|= our=ship ::
|
||||
|= our/ship ::
|
||||
^- source ::
|
||||
:* 80 :: edg
|
||||
0 :: off
|
||||
@ -104,7 +104,7 @@
|
||||
::
|
||||
++ deft-tart *target :: default target
|
||||
++ drum-port :: initial part
|
||||
|= our=ship
|
||||
|= our/ship
|
||||
^- drum-part
|
||||
:* %drum
|
||||
%0
|
||||
@ -115,72 +115,71 @@
|
||||
== ::
|
||||
::
|
||||
++ drum-path :: encode path
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
[%drum %phat (scot %p p.gyl) q.gyl ~]
|
||||
::
|
||||
++ drum-phat :: decode path
|
||||
|= way=wire ^- gill
|
||||
?>(?=([@ @ ~] way) [(slav %p i.way) i.t.way])
|
||||
|= way/wire ^- gill
|
||||
?>(?=({@ @ $~} way) [(slav %p i.way) i.t.way])
|
||||
--
|
||||
!:
|
||||
::::
|
||||
::
|
||||
|= [bowl drum-part] :: main drum work
|
||||
|= {bowl drum-part} :: main drum work
|
||||
=+ (fall (~(get by bin) ost) (deft-pipe our))
|
||||
=* dev -
|
||||
=> |% :: arvo structures
|
||||
++ pear :: request
|
||||
$% [%sole-action p=sole-action] ::
|
||||
[%talk-command command:talk] ::
|
||||
$% {$sole-action p/sole-action} ::
|
||||
{$talk-command command:talk} ::
|
||||
== ::
|
||||
++ lime :: update
|
||||
$% [%dill-blit dill-blit] ::
|
||||
$% {$dill-blit dill-blit} ::
|
||||
== ::
|
||||
++ card :: general card
|
||||
$% [%conf wire dock %load ship term] ::
|
||||
[%diff lime] ::
|
||||
[%peer wire dock path] ::
|
||||
[%poke wire dock pear] ::
|
||||
[%pull wire dock ~] ::
|
||||
[%pass wire note] ::
|
||||
$% {$conf wire dock $load ship term} ::
|
||||
{$diff lime} ::
|
||||
{$peer wire dock path} ::
|
||||
{$poke wire dock pear} ::
|
||||
{$pull wire dock $~} ::
|
||||
== ::
|
||||
++ move (pair bone card) :: user-level move
|
||||
--
|
||||
|_ [moz=(list move) biz=(list dill-blit)]
|
||||
|_ {moz/(list move) biz/(list dill-blit)}
|
||||
++ diff-sole-effect-phat ::
|
||||
|= [way=wire fec=sole-effect]
|
||||
|= {way/wire fec/sole-effect}
|
||||
=< se-abet =< se-view
|
||||
=+ gyl=(drum-phat way)
|
||||
?: (se-aint gyl) +>.$
|
||||
(se-diff gyl fec)
|
||||
::
|
||||
++ peer ::
|
||||
|= pax=path =< se-abet
|
||||
|= pax/path =< se-abet
|
||||
^+ +>
|
||||
?. ?| =(our src) :: ourself
|
||||
&(=(%duke (clan our)) =(our (sein src))) :: or our own yacht
|
||||
== ::
|
||||
~| [%drum-unauthorized our/our src/src] :: very simplistic
|
||||
~| [%drum-unauthorized our+our src+src] :: very simplistic
|
||||
!!
|
||||
se-view:(se-text "[{<src>}, driving {<our>}]")
|
||||
::
|
||||
++ poke-dill-belt ::
|
||||
|= bet=dill-belt
|
||||
|= bet/dill-belt
|
||||
=< se-abet =< se-view
|
||||
(se-belt bet)
|
||||
::
|
||||
++ poke-start ::
|
||||
|= wel=well
|
||||
|= wel/well
|
||||
=< se-abet =< se-view
|
||||
(se-born wel)
|
||||
::
|
||||
++ poke-link ::
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
=< se-abet =< se-view
|
||||
(se-link gyl)
|
||||
::
|
||||
++ poke-unlink ::
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
=< se-abet =< se-view
|
||||
(se-klin gyl)
|
||||
::
|
||||
@ -188,7 +187,7 @@
|
||||
:: |=(~ se-abet:(se-blit `dill-blit`[%qit ~])) :: XX find bone
|
||||
:: ::
|
||||
++ reap-phat ::
|
||||
|= [way=wire saw=(unit tang)]
|
||||
|= {way/wire saw/(unit tang)}
|
||||
=< se-abet =< se-view
|
||||
=+ gyl=(drum-phat way)
|
||||
?~ saw
|
||||
@ -196,7 +195,7 @@
|
||||
(se-dump:(se-drop & gyl) u.saw)
|
||||
::
|
||||
++ take-coup-phat ::
|
||||
|= [way=wire saw=(unit tang)]
|
||||
|= {way/wire saw/(unit tang)}
|
||||
=< se-abet =< se-view
|
||||
?~ saw +>
|
||||
=+ gyl=(drum-phat way)
|
||||
@ -205,20 +204,20 @@
|
||||
(se-dump:(se-drop & gyl) u.saw)
|
||||
::
|
||||
++ take-onto ::
|
||||
|= [way=wire saw=(each suss tang)]
|
||||
|= {way/wire saw/(each suss tang)}
|
||||
=< se-abet =< se-view
|
||||
?> ?=([@ @ ~] way)
|
||||
?> ?=({@ @ $~} way)
|
||||
?> (~(has by fur) i.t.way)
|
||||
=+ wel=`well`[i.way i.t.way]
|
||||
?- -.saw
|
||||
%| (se-dump p.saw)
|
||||
%& ?> =(q.wel p.p.saw)
|
||||
$| (se-dump p.saw)
|
||||
$& ?> =(q.wel p.p.saw)
|
||||
:: =. +>.$ (se-text "live {<p.saw>}")
|
||||
+>.$(fur (~(put by fur) q.wel `[p.wel %da r.p.saw]))
|
||||
==
|
||||
::
|
||||
++ quit-phat ::
|
||||
|= way=wire
|
||||
|= way/wire
|
||||
=< se-abet =< se-view
|
||||
=+ gyl=(drum-phat way)
|
||||
~& [%drum-quit src ost gyl]
|
||||
@ -244,10 +243,10 @@
|
||||
^+ .
|
||||
%+ roll (~(tap in ray))
|
||||
=< .(con +>)
|
||||
|= [wel=well con=_..se-adit] ^+ con
|
||||
|= {wel/well con/_..se-adit} ^+ con
|
||||
=. +>.$ con
|
||||
=+ hig=(~(get by fur) q.wel)
|
||||
?: &(?=(^ hig) |(?=(~ u.hig) =(p.wel syd.u.u.hig))) +>.$
|
||||
?: &(?=(^ hig) |(?=($~ u.hig) =(p.wel syd.u.u.hig))) +>.$
|
||||
=. +>.$ (se-text "activated app {(trip p.wel)}/{(trip q.wel)}")
|
||||
%- se-emit(fur (~(put by fur) q.wel ~))
|
||||
[ost %conf [%drum p.wel q.wel ~] [our q.wel] %load our p.wel]
|
||||
@ -256,7 +255,7 @@
|
||||
^+ .
|
||||
%+ roll (~(tap in eel))
|
||||
=< .(con +>)
|
||||
|= [gil=gill con=_.] ^+ con
|
||||
|= {gil/gill con/_.} ^+ con
|
||||
=. +>.$ con
|
||||
?: (~(has by fug) gil)
|
||||
+>.$
|
||||
@ -268,7 +267,7 @@
|
||||
^+ .
|
||||
%- ~(rep by bin)
|
||||
=< .(con +>)
|
||||
|= [[ost=bone dev=source] con=_.] ^+ con
|
||||
|= {{ost/bone dev/source} con/_.} ^+ con
|
||||
=+ xeno=se-subze-local:%_(con ost ost, dev dev)
|
||||
xeno(ost ost.con, dev dev.con, bin (~(put by bin) ost dev.xeno))
|
||||
::
|
||||
@ -276,21 +275,21 @@
|
||||
^+ .
|
||||
%- ~(rep by fug)
|
||||
=< .(con +>)
|
||||
|= [[gil=gill *] con=_.] ^+ con
|
||||
|= {{gil/gill *} con/_.} ^+ con
|
||||
=. +>.$ con
|
||||
?: (~(has in eel) gil)
|
||||
+>.$
|
||||
(se-nuke gil)
|
||||
::
|
||||
++ se-aint :: ignore result
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
^- ?
|
||||
?. (~(has by bin) ost) &
|
||||
=+ gyr=(~(get by fug) gyl)
|
||||
|(?=(~ gyr) ?=([~ ~] gyr))
|
||||
|(?=($~ gyr) ?=({$~ $~} gyr))
|
||||
::
|
||||
++ se-alas :: recalculate index
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
^+ +>
|
||||
=+ [xin=0 wag=se-amor]
|
||||
?: =(~ wag) +>.$(inx 0)
|
||||
@ -301,12 +300,12 @@
|
||||
::
|
||||
++ se-amor :: live targets
|
||||
^- (list gill)
|
||||
(skim (~(tap in eel)) |=(gill ?=([~ ~ *] (~(get by fug) +<))))
|
||||
(skim (~(tap in eel)) |=(gill ?=({$~ $~ *} (~(get by fug) +<))))
|
||||
::
|
||||
++ se-anon :: rotate index
|
||||
=+ wag=se-amor
|
||||
?~ wag +
|
||||
:: ~& [%se-anon inx/inx wag/wag nex/(mod +(inx) (lent se-amor))]
|
||||
:: ~& [%se-anon inx+inx wag+wag nex+(mod +(inx) (lent se-amor))]
|
||||
+(inx (mod +(inx) (lent se-amor)))
|
||||
::
|
||||
++ se-agon :: current gill
|
||||
@ -316,11 +315,11 @@
|
||||
`(snag inx se-amor)
|
||||
::
|
||||
++ se-belt :: handle input
|
||||
|= bet=dill-belt
|
||||
|= bet/dill-belt
|
||||
^+ +>
|
||||
?: ?=(%rez -.bet)
|
||||
?: ?=($rez -.bet)
|
||||
+>(edg (dec p.bet))
|
||||
?: ?=(%yow -.bet)
|
||||
?: ?=($yow -.bet)
|
||||
~& [%no-yow -.bet]
|
||||
+>
|
||||
=+ gul=se-agon
|
||||
@ -329,26 +328,26 @@
|
||||
=+ taz=~(. ta [& (need gul)] `target`(need (need tur)))
|
||||
=< ta-abet
|
||||
?- -.bet
|
||||
%aro (ta-aro:taz p.bet)
|
||||
%bac ta-bac:taz
|
||||
%cru (ta-cru:taz p.bet q.bet)
|
||||
%ctl (ta-ctl:taz p.bet)
|
||||
%del ta-del:taz
|
||||
%hey taz(mir [0 ~])
|
||||
%met (ta-met:taz p.bet)
|
||||
%ret ta-ret:taz
|
||||
%txt (ta-txt:taz p.bet)
|
||||
$aro (ta-aro:taz p.bet)
|
||||
$bac ta-bac:taz
|
||||
$cru (ta-cru:taz p.bet q.bet)
|
||||
$ctl (ta-ctl:taz p.bet)
|
||||
$del ta-del:taz
|
||||
$hey taz(mir [0 ~])
|
||||
$met (ta-met:taz p.bet)
|
||||
$ret ta-ret:taz
|
||||
$txt (ta-txt:taz p.bet)
|
||||
==
|
||||
::
|
||||
++ se-born :: new server
|
||||
|= wel=well
|
||||
|= wel/well
|
||||
^+ +>
|
||||
?: (~(has in ray) wel)
|
||||
(se-text "[already running {<p.wel>}/{<q.wel>}]")
|
||||
+>(ray (~(put in ray) wel), eel (~(put in eel) [our q.wel]))
|
||||
::
|
||||
++ se-drop :: disconnect
|
||||
|= [pej=? gyl=gill]
|
||||
|= {pej/? gyl/gill}
|
||||
^+ +>
|
||||
=+ lag=se-agon
|
||||
?. (~(has by fug) gyl) +>.$
|
||||
@ -363,16 +362,16 @@
|
||||
+>.$
|
||||
::
|
||||
++ se-dump :: print tanks
|
||||
|= tac=(list tank)
|
||||
|= tac/(list tank)
|
||||
^+ +>
|
||||
?. se-ably (se-talk tac)
|
||||
=+ wol=`wall`(zing (turn (flop tac) |=(a=tank (~(win re a) [0 edg]))))
|
||||
=+ wol=`wall`(zing (turn (flop tac) |=(a/tank (~(win re a) [0 edg]))))
|
||||
|- ^+ +>.^$
|
||||
?~ wol +>.^$
|
||||
$(wol t.wol, +>.^$ (se-blit %out (tuba i.wol)))
|
||||
::
|
||||
++ se-joke :: prepare connection
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
^+ +>
|
||||
=+ lag=se-agon
|
||||
?~ lag +>.$
|
||||
@ -380,31 +379,31 @@
|
||||
(se-alas(fug (~(put by fug) gyl ~)) u.lag)
|
||||
::
|
||||
++ se-join :: confirm connection
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
^+ +>
|
||||
=. +> (se-text "[linked to {<gyl>}]")
|
||||
?> =(~ (~(got by fug) gyl))
|
||||
(se-alas(fug (~(put by fug) gyl `*target)) gyl)
|
||||
::
|
||||
++ se-nuke :: teardown
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
^+ +>
|
||||
(se-drop:(se-pull gyl) & gyl)
|
||||
::
|
||||
++ se-like :: act in master
|
||||
|= kus=ukase
|
||||
|= kus/ukase
|
||||
?- -.kus
|
||||
%add
|
||||
$add
|
||||
|- ^+ +>.^$
|
||||
?~ p.kus +>.^$
|
||||
$(p.kus t.p.kus, +>.^$ (se-link i.p.kus))
|
||||
::
|
||||
%del
|
||||
$del
|
||||
|- ^+ +>.^$
|
||||
?~ p.kus +>.^$
|
||||
$(p.kus t.p.kus, +>.^$ (se-nuke i.p.kus))
|
||||
::
|
||||
%new
|
||||
$new
|
||||
|- ^+ +>.^$
|
||||
?~ p.kus +>.^$
|
||||
$(p.kus t.p.kus, +>.^$ (se-born i.p.kus))
|
||||
@ -423,31 +422,31 @@
|
||||
%+ weld
|
||||
^- (list tape)
|
||||
%+ turn (~(tap by fug))
|
||||
|= [a=gill b=(unit target)]
|
||||
|= {a/gill b/(unit target)}
|
||||
=+ c=(yey a)
|
||||
?~(b ['?' c] c)
|
||||
^- (list tape)
|
||||
%+ turn (skip (~(tap by fur)) |=([term *] (~(has by fug) [our +<-])))
|
||||
|=([term *] ['-' (pry our +<-)])
|
||||
%+ turn (skip (~(tap by fur)) |=({term *} (~(has by fug) [our +<-])))
|
||||
|=({term *} ['-' (pry our +<-)])
|
||||
|- ^- tape
|
||||
?~ yal ~
|
||||
?~ t.yal i.yal
|
||||
:(welp i.yal ", " $(yal t.yal))
|
||||
::
|
||||
++ se-klin :: disconnect app
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
+>(eel (~(del in eel) gyl))
|
||||
::
|
||||
++ se-link :: connect to app
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
+>(eel (~(put in eel) gyl))
|
||||
::
|
||||
++ se-blit :: give output
|
||||
|= bil=dill-blit
|
||||
|= bil/dill-blit
|
||||
+>(biz [bil biz])
|
||||
::
|
||||
++ se-show :: show buffer, raw
|
||||
|= lin=(pair ,@ud (list ,@c))
|
||||
|= lin/(pair @ud (list @c))
|
||||
^+ +>
|
||||
?: =(mir lin) +>
|
||||
=. +> ?:(=(q.mir q.lin) +> (se-blit %pro q.lin))
|
||||
@ -455,7 +454,7 @@
|
||||
+>(mir lin)
|
||||
::
|
||||
++ se-just :: adjusted buffer
|
||||
|= lin=(pair ,@ud (list ,@c))
|
||||
|= lin/(pair @ud (list @c))
|
||||
^+ +>
|
||||
=. off ?:((lth p.lin edg) 0 (sub p.lin edg))
|
||||
(se-show (sub p.lin off) (scag edg (slag off q.lin)))
|
||||
@ -470,45 +469,45 @@
|
||||
~(ta-vew ta [& u.gul] u.u.gyr)
|
||||
::
|
||||
++ se-emit :: emit move
|
||||
|= mov=move
|
||||
|= mov/move
|
||||
%_(+> moz [mov moz])
|
||||
::
|
||||
++ se-talk
|
||||
|= tac=(list tank)
|
||||
|= tac/(list tank)
|
||||
^+ +>
|
||||
(se-emit 0 %poke /drum/talk [our %talk] (said:talk our %drum now eny tac))
|
||||
::
|
||||
++ se-text :: return text
|
||||
|= txt=tape
|
||||
|= txt/tape
|
||||
^+ +>
|
||||
?. se-ably (se-talk [%leaf txt]~)
|
||||
(se-blit %out (tuba txt))
|
||||
::
|
||||
++ se-poke :: send a poke
|
||||
|= [gyl=gill par=pear]
|
||||
|= {gyl/gill par/pear}
|
||||
(se-emit ost %poke (drum-path gyl) gyl par)
|
||||
::
|
||||
++ se-peer :: send a peer
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
(se-emit(fug (~(put by fug) gyl ~)) ost %peer (drum-path gyl) gyl /sole)
|
||||
::
|
||||
++ se-pull :: cancel subscription
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
(se-emit ost %pull (drum-path gyl) gyl ~)
|
||||
::
|
||||
++ se-tame :: switch connection
|
||||
|= gyl=gill
|
||||
|= gyl/gill
|
||||
^+ ta
|
||||
~(. ta [& gyl] (need (~(got by fug) gyl)))
|
||||
::
|
||||
++ se-diff :: receive results
|
||||
|= [gyl=gill fec=sole-effect]
|
||||
|= {gyl/gill fec/sole-effect}
|
||||
^+ +>
|
||||
ta-abet:(ta-fec:(se-tame gyl) fec)
|
||||
::
|
||||
++ ta :: per target
|
||||
|_ $: $: liv=? :: don't delete
|
||||
gyl=gill :: target app
|
||||
|_ $: $: liv/? :: don't delete
|
||||
gyl/gill :: target app
|
||||
== ::
|
||||
target :: target state
|
||||
== ::
|
||||
@ -516,39 +515,39 @@
|
||||
^+ ..ta
|
||||
?. liv
|
||||
?: (~(has in (deft-fish our)) gyl)
|
||||
(se-blit qit/~)
|
||||
(se-blit qit+~)
|
||||
(se-nuke gyl)
|
||||
..ta(fug (~(put by fug) gyl ``target`+<+))
|
||||
::
|
||||
++ ta-poke |=(a=pear +>(..ta (se-poke gyl a))) :: poke gyl
|
||||
++ ta-poke |=(a/pear +>(..ta (se-poke gyl a))) :: poke gyl
|
||||
::
|
||||
++ ta-act :: send action
|
||||
|= act=sole-action
|
||||
|= act/sole-action
|
||||
^+ +>
|
||||
(ta-poke %sole-action act)
|
||||
::
|
||||
++ ta-aro :: hear arrow
|
||||
|= key=?(%d %l %r %u)
|
||||
|= key/?($d $l $r $u)
|
||||
^+ +>
|
||||
?- key
|
||||
%d =. ris ~
|
||||
$d =. ris ~
|
||||
?. =(num.hit pos.hit)
|
||||
(ta-mov +(pos.hit))
|
||||
?: =(0 (lent buf.say.inp))
|
||||
ta-bel
|
||||
(ta-hom:ta-nex %set ~)
|
||||
%l ?: =(0 pos.inp) ta-bel
|
||||
$l ?: =(0 pos.inp) ta-bel
|
||||
+>(pos.inp (dec pos.inp), ris ~)
|
||||
%r ?: =((lent buf.say.inp) pos.inp)
|
||||
$r ?: =((lent buf.say.inp) pos.inp)
|
||||
ta-bel
|
||||
+>(pos.inp +(pos.inp), ris ~)
|
||||
%u =. ris ~
|
||||
$u =. ris ~
|
||||
?:(=(0 pos.hit) ta-bel (ta-mov (dec pos.hit)))
|
||||
==
|
||||
::
|
||||
++ ta-bel .(+> (se-blit %bel ~)) :: beep
|
||||
++ ta-cat :: mass insert
|
||||
|= [pos=@ud txt=(list ,@c)]
|
||||
|= {pos/@ud txt/(list @c)}
|
||||
^- sole-edit
|
||||
:- %mor
|
||||
|- ^- (list sole-edit)
|
||||
@ -556,13 +555,13 @@
|
||||
[[%ins pos i.txt] $(pos +(pos), txt t.txt)]
|
||||
::
|
||||
++ ta-cut :: mass delete
|
||||
|= [pos=@ud num=@ud]
|
||||
|= {pos/@ud num/@ud}
|
||||
^- sole-edit
|
||||
:- %mor
|
||||
|-(?:(=(0 num) ~ [[%del pos] $(num (dec num))]))
|
||||
::
|
||||
++ ta-det :: send edit
|
||||
|= ted=sole-edit
|
||||
|= ted/sole-edit
|
||||
^+ +>
|
||||
(ta-act %det [[his.ven.say.inp own.ven.say.inp] (sham buf.say.inp) ted])
|
||||
::
|
||||
@ -579,33 +578,33 @@
|
||||
(ta-hom %del pre)
|
||||
::
|
||||
++ ta-ctl :: hear control
|
||||
|= key=@ud
|
||||
|= key/@ud
|
||||
^+ +>
|
||||
?+ key ta-bel
|
||||
%a +>(pos.inp 0, ris ~)
|
||||
%b (ta-aro %l)
|
||||
%c ta-bel(ris ~)
|
||||
%d ?: &(=(0 pos.inp) =(0 (lent buf.say.inp)))
|
||||
$a +>(pos.inp 0, ris ~)
|
||||
$b (ta-aro %l)
|
||||
$c ta-bel(ris ~)
|
||||
$d ?: &(=(0 pos.inp) =(0 (lent buf.say.inp)))
|
||||
+>(liv |)
|
||||
ta-del
|
||||
%e +>(pos.inp (lent buf.say.inp))
|
||||
%f (ta-aro %r)
|
||||
%g ?~ ris ta-bel
|
||||
$e +>(pos.inp (lent buf.say.inp))
|
||||
$f (ta-aro %r)
|
||||
$g ?~ ris ta-bel
|
||||
(ta-hom(pos.hit num.hit, ris ~) [%set ~])
|
||||
%k =+ len=(lent buf.say.inp)
|
||||
$k =+ len=(lent buf.say.inp)
|
||||
?: =(pos.inp len)
|
||||
ta-bel
|
||||
%- ta-hom(kil `(slag pos.inp buf.say.inp), ris ~)
|
||||
(ta-cut pos.inp (sub len pos.inp))
|
||||
%l +>(+> (se-blit %clr ~))
|
||||
%n (ta-aro %d)
|
||||
%p (ta-aro %u)
|
||||
%r ?~ ris
|
||||
$l +>(+> (se-blit %clr ~))
|
||||
$n (ta-aro %d)
|
||||
$p (ta-aro %u)
|
||||
$r ?~ ris
|
||||
+>(ris `[pos.hit ~])
|
||||
?: =(0 pos.u.ris)
|
||||
ta-bel
|
||||
(ta-ser ~)
|
||||
%t =+ len=(lent buf.say.inp)
|
||||
$t =+ len=(lent buf.say.inp)
|
||||
?: |(=(0 pos.inp) (lth len 2))
|
||||
ta-bel
|
||||
=+ sop=?:(=(len pos.inp) (dec pos.inp) pos.inp)
|
||||
@ -616,18 +615,18 @@
|
||||
[%del sop]
|
||||
[%ins (dec sop) (snag sop buf.say.inp)]
|
||||
==
|
||||
%u ?: =(0 pos.inp)
|
||||
$u ?: =(0 pos.inp)
|
||||
ta-bel
|
||||
%- ta-hom(kil `(scag pos.inp buf.say.inp), ris ~)
|
||||
(ta-cut 0 pos.inp)
|
||||
%v ta-bel
|
||||
%x +>(+> se-anon)
|
||||
%y ?~ kil ta-bel
|
||||
$v ta-bel
|
||||
$x +>(+> se-anon)
|
||||
$y ?~ kil ta-bel
|
||||
(ta-hom(ris ~) (ta-cat pos.inp u.kil))
|
||||
==
|
||||
::
|
||||
++ ta-cru :: hear crud
|
||||
|= [lab=@tas tac=(list tank)]
|
||||
|= {lab/@tas tac/(list tank)}
|
||||
=. +>+> (se-text (trip lab))
|
||||
(ta-tan tac)
|
||||
::
|
||||
@ -638,71 +637,71 @@
|
||||
(ta-hom %del pos.inp)
|
||||
::
|
||||
++ ta-erl :: hear local error
|
||||
|= pos=@ud
|
||||
|= pos/@ud
|
||||
ta-bel(pos.inp (min pos (lent buf.say.inp)))
|
||||
::
|
||||
++ ta-err :: hear remote error
|
||||
|= pos=@ud
|
||||
|= pos/@ud
|
||||
(ta-erl (~(transpose sole say.inp) pos))
|
||||
::
|
||||
++ ta-fec :: apply effect
|
||||
|= fec=sole-effect
|
||||
|= fec/sole-effect
|
||||
^+ +>
|
||||
?- -.fec
|
||||
%bel ta-bel
|
||||
%blk +>
|
||||
%clr +>(+> (se-blit fec))
|
||||
%det (ta-got +.fec)
|
||||
%err (ta-err +.fec)
|
||||
%mor |- ^+ +>.^$
|
||||
$bel ta-bel
|
||||
$blk +>
|
||||
$clr +>(+> (se-blit fec))
|
||||
$det (ta-got +.fec)
|
||||
$err (ta-err +.fec)
|
||||
$mor |- ^+ +>.^$
|
||||
?~ p.fec +>.^$
|
||||
$(p.fec t.p.fec, +>.^$ ^$(fec i.p.fec))
|
||||
%nex ta-nex
|
||||
%pro (ta-pro +.fec)
|
||||
%tan (ta-tan p.fec)
|
||||
%sag +>(+> (se-blit fec))
|
||||
%sav +>(+> (se-blit fec))
|
||||
%txt $(fec [%tan [%leaf p.fec]~])
|
||||
%url +>(+> (se-blit fec))
|
||||
$nex ta-nex
|
||||
$pro (ta-pro +.fec)
|
||||
$tan (ta-tan p.fec)
|
||||
$sag +>(+> (se-blit fec))
|
||||
$sav +>(+> (se-blit fec))
|
||||
$txt $(fec [%tan [%leaf p.fec]~])
|
||||
$url +>(+> (se-blit fec))
|
||||
==
|
||||
::
|
||||
++ ta-dog :: change cursor
|
||||
|= ted=sole-edit
|
||||
|= ted/sole-edit
|
||||
%_ +>
|
||||
pos.inp
|
||||
=+ len=(lent buf.say.inp)
|
||||
%+ min len
|
||||
|- ^- @ud
|
||||
?- -.ted
|
||||
%del ?:((gth pos.inp p.ted) (dec pos.inp) pos.inp)
|
||||
%ins ?:((gte pos.inp p.ted) +(pos.inp) pos.inp)
|
||||
%mor |- ^- @ud
|
||||
$del ?:((gth pos.inp p.ted) (dec pos.inp) pos.inp)
|
||||
$ins ?:((gte pos.inp p.ted) +(pos.inp) pos.inp)
|
||||
$mor |- ^- @ud
|
||||
?~ p.ted pos.inp
|
||||
$(p.ted t.p.ted, pos.inp ^$(ted i.p.ted))
|
||||
%nop pos.inp
|
||||
%set len
|
||||
$nop pos.inp
|
||||
$set len
|
||||
==
|
||||
==
|
||||
::
|
||||
++ ta-got :: apply change
|
||||
|= cal=sole-change
|
||||
|= cal/sole-change
|
||||
=^ ted say.inp (~(receive sole say.inp) cal)
|
||||
(ta-dog ted)
|
||||
::
|
||||
++ ta-hom :: local edit
|
||||
|= ted=sole-edit
|
||||
|= ted/sole-edit
|
||||
^+ +>
|
||||
=. +> (ta-det ted)
|
||||
=. +> (ta-dog(say.inp (~(commit sole say.inp) ted)) ted)
|
||||
+>
|
||||
::
|
||||
++ ta-met :: meta key
|
||||
|= key=@ud
|
||||
|= key/@ud
|
||||
~& [%ta-met key]
|
||||
+>
|
||||
::
|
||||
++ ta-mov :: move in history
|
||||
|= sop=@ud
|
||||
|= sop/@ud
|
||||
^+ +>
|
||||
?: =(sop pos.hit) +>
|
||||
%+ %= ta-hom
|
||||
@ -725,27 +724,27 @@
|
||||
==
|
||||
::
|
||||
++ ta-pro :: set prompt
|
||||
|= pom=sole-prompt
|
||||
|= pom/sole-prompt
|
||||
+>(pom pom(cad :(welp (scow %p p.gyl) ":" (trip q.gyl) cad.pom)))
|
||||
::
|
||||
++ ta-ret :: hear return
|
||||
(ta-act %ret ~)
|
||||
::
|
||||
++ ta-ser :: reverse search
|
||||
|= ext=(list ,@c)
|
||||
|= ext/(list @c)
|
||||
^+ +>
|
||||
?: |(?=(~ ris) =(0 pos.u.ris)) ta-bel
|
||||
?: |(?=($~ ris) =(0 pos.u.ris)) ta-bel
|
||||
=+ sop=?~(ext (dec pos.u.ris) pos.u.ris)
|
||||
=+ tot=(weld str.u.ris ext)
|
||||
=+ dol=(slag (sub num.hit sop) old.hit)
|
||||
=+ ^= ser
|
||||
=+ ^= beg
|
||||
|= [a=(list ,@c) b=(list ,@c)] ^- ?
|
||||
|= {a/(list @c) b/(list @c)} ^- ?
|
||||
?~(a & ?~(b | &(=(i.a i.b) $(a t.a, b t.b))))
|
||||
|= [a=(list ,@c) b=(list ,@c)] ^- ?
|
||||
|= {a/(list @c) b/(list @c)} ^- ?
|
||||
?~(a & ?~(b | |((beg a b) $(b t.b))))
|
||||
=+ ^= sup
|
||||
|- ^- (unit ,@ud)
|
||||
|- ^- (unit @ud)
|
||||
?~ dol ~
|
||||
?: (ser tot i.dol)
|
||||
`sop
|
||||
@ -754,14 +753,14 @@
|
||||
(ta-mov(str.u.ris tot, pos.u.ris u.sup) (dec u.sup))
|
||||
::
|
||||
++ ta-tan :: print tanks
|
||||
|= tac=(list tank)
|
||||
=+ wol=`wall`(zing (turn (flop tac) |=(a=tank (~(win re a) [0 edg]))))
|
||||
|= tac/(list tank)
|
||||
=+ wol=`wall`(zing (turn (flop tac) |=(a/tank (~(win re a) [0 edg]))))
|
||||
|- ^+ +>.^$
|
||||
?~ wol +>.^$
|
||||
$(wol t.wol, +>+>.^$ (se-text i.wol))
|
||||
::
|
||||
++ ta-txt :: hear text
|
||||
|= txt=(list ,@c)
|
||||
|= txt/(list @c)
|
||||
^+ +>
|
||||
?^ ris
|
||||
(ta-ser txt)
|
||||
@ -772,7 +771,7 @@
|
||||
[[%ins pos.inp i.txt] $(pos.inp +(pos.inp), txt t.txt)]
|
||||
::
|
||||
++ ta-vew :: computed prompt
|
||||
|- ^- (pair ,@ud (list ,@c))
|
||||
|- ^- (pair @ud (list @c))
|
||||
?^ ris
|
||||
%= $
|
||||
ris ~
|
||||
@ -780,7 +779,7 @@
|
||||
:(welp "(reverse-i-search)'" (tufa str.u.ris) "': ")
|
||||
==
|
||||
=- [(add pos.inp (lent p.vew)) (weld (tuba p.vew) q.vew)]
|
||||
^= vew ^- (pair tape (list ,@c))
|
||||
^= vew ^- (pair tape (list @c))
|
||||
?: vis.pom [cad.pom buf.say.inp]
|
||||
:- ;: welp
|
||||
cad.pom
|
||||
@ -792,7 +791,7 @@
|
||||
==
|
||||
==
|
||||
=+ len=(lent buf.say.inp)
|
||||
|- ^- (list ,@c)
|
||||
|- ^- (list @c)
|
||||
?:(=(0 len) ~ [`@c`'*' $(len (dec len))])
|
||||
--
|
||||
--
|
||||
|
@ -1,23 +1,23 @@
|
||||
::
|
||||
:::: /hoon/frontmatter/lib
|
||||
:::: /hoon+frontmatter+lib
|
||||
::
|
||||
/? 314
|
||||
!:
|
||||
|%
|
||||
++ atr-lines
|
||||
|= atr=(map cord cord)
|
||||
%+ turn (sort (~(tap by atr)) |=([[a=@ @] [b=@ @]] (aor a b)))
|
||||
|= [k=cord v=cord]
|
||||
|= atr/(map cord cord)
|
||||
%+ turn (sort (~(tap by atr)) |=({{a/@ @} {b/@ @}} (aor a b)))
|
||||
|= {k/cord v/cord}
|
||||
(rap 3 k ': ' v ~)
|
||||
::
|
||||
++ atr-key ;~(sfix (star ;~(less col prn)) col ace)
|
||||
++ print
|
||||
|= [atr=(map cord cord) src=wain]
|
||||
|= {atr/(map cord cord) src/wain}
|
||||
?~ atr src
|
||||
['---' (welp (atr-lines atr) '---' src)]
|
||||
++ parse
|
||||
=| atr=(map cord cord)
|
||||
|= wan=wain ^+ [atr mud='']
|
||||
=| atr/(map cord cord)
|
||||
|= wan/wain ^+ [atr mud='']
|
||||
?~ wan [~ '']
|
||||
?^ (rush i.wan (star ace))
|
||||
$(wan t.wan)
|
||||
@ -28,7 +28,7 @@
|
||||
?^ (rush i.t.wan (star ace))
|
||||
$(wan t.wan)
|
||||
=- $(wan t.wan, atr (~(put by atr) (crip key) (crip val)))
|
||||
~| malformed-attribute/i.t.wan
|
||||
^- [key=tape ^ val=tape]
|
||||
~| malformed-attribute+i.t.wan
|
||||
^- {key/tape ^ val/tape}
|
||||
+>:(atr-key 1^1 (trip i.t.wan))
|
||||
--
|
||||
|
139
lib/helm.hoon
139
lib/helm.hoon
@ -1,5 +1,5 @@
|
||||
:: :: ::
|
||||
:::: /hoon/helm/lib :: ::
|
||||
:::: /hoon/helm/lib :: ::
|
||||
:: :: ::
|
||||
/? 310 :: version
|
||||
/- sole
|
||||
@ -9,57 +9,63 @@
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
|% :: ::
|
||||
++ helm-part ,[%helm %0 helm-pith] :: helm state
|
||||
++ helm-part {$helm $0 helm-pith} :: helm state
|
||||
++ helm-pith :: helm content
|
||||
$: bur=(unit (pair ship mace)) :: requesting ticket
|
||||
hoc=(map bone helm-session) :: consoles
|
||||
$: bur/(unit (pair ship mace)) :: requesting ticket
|
||||
hoc/(map bone helm-session) :: consoles
|
||||
== ::
|
||||
++ helm-session ::
|
||||
$: say=sole-share :: console state
|
||||
mud=(unit (sole-dialog ,@ud)) :: console dialog
|
||||
$: say/sole-share :: console state
|
||||
mud/(unit (sole-dialog @ud)) :: console dialog
|
||||
== ::
|
||||
:: :: ::
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
++ hood-begin :: begin command
|
||||
$: his=@p :: identity
|
||||
tic=@p :: ticket
|
||||
eny=@t :: entropy
|
||||
ges=gens :: description
|
||||
$: his/@p :: identity
|
||||
tic/@p :: ticket
|
||||
eny/@t :: entropy
|
||||
ges/gens :: description
|
||||
== ::
|
||||
++ hood-init :: report init
|
||||
$: him=ship ::
|
||||
$: him/ship ::
|
||||
== ::
|
||||
++ hood-reset :: reset command
|
||||
,~ ::
|
||||
$~ ::
|
||||
++ hood-deset :: reset command
|
||||
$~ ::
|
||||
++ hood-deone :: reset command
|
||||
$~ ::
|
||||
++ hood-detwo :: reset command
|
||||
$~ ::
|
||||
++ helm-verb :: reset command
|
||||
,~ ::
|
||||
$~ ::
|
||||
++ hood-reload :: reload command
|
||||
(list term) ::
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :: ::
|
||||
!: :: ::
|
||||
|= [bowl helm-part] :: main helm work
|
||||
|= {bowl helm-part} :: main helm work
|
||||
=+ sez=(fall (~(get by hoc) ost) *helm-session)
|
||||
=> |% :: arvo structures
|
||||
++ card ::
|
||||
$% [%cash wire p=@p q=buck] ::
|
||||
[%conf wire dock %load ship term] ::
|
||||
[%flog wire flog] ::
|
||||
[%serv wire ?(desk beam)] ::
|
||||
[%poke wire dock pear] ::
|
||||
[%wont wire sock path *] :: send message
|
||||
$% {$cash wire p/@p q/buck} ::
|
||||
{$conf wire dock $load ship term} ::
|
||||
{$flog wire flog} ::
|
||||
{$serv wire ?(desk beam)} ::
|
||||
{$poke wire dock pear} ::
|
||||
{$wont wire sock path *} :: send message
|
||||
== ::
|
||||
++ move (pair bone card) :: user-level move
|
||||
++ pear :: poke fruit
|
||||
$% [%hood-unsync desk ship desk] ::
|
||||
[%talk-command command:talk] ::
|
||||
[%ask-mail cord] ::
|
||||
[%helm-hi cord] ::
|
||||
$% {$hood-unsync desk ship desk} ::
|
||||
{$talk-command command:talk} ::
|
||||
{$ask-mail cord} ::
|
||||
{$helm-hi cord} ::
|
||||
== ::
|
||||
--
|
||||
|_ moz=(list move)
|
||||
|_ moz/(list move)
|
||||
++ abet :: resolve
|
||||
[(flop moz) %_(+>+>+<+ hoc (~(put by hoc) ost sez))]
|
||||
::
|
||||
@ -71,64 +77,64 @@
|
||||
::
|
||||
++ poke-begin :: make/send keypair
|
||||
|= hood-begin =< abet
|
||||
?> ?=(~ bur)
|
||||
?> ?=($~ bur)
|
||||
=+ buz=(shax :(mix (jam ges) eny))
|
||||
=+ loy=(bruw 2.048 buz)
|
||||
%- emit(bur `[his [0 sec:ex:loy]~])
|
||||
[%wont /helm/ticket [our (sein his)] /a/ta his tic ges pub:ex:loy]
|
||||
::
|
||||
++ poke-init :: initialize
|
||||
|= him=ship =< abet
|
||||
(emit %flog /helm %crud %hax-init leaf/(scow %p him) ~)
|
||||
|= him/ship =< abet
|
||||
(emit %flog /helm %crud %hax-init leaf+(scow %p him) ~)
|
||||
::
|
||||
++ poke-mass
|
||||
|= ~ =< abet
|
||||
|= $~ =< abet
|
||||
(emit %flog /heft %crud %hax-heft ~)
|
||||
::
|
||||
++ poke-send-hi
|
||||
|= [her=ship mes=(unit tape)] =< abet
|
||||
|= {her/ship mes/(unit tape)} =< abet
|
||||
%^ emit %poke /helm/hi/(scot %p her)
|
||||
[[her %hood] %helm-hi ?~(mes '' (crip u.mes))]
|
||||
::
|
||||
++ poke-send-ask
|
||||
|= mel=cord =< abet
|
||||
|= mel/cord =< abet
|
||||
%^ emit %poke /helm/ask/(scot %p ~doznec)
|
||||
[[~doznec %ask] %ask-mail mel]
|
||||
::
|
||||
++ poke-serve
|
||||
|= top=?(desk beam) =< abet
|
||||
|= top/?(desk beam) =< abet
|
||||
(emit %serv /helm/serv top)
|
||||
::
|
||||
++ poke-hi |=(mes=@t abet:(emit %flog /di %text "< {<src>}: {(trip mes)}"))
|
||||
++ poke-hi |=(mes/@t abet:(emit %flog /di %text "< {<src>}: {(trip mes)}"))
|
||||
++ coup-hi
|
||||
|= [pax=path cop=(unit tang)] =< abet
|
||||
?> ?=([@t ~] pax)
|
||||
|= {pax/path cop/(unit tang)} =< abet
|
||||
?> ?=({@t $~} pax)
|
||||
(emit %flog ~ %text "hi {(trip i.pax)} {?~(cop "" "un")}succesful")
|
||||
::
|
||||
++ poke-reload |=(all=(list term) (poke-reload-desk %home all))
|
||||
++ poke-reload |=(all/(list term) (poke-reload-desk %home all))
|
||||
++ poke-reload-desk :: reload vanes
|
||||
|= [syd=desk all=(list term)] =< abet
|
||||
|= {syd/desk all/(list term)} =< abet
|
||||
%- emil
|
||||
%- flop
|
||||
%+ turn all
|
||||
=+ top=`path`/(scot %p our)/[syd]/(scot %da now)/arvo
|
||||
=+ ark=(arch .^(%cy top))
|
||||
=+ ark=.^(arch %cy top)
|
||||
=+ van=(~(tap by dir.ark))
|
||||
|= nam=@tas
|
||||
|= nam/@tas
|
||||
=. nam
|
||||
?. =(1 (met 3 nam))
|
||||
nam
|
||||
=+ ^- zaz=(list ,[p=span ~])
|
||||
(skim van |=([a=term ~] =(nam (end 3 1 a))))
|
||||
?> ?=([[@ ~] ~] zaz)
|
||||
=+ ^- zaz/(list {p/knot $~})
|
||||
(skim van |=({a/term $~} =(nam (end 3 1 a))))
|
||||
?> ?=({{@ $~} $~} zaz)
|
||||
`term`p.i.zaz
|
||||
=+ tip=(end 3 1 nam)
|
||||
=+ way=(welp top /[nam])
|
||||
=+ fil=(,@ .^(%cx (welp way /hoon)))
|
||||
=+ fil=.^(@ %cx (welp way /hoon))
|
||||
[%flog /reload [%veer ?:(=('z' tip) %$ tip) way fil]]
|
||||
::
|
||||
++ poke-invite :: send invite; fake
|
||||
|= [who=@p myl=@t] =< abet
|
||||
|= {who/@p myl/@t} =< abet
|
||||
%^ emit %poke /helm/invite
|
||||
:- [our %talk]
|
||||
(said:talk our %helm now eny [%leaf "invited: {<who>} at {(trip myl)}"]~)
|
||||
@ -140,7 +146,7 @@
|
||||
=+ top=`path`/(scot %p our)/home/(scot %da now)/arvo
|
||||
:- [%flog /reset %vega (weld top `path`/hoon)]
|
||||
%+ turn
|
||||
^- (list ,[p=@tas q=@tas])
|
||||
^- (list {p/@tas q/@tas})
|
||||
:~ [%$ %zuse]
|
||||
[%a %ames]
|
||||
[%b %behn]
|
||||
@ -150,13 +156,38 @@
|
||||
[%f %ford]
|
||||
[%g %gall]
|
||||
==
|
||||
|= [p=@tas q=@tas]
|
||||
|= {p/@tas q/@tas}
|
||||
=+ way=`path`(welp top /[q])
|
||||
=+ txt=((hard ,@) .^(%cx (welp way /hoon)))
|
||||
=+ txt=.^(@ %cx (welp way /hoon))
|
||||
[%flog /reset %veer p way txt]
|
||||
::
|
||||
++ poke-deset :: deset system
|
||||
|= hood-deset =< abet
|
||||
%- emil
|
||||
%- flop ^- (list card)
|
||||
=+ top=`path`/(scot %p our)/home/(scot %da now)/arvo
|
||||
:- [%flog /deset %vega (weld top `path`/hoon)]
|
||||
~
|
||||
::
|
||||
++ poke-deone :: deset system
|
||||
|= hood-deone =< abet
|
||||
%- emil
|
||||
%- flop ^- (list card)
|
||||
=+ top=`path`/(scot %p our)/home/(scot %da now)/arvo
|
||||
:~ [%flog /deset %vega (weld top `path`/one)]
|
||||
[%flog /deset %vega (weld top `path`/two)]
|
||||
==
|
||||
::
|
||||
++ poke-detwo :: deset system
|
||||
|= hood-detwo =< abet
|
||||
%- emil
|
||||
%- flop ^- (list card)
|
||||
=+ top=`path`/(scot %p our)/home/(scot %da now)/arvo
|
||||
:- [%flog /deset %vega (weld top `path`/two)]
|
||||
~
|
||||
::
|
||||
++ poke-will :: hear certificate
|
||||
|= wil=(unit will)
|
||||
|= wil/(unit will)
|
||||
?> ?=(^ bur)
|
||||
?> ?=(^ wil)
|
||||
=< abet
|
||||
@ -166,22 +197,22 @@
|
||||
==
|
||||
::
|
||||
++ poke-verb :: toggle verbose
|
||||
|= ~ =< abet
|
||||
|= $~ =< abet
|
||||
(emit %flog /helm %verb ~)
|
||||
::
|
||||
++ take-onto :: result of %conf
|
||||
|= saw=(each suss tang) =< abet
|
||||
|= saw/(each suss tang) =< abet
|
||||
%- emit
|
||||
?- -.saw
|
||||
%| [%flog ~ %crud %onto `tang`p.saw]
|
||||
%& [%flog ~ %text "<{<p.saw>}>"]
|
||||
$| [%flog ~ %crud %onto `tang`p.saw]
|
||||
$& [%flog ~ %text "<{<p.saw>}>"]
|
||||
==
|
||||
::
|
||||
++ take-note :: result of %init
|
||||
|= [way=wire chr=@tD tan=tank] =< abet
|
||||
|= {way/wire chr/@tD tan/tank} =< abet
|
||||
(emit %flog ~ %text chr ' ' ~(ram re tan))
|
||||
::
|
||||
++ take-woot :: result of %wont
|
||||
|= [way=wire her=ship cop=coop] =< abet
|
||||
|= {way/wire her/ship cop/coop} =< abet
|
||||
(emit %flog ~ %text "woot: {<[way cop]>}")
|
||||
--
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/http/lib
|
||||
:::: /hoon+http+lib
|
||||
::
|
||||
::
|
||||
::
|
||||
@ -7,19 +7,21 @@
|
||||
!:
|
||||
|%
|
||||
++ request
|
||||
$: domain=(list cord) end-point=path
|
||||
req-type=$?(%get [%post p=json]) headers=math
|
||||
queries=quay
|
||||
$: domain/(list cord)
|
||||
end-point/path
|
||||
req-type/$?($get {$post p/json})
|
||||
headers/math
|
||||
queries/quay
|
||||
==
|
||||
++ send
|
||||
|= [ost=bone pour-path=wire params=request]
|
||||
|= {ost/bone pour-path/wire params/request}
|
||||
:^ ost %them pour-path
|
||||
`(unit hiss)`[~ (request-to-hiss params)]
|
||||
::
|
||||
++ request-to-hiss
|
||||
|= request ^- hiss
|
||||
=- ~& hiss=- -
|
||||
:- ^- parsed-url=purl
|
||||
:- ^- parsed-url/purl
|
||||
:+ :+ security=%.y
|
||||
port=~
|
||||
host=[%.y [path=domain]]
|
||||
|
415
lib/kiln.hoon
415
lib/kiln.hoon
@ -1,128 +1,127 @@
|
||||
:: :: ::
|
||||
:::: /hoon/kiln/lib :: ::
|
||||
:: :: ::
|
||||
:::: /hoon/kiln/lib :: ::
|
||||
:: :: ::
|
||||
/? 310 :: version
|
||||
:: :: ::
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
|% :: ::
|
||||
++ kiln-part ,[%kiln %0 kiln-pith] :: kiln state
|
||||
++ kiln-part {$kiln $0 kiln-pith} :: kiln state
|
||||
++ kiln-pith ::
|
||||
$: rem=(map desk kiln-desk) ::
|
||||
syn=(map kiln-sync ,[let=@ud ust=bone]) ::
|
||||
autoload=? ::
|
||||
cur-hoon=@uvI ::
|
||||
cur-zuse=@uvI ::
|
||||
cur-vanes=(map ,@tas ,@uvI) ::
|
||||
$: rem/(map desk kiln-desk) ::
|
||||
syn/(map kiln-sync {let/@ud ust/bone}) ::
|
||||
autoload/? ::
|
||||
cur-hoon/@uvI ::
|
||||
cur-zuse/@uvI ::
|
||||
cur-vanes/(map @tas @uvI) ::
|
||||
== ::
|
||||
++ kiln-desk :: per-desk state
|
||||
$: auto=? :: escalate on failure
|
||||
gem=germ :: strategy
|
||||
her=@p :: from ship
|
||||
sud=@tas :: from desk
|
||||
cas=case :: at case
|
||||
$: auto/? :: escalate on failure
|
||||
gem/germ :: strategy
|
||||
her/@p :: from ship
|
||||
sud/@tas :: from desk
|
||||
cas/case :: at case
|
||||
== ::
|
||||
:: :: ::
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
++ kiln-mount ::
|
||||
$: pax=path ::
|
||||
pot=term ::
|
||||
$: pax/path ::
|
||||
pot/term ::
|
||||
== ::
|
||||
++ kiln-unmount ::
|
||||
$|(term [span path]) ::
|
||||
++ kiln-unmount $@(term {knot path}) ::
|
||||
++ kiln-sync ::
|
||||
$: syd=desk ::
|
||||
her=ship ::
|
||||
sud=desk ::
|
||||
$: syd/desk ::
|
||||
her/ship ::
|
||||
sud/desk ::
|
||||
== ::
|
||||
++ kiln-unsync ::
|
||||
$: syd=desk ::
|
||||
her=ship ::
|
||||
sud=desk ::
|
||||
$: syd/desk ::
|
||||
her/ship ::
|
||||
sud/desk ::
|
||||
== ::
|
||||
++ kiln-merge ::
|
||||
$: syd=desk ::
|
||||
ali=ship ::
|
||||
sud=desk ::
|
||||
cas=case ::
|
||||
gim=?(%auto germ) ::
|
||||
$: syd/desk ::
|
||||
ali/ship ::
|
||||
sud/desk ::
|
||||
cas/case ::
|
||||
gim/?($auto germ) ::
|
||||
== ::
|
||||
++ kiln-cp [input=path output=path] ::
|
||||
++ kiln-mv [input=path output=path] ::
|
||||
++ kiln-cp {input/path output/path} ::
|
||||
++ kiln-mv {input/path output/path} ::
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :: ::
|
||||
!: :: ::
|
||||
|= [bowl kiln-part] :: main kiln work
|
||||
|= {bowl kiln-part} :: main kiln work
|
||||
?> =(src our)
|
||||
=> |% :: arvo structures
|
||||
++ card ::
|
||||
$% [%exec wire @p ~ [beak silk]] ::
|
||||
[%drop wire @p @tas] ::
|
||||
[%info wire @p @tas nori] ::
|
||||
[%mont wire @tas @p @tas path] ::
|
||||
[%ogre wire $|(@tas beam)] ::
|
||||
[%merg wire @p @tas @p @tas case germ] ::
|
||||
[%poke wire dock pear] ::
|
||||
[%wait wire @da] ::
|
||||
[%warp wire sock riff] ::
|
||||
== ::
|
||||
++ pear :: poke fruit
|
||||
$% [%talk-command command:talk] ::
|
||||
[%kiln-merge kiln-merge] ::
|
||||
[%helm-reload (list term)] ::
|
||||
[%helm-reset ~] ::
|
||||
== ::
|
||||
++ move (pair bone card) :: user-level move
|
||||
=> |% :: arvo structures
|
||||
++ card ::
|
||||
$% {$exec wire @p $~ {beak silk}} ::
|
||||
{$drop wire @p @tas} ::
|
||||
{$info wire @p @tas nori} ::
|
||||
{$mont wire @tas @p @tas path} ::
|
||||
{$ogre wire $@(@tas beam)} ::
|
||||
{$merg wire @p @tas @p @tas case germ} ::
|
||||
{$poke wire dock pear} ::
|
||||
{$wait wire @da} ::
|
||||
{$warp wire sock riff} ::
|
||||
== ::
|
||||
++ pear :: poke fruit
|
||||
$% {$talk-command command:talk} ::
|
||||
{$kiln-merge kiln-merge} ::
|
||||
{$helm-reload (list term)} ::
|
||||
{$helm-reset $~} ::
|
||||
== ::
|
||||
++ move (pair bone card) :: user-level move
|
||||
--
|
||||
|_ moz=(list move)
|
||||
++ abet :: resolve
|
||||
|_ moz/(list move)
|
||||
++ abet :: resolve
|
||||
[(flop moz) `kiln-part`+>+>->]
|
||||
::
|
||||
++ emit |=(card %_(+> moz [[ost +<] moz])) :: return card
|
||||
++ emil :: return cards
|
||||
++ emit |=(card %_(+> moz [[ost +<] moz])) :: return card
|
||||
++ emil :: return cards
|
||||
|= (list card)
|
||||
^+ +>
|
||||
?~(+< +> $(+< t.+<, +> (emit i.+<)))
|
||||
::
|
||||
++ render
|
||||
|= [mez=tape sud=desk who=ship syd=desk]
|
||||
:^ %palm [" " ~ ~ ~] leaf/mez
|
||||
~[leaf/"from {<sud>}" leaf/"on {<who>}" leaf/"to {<syd>}"]
|
||||
|= {mez/tape sud/desk who/ship syd/desk}
|
||||
:^ %palm [" " ~ ~ ~] leaf+mez
|
||||
~[leaf+"from {<sud>}" leaf+"on {<who>}" leaf+"to {<syd>}"]
|
||||
::
|
||||
++ poke-mount
|
||||
|= kiln-mount
|
||||
=+ bem=(tome pax)
|
||||
?~ bem
|
||||
=+ "can't mount bad path: {<pax>}"
|
||||
abet:(spam leaf/- ~)
|
||||
abet:(spam leaf+- ~)
|
||||
abet:(emit %mont /mount pot p.u.bem q.u.bem (flop s.u.bem))
|
||||
::
|
||||
++ poke-unmount
|
||||
|= mon=kiln-unmount
|
||||
|= mon/kiln-unmount
|
||||
?^ mon
|
||||
=+ bem=(tome mon)
|
||||
?~ bem
|
||||
=+ "can't unmount bad path: {<mon>}"
|
||||
abet:(spam leaf/- ~)
|
||||
abet:(emit %ogre /unmount-beam [[p q ud/0] s]:u.bem)
|
||||
abet:(spam leaf+- ~)
|
||||
abet:(emit %ogre /unmount-beam [[p q %ud 0] s]:u.bem)
|
||||
abet:(emit %ogre /unmount-point mon)
|
||||
::
|
||||
++ poke-track ::
|
||||
|= hos=kiln-sync
|
||||
|= hos/kiln-sync
|
||||
?: (~(has by syn) hos)
|
||||
abet:(spam (render "already syncing" [sud her syd]:hos) ~)
|
||||
abet:abet:start-track:(auto hos)
|
||||
::
|
||||
++ poke-sync ::
|
||||
|= hos=kiln-sync
|
||||
|= hos/kiln-sync
|
||||
?: (~(has by syn) hos)
|
||||
abet:(spam (render "already syncing" [sud her syd]:hos) ~)
|
||||
abet:abet:start-sync:(auto hos)
|
||||
::
|
||||
++ poke-unsync ::
|
||||
|= hus=kiln-unsync
|
||||
|= hus/kiln-unsync
|
||||
?. (~(has by syn) hus)
|
||||
abet:(spam (render "not syncing" [sud her syd]:hus) ~)
|
||||
%* . abet:abet:stop:(auto hus)
|
||||
@ -134,86 +133,84 @@
|
||||
abet:abet:(merge:(work syd) ali sud cas gim)
|
||||
::
|
||||
++ poke-cancel
|
||||
|= syd=desk
|
||||
|= syd/desk
|
||||
abet:(emit %drop /cancel our syd)
|
||||
::
|
||||
++ do-info
|
||||
|= [mez=tape tor=toro]
|
||||
abet:(emit:(spam leaf/mez ~) %info /kiln our tor)
|
||||
|= {mez/tape tor/toro}
|
||||
abet:(emit:(spam leaf+mez ~) %info /kiln our tor)
|
||||
::
|
||||
++ poke-rm |=(a=path (do-info "removed" (fray a)))
|
||||
++ poke-rm |=(a/path (do-info "removed" (fray a)))
|
||||
++ poke-cp
|
||||
|= [input=path output=path]
|
||||
|= {input/path output/path}
|
||||
%+ do-info "copied"
|
||||
?> =(-:(flop input) -:(flop output))
|
||||
(foal output -:(flop input) atom/%t .^(%cx input)) :: XX type
|
||||
(foal output -:(flop input) [%atom %t ~] .^(* %cx input)) :: XX type
|
||||
::
|
||||
++ poke-mv
|
||||
|= [input=path output=path]
|
||||
|= {input/path output/path}
|
||||
%+ do-info "moved"
|
||||
?> =(-:(flop input) -:(flop output))
|
||||
%+ furl (fray input)
|
||||
(foal output -:(flop input) %noun .^(%cx input))
|
||||
(foal output -:(flop input) %noun .^(* %cx input))
|
||||
::
|
||||
++ poke-label
|
||||
|= [syd=desk lab=@tas]
|
||||
|= {syd/desk lab/@tas}
|
||||
=+ pax=/(scot %p our)/[syd]/[lab]
|
||||
(do-info "labeled {(spud pax)}" [syd %| lab])
|
||||
::
|
||||
++ poke-schedule
|
||||
|= [where=path tym=@da eve=@t]
|
||||
|= {where/path tym/@da eve/@t}
|
||||
=. where (welp where /sched)
|
||||
%+ do-info "scheduled"
|
||||
=+ old=;;((map ,@da cord) (fall (file where) ~))
|
||||
=+ old=;;((map @da cord) (fall (file where) ~))
|
||||
(foal where %sched !>((~(put by old) tym eve)))
|
||||
::
|
||||
++ poke-autoload
|
||||
|= lod=(unit ,?)
|
||||
|= lod/(unit ?)
|
||||
?^ lod
|
||||
abet(autoload u.lod)
|
||||
=< abet(autoload !autoload)
|
||||
(spam leaf/"turning autoload o{?:(autoload "ff" "n")}" ~)
|
||||
(spam leaf+"turning autoload o{?:(autoload "ff" "n")}" ~)
|
||||
::
|
||||
++ poke-start-autoload
|
||||
|= ~
|
||||
=. cur-hoon
|
||||
((hard ,@uvI) .^(%cz /(scot %p our)/home/(scot %da now)/arvo/hoon/hoon))
|
||||
=. cur-zuse
|
||||
((hard ,@uvI) .^(%cz /(scot %p our)/home/(scot %da now)/arvo/zuse/hoon))
|
||||
|= $~
|
||||
=. cur-hoon .^(@uvI %cz /(scot %p our)/home/(scot %da now)/arvo/hoon/hoon)
|
||||
=. cur-zuse .^(@uvI %cz /(scot %p our)/home/(scot %da now)/arvo/zuse/hoon)
|
||||
=. cur-vanes
|
||||
%- mo
|
||||
%+ turn `(list ,@tas)`~[%ames %behn %clay %dill %eyre %ford %gall]
|
||||
|= syd=@tas
|
||||
%- malt
|
||||
%+ turn `(list @tas)`~[%ames %behn %clay %dill %eyre %ford %gall]
|
||||
|= syd/@tas
|
||||
:- syd
|
||||
((hard ,@uvI) .^(%cz /(scot %p our)/home/(scot %da now)/arvo/[syd]/hoon))
|
||||
.^(@uvI %cz /(scot %p our)/home/(scot %da now)/arvo/[syd]/hoon)
|
||||
=< abet
|
||||
%- emit
|
||||
^- card
|
||||
:* %warp /kiln/autoload [our our] %home ~
|
||||
%next %z da/now /arvo
|
||||
%next %z da+now /arvo
|
||||
==
|
||||
::
|
||||
++ poke-overload
|
||||
|= syd=term
|
||||
|= syd/term
|
||||
abet:(emit %wait /kiln/overload/[syd] (add ~s10 now))
|
||||
::
|
||||
++ take |=(way=wire ?>(?=([@ ~] way) (work i.way))) :: general handler
|
||||
++ take |=(way/wire ?>(?=({@ $~} way) (work i.way))) :: general handler
|
||||
++ take-mere ::
|
||||
|= [way=wire are=(each (set path) (pair term tang))]
|
||||
|= {way/wire are/(each (set path) (pair term tang))}
|
||||
abet:abet:(mere:(take way) are)
|
||||
::
|
||||
++ take-made ::
|
||||
|= [way=wire dep=@uvH reg=gage]
|
||||
|= {way/wire dep/@uvH reg/gage}
|
||||
abet:abet:(made:(take way) dep reg)
|
||||
::
|
||||
++ take-coup-fancy ::
|
||||
|= [way=wire saw=(unit tang)]
|
||||
|= {way/wire saw/(unit tang)}
|
||||
abet:abet:(coup-fancy:(take way) saw)
|
||||
::
|
||||
++ take-mere-sync ::
|
||||
|= [way=wire mes=(each (set path) (pair term tang))]
|
||||
?> ?=([@ @ @ ~] way)
|
||||
=+ ^- hos=kiln-sync
|
||||
|= {way/wire mes/(each (set path) (pair term tang))}
|
||||
?> ?=({@ @ @ $~} way)
|
||||
=+ ^- hos/kiln-sync
|
||||
:* syd=(slav %tas i.way)
|
||||
her=(slav %p i.t.way)
|
||||
sud=(slav %tas i.t.t.way)
|
||||
@ -221,9 +218,9 @@
|
||||
abet:abet:(mere:(auto hos) mes)
|
||||
::
|
||||
++ take-writ-sync ::
|
||||
|= [way=wire rot=riot]
|
||||
?> ?=([@ @ @ ~] way)
|
||||
=+ ^- hos=kiln-sync
|
||||
|= {way/wire rot/riot}
|
||||
?> ?=({@ @ @ $~} way)
|
||||
=+ ^- hos/kiln-sync
|
||||
:* syd=(slav %tas i.way)
|
||||
her=(slav %p i.t.way)
|
||||
sud=(slav %tas i.t.t.way)
|
||||
@ -231,48 +228,45 @@
|
||||
abet:abet:(writ:(auto hos) rot)
|
||||
::
|
||||
++ take-writ-autoload
|
||||
|= [way=wire rot=riot]
|
||||
?> ?=(~ way)
|
||||
|= {way/wire rot/riot}
|
||||
?> ?=($~ way)
|
||||
?> ?=(^ rot)
|
||||
=+ vanes=`(list ,@tas)`~[%ames %behn %clay %dill %eyre %ford %gall]
|
||||
=+ vanes=`(list @tas)`~[%ames %behn %clay %dill %eyre %ford %gall]
|
||||
=. +>.$
|
||||
?. autoload
|
||||
+>.$
|
||||
=+ ^= new-hoon
|
||||
((hard ,@uvI) .^(%cz /(scot %p our)/home/(scot %da now)/arvo/hoon/hoon))
|
||||
.^(@uvI %cz /(scot %p our)/home/(scot %da now)/arvo/hoon/hoon)
|
||||
?: !=(new-hoon cur-hoon)
|
||||
=. cur-hoon new-hoon
|
||||
=. cur-vanes
|
||||
%- mo
|
||||
%+ turn `(list ,@tas)`(turn (~(tap by cur-vanes)) head)
|
||||
|= syd=@tas
|
||||
%- malt
|
||||
%+ turn `(list @tas)`(turn (~(tap by cur-vanes)) head)
|
||||
|= syd/@tas
|
||||
:- syd
|
||||
%- (hard ,@uvI)
|
||||
.^(%cz /(scot %p our)/home/(scot %da now)/arvo/[syd]/hoon)
|
||||
.^(@uvI %cz /(scot %p our)/home/(scot %da now)/arvo/[syd]/hoon)
|
||||
(emit %poke /kiln/reload/hoon [our %hood] %helm-reset ~)
|
||||
:: XX updates cur-vanes?
|
||||
=+ ^= new-zuse
|
||||
((hard ,@uvI) .^(%cz /(scot %p our)/home/(scot %da now)/arvo/zuse/hoon))
|
||||
.^(@uvI %cz /(scot %p our)/home/(scot %da now)/arvo/zuse/hoon)
|
||||
?: !=(new-zuse cur-zuse)
|
||||
=. cur-zuse new-zuse
|
||||
=. cur-vanes
|
||||
%- mo
|
||||
%+ turn `(list ,@tas)`(turn (~(tap by cur-vanes)) head)
|
||||
|= syd=@tas
|
||||
%- malt
|
||||
%+ turn `(list @tas)`(turn (~(tap by cur-vanes)) head)
|
||||
|= syd/@tas
|
||||
:- syd
|
||||
%- (hard ,@uvI)
|
||||
.^(%cz /(scot %p our)/home/(scot %da now)/arvo/[syd]/hoon)
|
||||
.^(@uvI %cz /(scot %p our)/home/(scot %da now)/arvo/[syd]/hoon)
|
||||
(emit %poke /kiln/reload/zuse [our %hood] %helm-reload [%zuse vanes])
|
||||
:: XX updates cur-vanes?
|
||||
=- =. ^cur-vanes cur-vanes
|
||||
(emil cards)
|
||||
%+ roll `(list ,@tas)`vanes
|
||||
%+ roll `(list @tas)`vanes
|
||||
=< %_(. cur-vanes ^cur-vanes)
|
||||
::^- $+([@tas _+>.^$] _+>.^$)
|
||||
|= [syd=@tas cur-vanes=(map ,@tas ,@uvI) cards=(list card)]
|
||||
::^- $-([@tas _+>.^$] _+>.^$)
|
||||
|= {syd/@tas cur-vanes/(map @tas @uvI) cards/(list card)}
|
||||
=+ ^= new-vane
|
||||
%- (hard ,@uvI)
|
||||
.^(%cz /(scot %p our)/home/(scot %da now)/arvo/[syd]/hoon)
|
||||
.^(@uvI %cz /(scot %p our)/home/(scot %da now)/arvo/[syd]/hoon)
|
||||
?: =(`new-vane (~(get by cur-vanes) syd))
|
||||
[cur-vanes cards]
|
||||
:- (~(put by cur-vanes) syd new-vane)
|
||||
@ -280,13 +274,13 @@
|
||||
=. +>.$
|
||||
%- emit :*
|
||||
%warp /kiln/autoload [our our] %home ~
|
||||
%next %z da/now /arvo
|
||||
%next %z da+now /arvo
|
||||
==
|
||||
abet
|
||||
::
|
||||
++ take-wake-overload
|
||||
|= [way=wire ~]
|
||||
?> ?=([@ ~] way)
|
||||
|= {way/wire $~}
|
||||
?> ?=({@ $~} way)
|
||||
=+ syd=(slav %tas i.way)
|
||||
=. +>.$
|
||||
(emit %poke /kiln/overload/[syd] [our %hood] %helm-reload ~[syd])
|
||||
@ -295,7 +289,7 @@
|
||||
abet
|
||||
::
|
||||
++ spam
|
||||
|= mes=(list tank)
|
||||
|= mes/(list tank)
|
||||
((slog mes) ..spam)
|
||||
:: %- emit :: XX not displayed/immediately
|
||||
:: [%poke /kiln/spam [our %talk] (said our %kiln now eny mes)]
|
||||
@ -308,7 +302,7 @@
|
||||
..auto(syn (~(put by syn) [syd her sud] let ust))
|
||||
::
|
||||
++ blab
|
||||
|= new=(list move)
|
||||
|= new/(list move)
|
||||
^+ +>
|
||||
+>.$(moz (welp new moz))
|
||||
::
|
||||
@ -327,7 +321,7 @@
|
||||
%- blab
|
||||
:~ :* ost %warp
|
||||
/kiln/sync/[syd]/(scot %p her)/[sud]
|
||||
[our her] sud ~ %sing %y ud/let /
|
||||
[our her] sud ~ %sing %y ud+let /
|
||||
== ==
|
||||
::
|
||||
++ start-sync
|
||||
@ -339,52 +333,52 @@
|
||||
== ==
|
||||
::
|
||||
++ writ
|
||||
|= rot=riot
|
||||
|= rot/riot
|
||||
?~ rot
|
||||
%^ spam
|
||||
leaf/"bad %writ response"
|
||||
leaf+"bad %writ response"
|
||||
(render "on sync" sud her syd)
|
||||
~
|
||||
=. let ?. ?=(%w p.p.u.rot) let ((hard ,@ud) q.q.r.u.rot)
|
||||
%- blab :_ ~
|
||||
=. let ?. ?=($w p.p.u.rot) let ((hard @ud) q.q.r.u.rot)
|
||||
%- blab ^- (list move) :_ ~
|
||||
:* ost %merg
|
||||
/kiln/sync/[syd]/(scot %p her)/[sud]
|
||||
our syd her sud ud/let
|
||||
?: =(0 .^(%cw /(scot %p our)/[syd]/(scot %da now)))
|
||||
our syd her sud ud+let
|
||||
?: =(0 .^(* %cw /(scot %p our)/[syd]/(scot %da now)))
|
||||
%init
|
||||
%mate
|
||||
==
|
||||
::
|
||||
++ mere
|
||||
|= mes=(each (set path) (pair term tang))
|
||||
|= mes/(each (set path) (pair term tang))
|
||||
=. let +(let)
|
||||
=. +>.$
|
||||
%- spam
|
||||
?: ?=(%& -.mes)
|
||||
?: ?=($& -.mes)
|
||||
[(render "sync succeeded" sud her syd) ~]
|
||||
?+ p.p.mes
|
||||
:* (render "sync failed" sud her syd)
|
||||
leaf/"please manually merge the desks with"
|
||||
leaf/"|merge %{(trip syd)} {(scow %p her)} %{(trip sud)}"
|
||||
leaf/""
|
||||
leaf/"error code: {<p.p.mes>}"
|
||||
leaf+"please manually merge the desks with"
|
||||
leaf+"|merge %{(trip syd)} {(scow %p her)} %{(trip sud)}"
|
||||
leaf+""
|
||||
leaf+"error code: {<p.p.mes>}"
|
||||
q.p.mes
|
||||
==
|
||||
::
|
||||
%no-ali-desk
|
||||
$no-ali-desk
|
||||
:~ (render "sync activated" sud her syd)
|
||||
leaf/"note: blank desk {<sud>} on {<her>}"
|
||||
leaf+"note: blank desk {<sud>} on {<her>}"
|
||||
==
|
||||
==
|
||||
%- blab :_ ~
|
||||
:* ost %warp
|
||||
/kiln/sync/[syd]/(scot %p her)/[sud]
|
||||
[our her] sud ~ %sing %y ud/let /
|
||||
[our her] sud ~ %sing %y ud+let /
|
||||
==
|
||||
--
|
||||
::
|
||||
++ work :: state machine
|
||||
|= syd=desk
|
||||
|= syd/desk
|
||||
=+ ^- kiln-desk
|
||||
%+ fall (~(get by rem) syd)
|
||||
=+ *kiln-desk
|
||||
@ -394,7 +388,7 @@
|
||||
..work(rem (~(put by rem) syd auto gem her sud cas))
|
||||
::
|
||||
++ blab
|
||||
|= new=(list move)
|
||||
|= new/(list move)
|
||||
^+ +>
|
||||
+>.$(moz (welp new moz))
|
||||
::
|
||||
@ -405,43 +399,44 @@
|
||||
.
|
||||
::
|
||||
++ ford-fail
|
||||
|=(tan=tang ~|(%ford-fail (mean tan)))
|
||||
|=(tan/tang ~|(%ford-fail (mean tan)))
|
||||
::
|
||||
++ unwrap-tang
|
||||
|* res=(each ,* tang)
|
||||
?: ?=(%& -.res)
|
||||
|* res/(each * tang)
|
||||
?: ?=($& -.res)
|
||||
p.res
|
||||
(ford-fail p.res)
|
||||
::
|
||||
++ gage-to-cages
|
||||
|= gag=gage ^- (list (pair cage cage))
|
||||
|= gag/gage ^- (list (pair cage cage))
|
||||
(unwrap-tang (gage-to-tage gag))
|
||||
::
|
||||
++ gage-to-tage
|
||||
|= gag=gage
|
||||
|= gag/gage
|
||||
^- (each (list (pair cage cage)) tang)
|
||||
?. ?=(%tabl -.gag)
|
||||
(mule |.(`~`(ford-fail >%strange-gage< ~)))
|
||||
=< ?+(. [%& .] [@ *] .)
|
||||
|- ^- ?((list ,[cage cage]) (each ,~ tang))
|
||||
?. ?=($tabl -.gag)
|
||||
(mule |.(`$~`(ford-fail >%strange-gage< ~)))
|
||||
=< ?+(. [%& .] {@ *} .)
|
||||
|- ^- ?((list {cage cage}) (each $~ tang))
|
||||
?~ p.gag ~
|
||||
=* hed i.p.gag
|
||||
?- -.p.hed
|
||||
%tabl (mule |.(`~`(ford-fail >%strange-gage< ~)))
|
||||
%| (mule |.(`~`(ford-fail p.p.hed)))
|
||||
%& ?- -.q.hed
|
||||
%tabl (mule |.(`~`(ford-fail >%strange-gage< ~)))
|
||||
%| (mule |.(`~`(ford-fail p.q.hed)))
|
||||
%& =+ $(p.gag t.p.gag)
|
||||
?+(- [[p.p p.q]:hed -] [@ *] -)
|
||||
== ==
|
||||
?- -.p.i.p.gag
|
||||
$tabl (mule |.(`$~`(ford-fail >%strange-gage< ~)))
|
||||
$| (mule |.(`$~`(ford-fail p.p.i.p.gag)))
|
||||
$&
|
||||
?- -.q.i.p.gag
|
||||
$tabl (mule |.(`$~`(ford-fail >%strange-gage< ~)))
|
||||
$| (mule |.(`$~`(ford-fail p.q.i.p.gag)))
|
||||
$& =+ $(p.gag t.p.gag)
|
||||
?+(- [[p.p p.q]:i.p.gag -] {@ *} -)
|
||||
==
|
||||
==
|
||||
::
|
||||
++ perform ::
|
||||
^+ .
|
||||
(blab [ost %merg /kiln/[syd] our syd her sud cas gem] ~)
|
||||
::
|
||||
++ fancy-merge :: send to self
|
||||
|= [syd=desk her=@p sud=desk gem=?(%auto germ)]
|
||||
|= {syd/desk her/@p sud/desk gem/?($auto germ)}
|
||||
^+ +>
|
||||
%- blab :_ ~
|
||||
[ost %poke /kiln/fancy/[^syd] [our %hood] %kiln-merge [syd her sud cas gem]]
|
||||
@ -449,45 +444,45 @@
|
||||
++ spam ::|=(tang ((slog +<) ..spam))
|
||||
|*(* +>(..work (^spam +<)))
|
||||
++ merge
|
||||
|= [her=@p sud=@tas cas=case gim=?(%auto germ)]
|
||||
|= {her/@p sud/@tas cas/case gim/?($auto germ)}
|
||||
^+ +>
|
||||
?. ?=(%auto gim)
|
||||
?. ?=($auto gim)
|
||||
perform(auto |, gem gim, her her, cas cas, sud sud)
|
||||
?: =(0 .^(%cw /(scot %p our)/[syd]/(scot %da now)))
|
||||
?: =(0 .^(@ %cw /(scot %p our)/[syd]/(scot %da now)))
|
||||
=> $(gim %init)
|
||||
.(auto &)
|
||||
=> $(gim %fine)
|
||||
.(auto &)
|
||||
::
|
||||
++ coup-fancy
|
||||
|= saw=(unit tang)
|
||||
|= saw/(unit tang)
|
||||
?~ saw
|
||||
=> (spam leaf/"%melding %{(trip sud)} into scratch space" ~)
|
||||
=> (spam leaf+"%melding %{(trip sud)} into scratch space" ~)
|
||||
%- blab :_ ~
|
||||
[ost %merg /kiln/[syd] our (cat 3 syd '-scratch') her sud cas gem]
|
||||
=+ :- "failed to set up conflict resolution scratch space"
|
||||
"I'm out of ideas"
|
||||
lose:(spam leaf/-< leaf/-> u.saw)
|
||||
lose:(spam leaf+-< leaf+-> u.saw)
|
||||
::
|
||||
++ mere
|
||||
|= are=(each (set path) (pair term tang))
|
||||
|= are/(each (set path) (pair term tang))
|
||||
^+ +>
|
||||
?: =(%meld gem)
|
||||
?: ?=(%& -.are)
|
||||
?: ?=($& -.are)
|
||||
?. auto
|
||||
=+ "merged with strategy {<gem>}"
|
||||
win:(spam leaf/- ?~(p.are ~ [>`(set path)`p.are< ~]))
|
||||
win:(spam leaf+- ?~(p.are ~ [>`(set path)`p.are< ~]))
|
||||
:: ~? > =(~ p.are) [%mere-no-conflict syd]
|
||||
=+ "mashing conflicts"
|
||||
=> .(+>.$ (spam leaf/- ~))
|
||||
=> .(+>.$ (spam leaf+- ~))
|
||||
=+ tic=(cat 3 syd '-scratch')
|
||||
%- blab :_ ~
|
||||
:* ost %exec /kiln/[syd]
|
||||
our ~ [our tic %da now] %tabl
|
||||
^- (list (pair silk silk))
|
||||
:: ~& > kiln-mashing/[p.are syd=syd +<.abet]
|
||||
:: ~& > kiln-mashing+[p.are syd=syd +<.abet]
|
||||
%+ turn (~(tap in p.are))
|
||||
|= pax=path
|
||||
|= pax/path
|
||||
^- (pair silk silk)
|
||||
:- [%$ %path -:!>(*path) pax]
|
||||
=+ base=[%file [our tic %da now] (flop pax)]
|
||||
@ -495,82 +490,82 @@
|
||||
=+ bobs=[%file [our syd %da now] (flop pax)]
|
||||
=+ dali=[%diff base alis]
|
||||
=+ dbob=[%diff base bobs]
|
||||
=+ ^- for=mark
|
||||
=+ ^- for/mark
|
||||
=+ (slag (dec (lent pax)) pax)
|
||||
?~(- %$ i.-)
|
||||
[%mash for [her sud dali] [our syd dbob]]
|
||||
==
|
||||
=+ "failed to merge with strategy meld"
|
||||
lose:(spam leaf/- >p.p.are< q.p.are)
|
||||
?: ?=(%& -.are)
|
||||
lose:(spam leaf+- >p.p.are< q.p.are)
|
||||
?: ?=($& -.are)
|
||||
=+ "merged with strategy {<gem>}"
|
||||
win:(spam leaf/- ?~(p.are ~ [>`(set path)`p.are< ~]))
|
||||
win:(spam leaf+- ?~(p.are ~ [>`(set path)`p.are< ~]))
|
||||
?. auto
|
||||
=+ "failed to merge with strategy {<gem>}"
|
||||
lose:(spam leaf/- >p.p.are< q.p.are)
|
||||
lose:(spam leaf+- >p.p.are< q.p.are)
|
||||
?+ gem
|
||||
(spam leaf/"strange auto" >gem< ~)
|
||||
(spam leaf+"strange auto" >gem< ~)
|
||||
::
|
||||
%init
|
||||
$init
|
||||
=+ :- "auto merge failed on strategy %init"
|
||||
"I'm out of ideas"
|
||||
lose:(spam leaf/-< leaf/-> [>p.p.are< q.p.are])
|
||||
lose:(spam leaf+-< leaf+-> [>p.p.are< q.p.are])
|
||||
::
|
||||
%fine
|
||||
?. ?=(%bad-fine-merge p.p.are)
|
||||
$fine
|
||||
?. ?=($bad-fine-merge p.p.are)
|
||||
=+ "auto merge failed on strategy %fine"
|
||||
lose:(spam leaf/- >p.p.are< q.p.are)
|
||||
=> (spam leaf/"%fine merge failed, trying %meet" ~)
|
||||
lose:(spam leaf+- >p.p.are< q.p.are)
|
||||
=> (spam leaf+"%fine merge failed, trying %meet" ~)
|
||||
perform(gem %meet)
|
||||
::
|
||||
%meet
|
||||
?. ?=(%meet-conflict p.p.are)
|
||||
$meet
|
||||
?. ?=($meet-conflict p.p.are)
|
||||
=+ "auto merge failed on strategy %meet"
|
||||
lose:(spam leaf/- >p.p.are< q.p.are)
|
||||
=> (spam leaf/"%meet merge failed, trying %mate" ~)
|
||||
lose:(spam leaf+- >p.p.are< q.p.are)
|
||||
=> (spam leaf+"%meet merge failed, trying %mate" ~)
|
||||
perform(gem %mate)
|
||||
::
|
||||
%mate
|
||||
?. ?=(%mate-conflict p.p.are)
|
||||
$mate
|
||||
?. ?=($mate-conflict p.p.are)
|
||||
=+ "auto merge failed on strategy %mate"
|
||||
lose:(spam leaf/- >p.p.are< q.p.are)
|
||||
lose:(spam leaf+- >p.p.are< q.p.are)
|
||||
=> .(gem %meld)
|
||||
=+ tic=(cat 3 syd '-scratch')
|
||||
=> =+ :- "%mate merge failed with conflicts,"
|
||||
"setting up scratch space at %{(trip tic)}"
|
||||
[tic=tic (spam leaf/-< leaf/-> q.p.are)]
|
||||
[tic=tic (spam leaf+-< leaf+-> q.p.are)]
|
||||
(fancy-merge tic our syd %init)
|
||||
==
|
||||
::
|
||||
++ tape-to-tanks
|
||||
|= a=tape ^- (list tank)
|
||||
(scan a (more (just '\0a') (cook |=(a=tape leaf/a) (star prn))))
|
||||
|= a/tape ^- (list tank)
|
||||
(scan a (more (just '\0a') (cook |=(a/tape leaf+a) (star prn))))
|
||||
::
|
||||
++ tanks-if-any
|
||||
|= [a=tape b=(list path) c=tape] ^- (list tank)
|
||||
|= {a/tape b/(list path) c/tape} ^- (list tank)
|
||||
?: =(~ b) ~
|
||||
(welp (tape-to-tanks "\0a{c}{a}") >b< ~)
|
||||
::
|
||||
++ made
|
||||
|= [dep=@uvH reg=gage]
|
||||
|= {dep/@uvH reg/gage}
|
||||
^+ +>
|
||||
?: ?=(%| -.reg)
|
||||
?: ?=($| -.reg)
|
||||
=+ "failed to mash"
|
||||
lose:(spam leaf/- p.reg)
|
||||
=+ ^- can=(list (pair path (unit miso)))
|
||||
lose:(spam leaf+- p.reg)
|
||||
=+ ^- can/(list (pair path (unit miso)))
|
||||
%+ turn (gage-to-cages reg)
|
||||
|= [pax=cage dif=cage]
|
||||
|= {pax/cage dif/cage}
|
||||
^- (pair path (unit miso))
|
||||
?. ?=(%path p.pax)
|
||||
?. ?=($path p.pax)
|
||||
~| "strange path mark: {<p.pax>}"
|
||||
!!
|
||||
[((hard path) q.q.pax) ?:(?=(%null p.dif) ~ `[%dif dif])]
|
||||
:: ~& > kiln-made/[(turn can head) syd=syd +<.abet]
|
||||
=+ notated=(skid can |=([path a=(unit miso)] ?=(^ a)))
|
||||
=+ annotated=(turn `(list (pair path ,*))`-.notated head)
|
||||
=+ unnotated=(turn `(list (pair path ,*))`+.notated head)
|
||||
[((hard path) q.q.pax) ?:(?=($null p.dif) ~ `[%dif dif])]
|
||||
:: ~& > kiln-made+[(turn can head) syd=syd +<.abet]
|
||||
=+ notated=(skid can |=({path a/(unit miso)} ?=(^ a)))
|
||||
=+ annotated=(turn `(list (pair path *))`-.notated head)
|
||||
=+ unnotated=(turn `(list (pair path *))`+.notated head)
|
||||
=+ `desk`(cat 3 syd '-scratch')
|
||||
=+ ^- tan=(list tank)
|
||||
=+ ^- tan/(list tank)
|
||||
%- zing
|
||||
^- (list (list tank))
|
||||
:~ %- tape-to-tanks
|
||||
@ -598,7 +593,7 @@
|
||||
:* ost %info /kiln/[syd] our
|
||||
(cat 3 syd '-scratch') %&
|
||||
%+ murn can
|
||||
|= [p=path q=(unit miso)]
|
||||
|= {p/path q/(unit miso)}
|
||||
`(unit (pair path miso))`?~(q ~ `[p u.q])
|
||||
==
|
||||
--
|
||||
|
@ -1,10 +1,9 @@
|
||||
::
|
||||
:::: /hoon/react/lib
|
||||
::
|
||||
!:
|
||||
|%
|
||||
++ react-elems :: XX /~
|
||||
~+ %- sa ^- (list term)
|
||||
~+ %- silt ^- (list term)
|
||||
:~ %a %abbr %address %area %article %aside %audio %b %base
|
||||
%bdi %bdo %big %blockquote %body %br %button %canvas %caption
|
||||
%cite %code %col %colgroup %data %datalist %dd %del %details
|
||||
@ -23,9 +22,9 @@
|
||||
==
|
||||
++ react-attrs
|
||||
~+ ^- (map term cord)
|
||||
%- mo ^- (list ,[term cord])
|
||||
%- molt ^- (list (pair term cord))
|
||||
:- [%class 'className']
|
||||
=- (rash - (more next (cook |=(a=tape [(cass a) (crip a)]) (star alf))))
|
||||
=- (rash - (more next (cook |=(a/tape [(cass a) (crip a)]) (star alf))))
|
||||
'''
|
||||
accept acceptCharset accessKey action allowFullScreen allowTransparency alt
|
||||
async autoComplete autoFocus autoPlay cellPadding cellSpacing charSet checked
|
||||
@ -35,25 +34,27 @@
|
||||
headers height hidden high href hrefLang htmlFor httpEquiv icon id label lang
|
||||
list loop low manifest marginHeight marginWidth max maxLength media mediaGroup
|
||||
method min multiple muted name noValidate open optimum pattern placeholder
|
||||
poster preload radioGroup readOnly rel required role rowSpan rows sandbox scope
|
||||
scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc
|
||||
srcSet start step style tabIndex target title type useMap value width wmode
|
||||
poster preload radioGroup readOnly rel required role rowSpan rows sandbox
|
||||
scope scoped scrolling seamless selected shape size sizes span spellCheck
|
||||
src srcDoc srcSet start step style tabIndex target title type useMap value
|
||||
width wmode
|
||||
'''
|
||||
++ react-vale
|
||||
~(has in react-elems)
|
||||
::
|
||||
++ react-to-json
|
||||
|= src=manx ^- json
|
||||
?: ?=(_:/(**) src)
|
||||
|= src/manx ^- json
|
||||
?: ?=(_;/(**) src)
|
||||
(jape v.i.a.g.src)
|
||||
=+ atr=(mo a.g.src)
|
||||
=+ atr=(molt `(list (pair mane tape))`a.g.src)
|
||||
?: (~(has by atr) [%urb %codemirror])
|
||||
?> ?=([[%pre *] _:/(**) ~] src)
|
||||
?> ?=({{$pre *} _;/(**) $~} src)
|
||||
=. a.g.src
|
||||
[value/v.i.a.g.i.c.src (skip a.g.src |=([a=mane *] ?=(^ a)))]
|
||||
[value+v.i.a.g.i.c.src (skip a.g.src |=({a/mane *} ?=(^ a)))]
|
||||
$(src [[%codemirror a.g.src] ~])
|
||||
?: (~(has by atr) [%urb %exec]) :: runnable code attribute tag
|
||||
?> ?=([[%pre *] _:/(**) ~] src) :: verify its only a text node
|
||||
=* code v.i.a.g.i.c.src
|
||||
?> ?=({{$pre *} _;/(**) $~} src) :: verify its only a text node
|
||||
=* code v.i.a.g.i.c.src
|
||||
%_ $
|
||||
src
|
||||
=+ =< result=(mule .)
|
||||
@ -61,39 +62,39 @@
|
||||
=+ claz=?:(-.result "rancode" "failedcode")
|
||||
;div(class "{claz}")
|
||||
;pre:"{code}"
|
||||
;+ ?: ?=(& -.result)
|
||||
;+ ?: ?=($& -.result)
|
||||
;code:"{~(ram re (sell p.result))}"
|
||||
;pre
|
||||
;div:"error"
|
||||
;* %+ turn p.result
|
||||
|= a=tank
|
||||
|= a/tank
|
||||
^- manx
|
||||
;div:"{~(ram re a)}"
|
||||
== ==
|
||||
==
|
||||
%- jobe :~
|
||||
c/a/(turn c.src ..$)
|
||||
gn/s/(mane-to-cord n.g.src)
|
||||
=< ga/(jobe (turn a.g.src .))
|
||||
|= [a=mane b=tape] ^- [cord json]
|
||||
c+a+(turn c.src ..$)
|
||||
gn+s+(mane-to-cord n.g.src)
|
||||
=< ga+(jobe (turn a.g.src .))
|
||||
|= {a/mane b/tape} ^- {cord json}
|
||||
:_ (jape b)
|
||||
?^ a (mane-to-cord a)
|
||||
(fall (~(get by react-attrs) a) a)
|
||||
==
|
||||
::
|
||||
++ mane-to-cord |=(a=mane `cord`?@(a a (rap 3 -.a ':' +.a ~)))
|
||||
++ mane-to-cord |=(a/mane `cord`?@(a a (rap 3 -.a ':' +.a ~)))
|
||||
:: generates React javascript XX deprecated
|
||||
++ react-to-tape
|
||||
|= src=manx ^- tape
|
||||
?: (~(has by (mo a.g.src)) [%urb %codemirror])
|
||||
?> ?=([[%pre *] _:/(**) ~] src)
|
||||
|= src/manx ^- tape
|
||||
?: (~(has by (molt `(list (pair mane tape))`a.g.src)) [%urb %codemirror])
|
||||
?> ?=({{$pre *} _;/(**) $~} src)
|
||||
$(src ;codemirror(value "{v.i.a.g.i.c.src}");)
|
||||
?: (~(has by (mo a.g.src)) [%urb %exec]) :: runnable code attribute tag
|
||||
?> ?=([[%pre *] _:/(**) ~] src) :: verify its only a text node
|
||||
?: (~(has by (molt `(list (pair mane tape))`a.g.src)) [%urb %exec])
|
||||
?> ?=({{$pre *} _;/(**) $~} src) :: verify its only a text node
|
||||
=* code v.i.a.g.i.c.src
|
||||
=+ ^= result
|
||||
(mule |.((slap !>(.) (ream (crip code))))) :: compile and run safely
|
||||
?: ?=(%.y -.result) :: it was ok
|
||||
?: ?=($.y -.result) :: it was ok
|
||||
=+ ^= new
|
||||
;div(class "rancode")
|
||||
;pre:"{code}"
|
||||
@ -107,30 +108,30 @@
|
||||
;div:"error"
|
||||
;* %+ turn
|
||||
(scag (dec (lent p.result)) p.result) :: hide react trace
|
||||
|= a=tank
|
||||
|= a/tank
|
||||
^- manx
|
||||
;div:"{~(ram re a)}"
|
||||
==
|
||||
==
|
||||
$(src error)
|
||||
;: weld
|
||||
"React.createElement("
|
||||
=* tan n.g.src
|
||||
?^ tan !! :: namespaces unsupported
|
||||
?: (react-vale tan)
|
||||
"'{(trip tan)}'"
|
||||
(trip tan)
|
||||
"React.createElement("
|
||||
?^ n.g.src !! :: namespaces unsupported
|
||||
?: (react-vale n.g.src)
|
||||
~! n.g.src
|
||||
"'{(trip n.g.src)}'"
|
||||
(trip n.g.src)
|
||||
", "
|
||||
=- (pojo (jobe (turn a.g.src -)))
|
||||
|= [a=mane b=tape]
|
||||
=. a ?+(a a %class 'className')
|
||||
|= {a/mane b/tape}
|
||||
=. a ?+(a a $class 'className')
|
||||
?^(a !! [a (jape b)])
|
||||
", "
|
||||
=< ~(ram re %rose [", " "[" "]"] (turn c.src .))
|
||||
|= a=manx
|
||||
?: ?=(_:/(**) a)
|
||||
leaf/(pojo (jape v.i.a.g.a))
|
||||
leaf/^$(src a)
|
||||
=< ~(ram re %rose [", " "[" "]"] (turn c.src .))
|
||||
|= a/manx
|
||||
?: ?=(_;/(**) a)
|
||||
leaf+(pojo (jape v.i.a.g.a))
|
||||
leaf+^$(src a)
|
||||
")"
|
||||
==
|
||||
--
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/sole/lib
|
||||
::
|
||||
:::: /hoon+sole+lib
|
||||
::
|
||||
/? 310
|
||||
/- sole
|
||||
@ -10,17 +10,17 @@
|
||||
|_ sole-share :: shared-state engine
|
||||
++ abet +<
|
||||
++ apply
|
||||
|= ted=sole-edit
|
||||
|= ted/sole-edit
|
||||
^+ +>
|
||||
?- -.ted
|
||||
%del +>.$(buf (weld (scag p.ted buf) (slag +(p.ted) buf)))
|
||||
%ins +>.$(buf (weld (scag p.ted buf) `_buf`[q.ted (slag p.ted buf)]))
|
||||
%mor |- ^+ +>.^$
|
||||
$del +>.$(buf (weld (scag p.ted buf) (slag +(p.ted) buf)))
|
||||
$ins +>.$(buf (weld (scag p.ted buf) `_buf`[q.ted (slag p.ted buf)]))
|
||||
$mor |- ^+ +>.^$
|
||||
?~ p.ted
|
||||
+>.^$
|
||||
$(p.ted t.p.ted, +>.^$ ^$(ted i.p.ted))
|
||||
%nop +>.$
|
||||
%set +>.$(buf p.ted)
|
||||
$nop +>.$
|
||||
$set +>.$(buf p.ted)
|
||||
==
|
||||
::
|
||||
::::
|
||||
@ -33,43 +33,43 @@
|
||||
:: (apply:(apply b) y)
|
||||
::
|
||||
++ transmute :: dex as after sin
|
||||
|= [sin=sole-edit dex=sole-edit]
|
||||
|= {sin/sole-edit dex/sole-edit}
|
||||
~| [%transmute sin dex]
|
||||
^- sole-edit
|
||||
?: ?=(%mor -.sin)
|
||||
?: ?=($mor -.sin)
|
||||
|- ^- sole-edit
|
||||
?~ p.sin dex
|
||||
$(p.sin t.p.sin, dex ^$(sin i.p.sin))
|
||||
::
|
||||
?: ?=(%mor -.dex)
|
||||
?: ?=($mor -.dex)
|
||||
:- %mor
|
||||
|- ^- (list sole-edit)
|
||||
?~ p.dex ~
|
||||
[^$(dex i.p.dex) $(p.dex t.p.dex)]
|
||||
::
|
||||
?: |(?=(%nop -.sin) ?=(%nop -.dex)) dex
|
||||
?: ?=(%set -.sin) [%nop ~]
|
||||
?: ?=(%set -.dex) dex
|
||||
?: |(?=($nop -.sin) ?=($nop -.dex)) dex
|
||||
?: ?=($set -.sin) [%nop ~]
|
||||
?: ?=($set -.dex) dex
|
||||
::
|
||||
?- -.sin
|
||||
%del
|
||||
$del
|
||||
?- -.dex
|
||||
%del ?: =(p.sin p.dex) [%nop ~]
|
||||
$del ?: =(p.sin p.dex) [%nop ~]
|
||||
?:((lth p.sin p.dex) dex(p (dec p.dex)) dex)
|
||||
%ins ?:((lth p.sin p.dex) dex(p (dec p.dex)) dex)
|
||||
$ins ?:((lth p.sin p.dex) dex(p (dec p.dex)) dex)
|
||||
==
|
||||
::
|
||||
%ins
|
||||
$ins
|
||||
?- -.dex
|
||||
%del ?:((lte p.sin p.dex) dex(p +(p.dex)) dex)
|
||||
%ins ?: =(p.sin p.dex)
|
||||
$del ?:((lte p.sin p.dex) dex(p +(p.dex)) dex)
|
||||
$ins ?: =(p.sin p.dex)
|
||||
?:((lth q.sin q.dex) dex dex(p +(p.dex)))
|
||||
?:((lte p.sin p.dex) dex(p +(p.dex)) dex)
|
||||
==
|
||||
==
|
||||
::
|
||||
++ commit :: local change
|
||||
|= ted=sole-edit
|
||||
|= ted/sole-edit
|
||||
^- sole-share
|
||||
abet:(apply(own.ven +(own.ven), leg [ted leg]) ted)
|
||||
::
|
||||
@ -81,39 +81,39 @@
|
||||
:: =(+> (apply:(apply a) (inverse a)))
|
||||
::
|
||||
++ inverse :: relative inverse
|
||||
|= ted=sole-edit
|
||||
|= ted/sole-edit
|
||||
^- sole-edit
|
||||
=. ted ?.(?=([%mor * ~] ted) ted i.p.ted)
|
||||
=. ted ?.(?=({$mor * $~} ted) ted i.p.ted)
|
||||
?- -.ted
|
||||
%del [%ins p.ted (snag p.ted buf)]
|
||||
%ins [%del p.ted]
|
||||
%mor :- %mor
|
||||
$del [%ins p.ted (snag p.ted buf)]
|
||||
$ins [%del p.ted]
|
||||
$mor :- %mor
|
||||
%- flop
|
||||
|- ^- (list sole-edit)
|
||||
?~ p.ted ~
|
||||
:- ^$(ted i.p.ted)
|
||||
$(p.ted t.p.ted, +>.^$ (apply i.p.ted))
|
||||
%nop [%nop ~]
|
||||
%set [%set buf]
|
||||
$nop [%nop ~]
|
||||
$set [%set buf]
|
||||
==
|
||||
::
|
||||
++ receive :: naturalize event
|
||||
|= sole-change
|
||||
^- [sole-edit sole-share]
|
||||
^- {sole-edit sole-share}
|
||||
?. &(=(his.ler his.ven) (lte own.ler own.ven))
|
||||
~& [%receive-sync his/[his.ler his.ven] own/[own.ler own.ven]]
|
||||
~& [%receive-sync his+[his.ler his.ven] own+[own.ler own.ven]]
|
||||
!!
|
||||
?> &(=(his.ler his.ven) (lte own.ler own.ven))
|
||||
?> |(!=(own.ler own.ven) =(0 haw) =(haw (sham buf)))
|
||||
?> |(!=(own.ler own.ven) =(`@`0 haw) =(haw (sham buf)))
|
||||
=. leg (scag (sub own.ven own.ler) leg)
|
||||
:: ~? !=(own.ler own.ven) [%miss-leg leg]
|
||||
=+ dat=(transmute [%mor leg] ted)
|
||||
:: ~? !=(~ leg) [%transmute from/ted to/dat ~]
|
||||
:: ~? !=(~ leg) [%transmute from+ted to+dat ~]
|
||||
[dat abet:(apply(his.ven +(his.ven)) dat)]
|
||||
::
|
||||
++ remit :: conditional accept
|
||||
|= [cal=sole-change ask=$+((list ,@c) ?)]
|
||||
^- [(unit sole-change) sole-share]
|
||||
|= {cal/sole-change ask/$-((list @c) ?)}
|
||||
^- {(unit sole-change) sole-share}
|
||||
=+ old=buf
|
||||
=^ dat +>+<.$ (receive cal)
|
||||
?: (ask buf)
|
||||
@ -122,20 +122,20 @@
|
||||
[`lic +>+<.$]
|
||||
::
|
||||
++ transmit :: outgoing change
|
||||
|= ted=sole-edit
|
||||
^- [sole-change sole-share]
|
||||
|= ted/sole-edit
|
||||
^- {sole-change sole-share}
|
||||
[[[his.ven own.ven] (sham buf) ted] (commit ted)]
|
||||
::
|
||||
++ transceive :: receive and invert
|
||||
|= sole-change
|
||||
^- [sole-edit sole-share]
|
||||
^- {sole-edit sole-share}
|
||||
=+ old=buf
|
||||
=^ dat +>+<.$ (receive +<.$)
|
||||
[(inverse(buf old) dat) +>+<.$]
|
||||
::
|
||||
++ transpose :: adjust position
|
||||
|= pos=@ud
|
||||
|= pos/@ud
|
||||
=+ dat=(transmute [%mor leg] [%ins pos `@c`0])
|
||||
?> ?=(%ins -.dat)
|
||||
?> ?=($ins -.dat)
|
||||
p.dat
|
||||
--
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/talk/lib
|
||||
:::: /hoon+talk+lib
|
||||
::
|
||||
:: This file is in the public domain.
|
||||
::
|
||||
@ -11,15 +11,15 @@
|
||||
[. ^talk]
|
||||
|%
|
||||
++ main :: main story
|
||||
|= our=ship ^- cord
|
||||
|= our/ship ^- cord
|
||||
=+ can=(clan our)
|
||||
?+ can %porch
|
||||
%czar %court
|
||||
%king %floor
|
||||
$czar %court
|
||||
$king %floor
|
||||
==
|
||||
::
|
||||
++ said :: app message
|
||||
|= [our=@p dap=term now=@da eny=@uvI mes=(list tank)]
|
||||
|= {our/@p dap/term now/@da eny/@uvI mes/(list tank)}
|
||||
:- %talk-command
|
||||
^- command
|
||||
:- %publish
|
||||
@ -30,41 +30,4 @@
|
||||
:+ (shaf %thot eny)
|
||||
[[[%& our (main our)] [*envelope %pending]] ~ ~]
|
||||
[now *bouquet [%app dap (crip ~(ram re i.mes))]]
|
||||
++ rend-work-duty
|
||||
=+ work-stuff
|
||||
|^ |= due=duty ^- tape
|
||||
?- -.due
|
||||
%archive =+(due " -{(tr-id id)} fin.")
|
||||
%create =+(due " -{(tr-id id.tax)} new: {<title.tax>}")
|
||||
%change =+(due " -{(tr-id id)} mod {(tr-meat meat)}")
|
||||
%update
|
||||
=+ due
|
||||
" -{(tr-id id)} v{<version>} by {<her>} {(tr-meat meat.due)}"
|
||||
==
|
||||
++ tr-id |=(a=@uv (scow %uv (rsh 2 25 a)))
|
||||
++ tr-term
|
||||
|= a=term
|
||||
=+ ^- [typ=tape key=tape]
|
||||
%+ rash a
|
||||
;~ (glue hep)
|
||||
(plus aln)
|
||||
(plus ;~(pose (cold ' ' hep) next))
|
||||
==
|
||||
?+ (crip typ) "{typ} {key}"
|
||||
%set ":{key}"
|
||||
%add "+{key}"
|
||||
==
|
||||
++ tr-meat
|
||||
|= feh=flesh ^- tape
|
||||
?- -.feh
|
||||
%set-done =+(feh ?:(don (tr-term -.feh) (tr-term %set-undone)))
|
||||
%set-doer =+(feh "{(tr-term -.feh)} {?~(her "none" <u.her>)}")
|
||||
%set-date-due =+(feh "{(tr-term -.feh)} {?~(wen "none" <u.wen>)}")
|
||||
%set-tags =+(feh "{(tr-term -.feh)} {<tag>}")
|
||||
%set-title =+(feh "{(tr-term -.feh)} {<(trip til)>}")
|
||||
%set-description =+(feh "{(tr-term -.feh)} {<(trip des)>}")
|
||||
%add-comment =+ feh
|
||||
"{(tr-term -.feh)} {(scow %p who)} {<(trip com)>}"
|
||||
==
|
||||
--
|
||||
--
|
||||
|
@ -5,17 +5,17 @@
|
||||
!:
|
||||
|%
|
||||
++ getall :: search in manx
|
||||
|= tag=(list mane)
|
||||
|= ele=manx ^- marl
|
||||
?: (lien tag |=(a=mane =(a n.g.ele)))
|
||||
|= tag/(list mane)
|
||||
|= ele/manx ^- marl
|
||||
?: (lien tag |=(a/mane =(a n.g.ele)))
|
||||
~[ele]
|
||||
(zing (turn c.ele ..$))
|
||||
::
|
||||
++ map-to-json :: hoon data to json
|
||||
|* [a=$+(* cord) b=$+(* json)]
|
||||
|* c=(map) ^- json :: XX c=(map _+<.a _+<.b)
|
||||
|* {a/$-(* cord) b/$-(* json)}
|
||||
|* c/(map) ^- json :: XX c=(map _+<.a _+<.b)
|
||||
~! c
|
||||
(jobe (turn (~(tap by c)) |*([k=* v=*] [(a k) (b v)])))
|
||||
(jobe (turn (~(tap by c)) |*(* [(a +<-) (b +<+)])))
|
||||
::
|
||||
:: a.b_c.d => [[%a %b] [%c %d]]
|
||||
:: a.b_c, a_b__c => [[%a %b] %c]
|
||||
@ -23,16 +23,16 @@
|
||||
++ read-schem :: decode gapped noun
|
||||
=< (cook to-noun (cook build-grove apex))
|
||||
|%
|
||||
++ noun $|(term [noun noun]) :: shadow
|
||||
++ noun $@(term {noun noun}) :: shadow
|
||||
:: improper list of possible entry points
|
||||
++ grove $|(term [gap=@ sealed=noun pending=grove])
|
||||
++ grove $@(term {gap/@ sealed/noun pending/grove})
|
||||
++ apex ;~(plug sym (star ;~(plug delim sym)))
|
||||
++ delim ;~(pose (cold 0 dot) (cook lent (plus cab)))
|
||||
++ to-noun |=(a=grove ?@(a a [sealed.a $(a pending.a)]))
|
||||
++ to-noun |=(a/grove ?@(a a [sealed.a $(a pending.a)]))
|
||||
++ build-grove
|
||||
|= [a=grove b=(list ,[p=@u q=term])] ^- grove
|
||||
|= {a/grove b/(list {p/@u q/term})} ^- grove
|
||||
%+ roll b =< .(acc a)
|
||||
|= [[gap=@u v=term] acc=grove] ^- grove
|
||||
|= {{gap/@u v/term} acc/grove} ^- grove
|
||||
?@ acc [gap acc v]
|
||||
?: (gth gap gap.acc) [gap (to-noun acc) v]
|
||||
acc(pending $(acc pending.acc))
|
||||
|
@ -3,16 +3,16 @@
|
||||
:::: /hoon/write/lib
|
||||
::
|
||||
|%
|
||||
++ part ,[%write %0 pith] :: no state
|
||||
++ pith ,~
|
||||
++ part {$write $0 pith} :: no state
|
||||
++ pith $~
|
||||
--
|
||||
::
|
||||
::::
|
||||
::
|
||||
|%
|
||||
++ data $%([%json json] [%mime mime])
|
||||
++ card $% [%exec wire @p ~ [beak silk]]
|
||||
[%info wire @p toro]
|
||||
++ data $%({$json json} {$mime mime})
|
||||
++ card $% {$exec wire @p $~ {beak silk}}
|
||||
{$info wire @p toro}
|
||||
==
|
||||
--
|
||||
::
|
||||
@ -20,18 +20,10 @@
|
||||
::
|
||||
|= [bowl part]
|
||||
=* par +<+
|
||||
|_ moz=(list ,[bone card])
|
||||
|_ moz/(list {bone card})
|
||||
++ abet [(flop moz) `part`par]
|
||||
++ emit |=(a=card %_(+> moz :_(moz [ost a])))
|
||||
++ emit |=(a/card %_(+> moz :_(moz [ost a])))
|
||||
++ beak-now byk(r [%da now])
|
||||
:: ++ poke-json
|
||||
:: |= jon=json
|
||||
:: =- (poke--data (need (- jon.+)))
|
||||
:: => jo
|
||||
:: %- ot :~
|
||||
:: pax/(cu deft (su fel:stab))
|
||||
:: dat/(of json/some mime/(pe / (cu taco so)) ~) :: XX mite
|
||||
:: ==
|
||||
++ poke-wipe
|
||||
|= sup=spur ^+ abet :: XX determine extension, beak
|
||||
=+ ext=%md
|
||||
@ -41,35 +33,36 @@
|
||||
(fray (tope beak-now [ext sup]))
|
||||
::
|
||||
++ poke-tree
|
||||
|= [sup=spur mim=mime] ^+ abet :: XX determine extension, beak
|
||||
|= {sup/spur mim/mime} ^+ abet :: XX determine extension, beak
|
||||
(poke--data [`%md (flop sup)] %mime mim)
|
||||
::
|
||||
++ poke-paste
|
||||
|= [typ=?(%hoon %md %txt) txt=@t] ^+ abet
|
||||
(poke--data [`typ /web/paste/(scot %da now)] %mime / (taco txt))
|
||||
|= {typ/?($hoon $md $txt) txt/@t} ^+ abet
|
||||
(poke-data [`typ /web/paste/(scot %da now)] %mime / (taco txt))
|
||||
::
|
||||
++ poke-comment
|
||||
|= [pax=path txt=@t] ^+ abet
|
||||
|= {pax/path txt/@t} ^+ abet
|
||||
=. pax [%web (welp pax /(scot %da now))]
|
||||
=. txt (rap 3 (scot %p src) ': ' txt ~)
|
||||
(poke--data [`%comment-md pax] %mime / (taco txt))
|
||||
::
|
||||
++ poke--data
|
||||
|= [[ext=(unit ,@t) pax=path] dat=data] ^+ abet
|
||||
|= {{ext/(unit @t) pax/path} dat/data} ^+ abet
|
||||
?~ ext $(ext [~ -.dat])
|
||||
=+ cay=?-(-.dat %json [-.dat !>(+.dat)], %mime [-.dat !>(+.dat)])
|
||||
?: =(u.ext -.dat) (made pax ~ `cay)
|
||||
=+ cay=?-(-.dat $json [-.dat !>(+.dat)], $mime [-.dat !>(+.dat)])
|
||||
?: =(u.ext -.dat)
|
||||
(made pax ~ `cay)
|
||||
=< abet
|
||||
%^ emit %exec write/pax :: XX defer %nice
|
||||
%^ emit %exec write+pax :: XX defer %nice
|
||||
[our ~ beak-now %cast u.ext `cay]
|
||||
::
|
||||
++ made
|
||||
|= [pax=wire @ res=gage] ^+ abet
|
||||
|= {pax/wire @ res/gage} ^+ abet
|
||||
:: ?. =(our src)
|
||||
:: ~|(foreign-write/[our=our src=src] !!)
|
||||
?+ -.res ~|(gage/-.res !!)
|
||||
%| (mean p.res)
|
||||
%& =- abet:(emit %info write/~ our -)
|
||||
$| (mean p.res)
|
||||
$& =- abet:(emit %info write+~ our -)
|
||||
(foal :(welp (tope beak-now ~) pax /[-.p.res]) p.res)
|
||||
==
|
||||
--
|
||||
|
@ -1,17 +1,17 @@
|
||||
::
|
||||
:::: /hoon/ask-mail/mar
|
||||
:::: /hoon+ask-mail+mar
|
||||
::
|
||||
/? 314
|
||||
|_ txt=cord
|
||||
|_ txt/cord
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun ,@t :: clam from %noun
|
||||
++ noun @t :: clam from %noun
|
||||
++ json (cork so:jo need)
|
||||
--
|
||||
++ grow
|
||||
|%
|
||||
++ psal ;div: {(trip txt)}
|
||||
++ mime [text//plain (taco txt)]
|
||||
++ mime [text+/plain (taco txt)]
|
||||
--
|
||||
--
|
||||
|
@ -4,11 +4,11 @@
|
||||
/? 314
|
||||
!:
|
||||
:::: A minimal atom mark
|
||||
|_ ato=@
|
||||
|_ ato/@
|
||||
++ grab |%
|
||||
++ noun ,@
|
||||
++ mime |=([* p=octs] q.p)
|
||||
++ noun @
|
||||
++ mime |=({* p/octs} q.p)
|
||||
--
|
||||
++ grow |%
|
||||
++ mime [/aplication/x-urb-unknown (taco ato)]
|
||||
++ mime [/application/x-urb-unknown (taco ato)]
|
||||
-- --
|
||||
|
@ -2,15 +2,15 @@
|
||||
:::: /hoon/coffee/mar
|
||||
::
|
||||
/? 314
|
||||
|_ mud=@t
|
||||
|_ mud/@t
|
||||
++ grow
|
||||
|%
|
||||
++ mime [/text/coffeescript (taco mud)]
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ mime |=([p=mite q=octs] (,@t q.q))
|
||||
++ noun ,@t
|
||||
++ mime |=({p/mite q/octs} (@t q.q))
|
||||
++ noun @t
|
||||
--
|
||||
++ grad %mime
|
||||
--
|
||||
|
@ -1,7 +1,7 @@
|
||||
::
|
||||
:::: /hoon/css/mar
|
||||
::
|
||||
|_ mud=@t
|
||||
|_ mud/@t
|
||||
++ grow :: convert to
|
||||
|% ++ mime [/text/css (taco mud)] :: convert to %mime
|
||||
++ elem ;style :: convert to %hymn
|
||||
@ -11,8 +11,8 @@
|
||||
--
|
||||
++ grab
|
||||
|% :: convert from
|
||||
++ mime |=([p=mite q=octs] (,@t q.q))
|
||||
++ noun ,@t :: clam from %noun
|
||||
++ mime |=({p/mite q/octs} (@t q.q))
|
||||
++ noun @t :: clam from %noun
|
||||
--
|
||||
++ grad %mime
|
||||
--
|
||||
|
@ -2,7 +2,7 @@
|
||||
:::: /hoon/belt/dill/mar
|
||||
::
|
||||
/? 314
|
||||
/- kyev,sole
|
||||
/- kyev, sole
|
||||
!:
|
||||
::::
|
||||
::
|
||||
@ -13,21 +13,22 @@
|
||||
|%
|
||||
++ json
|
||||
=< (cork . kyev)
|
||||
|= jon=^json ^- ^kyev
|
||||
%- need
|
||||
%. jon => jo %- ot
|
||||
:~ mod/(cu ^sa (ar (su (perk ~[%ctrl %shift %alt %meta]))))
|
||||
:- %key
|
||||
%+ cu |*(a=$%([%str @t] [%act @]) ?+(-.a a %str +.a))
|
||||
=- (of str/so act/(su (perk -)) ~)
|
||||
:~ %ctrl %shift %alt %meta %entr %esc %caps %uncap
|
||||
%pgup %pgdn %home %end %baxp %del %ins
|
||||
%up %down %left %right
|
||||
== ==
|
||||
|= jon/^json ^- ^kyev
|
||||
!!
|
||||
:: %- need
|
||||
:: %. jon => jo %- ot
|
||||
:: :~ mod+(cu silt (ar (su (perk ~[%ctrl %shift %alt %meta]))))
|
||||
:: :- %key
|
||||
:: %+ cu |*(a/$%({$str @t} {$act @}) ?+(-.a a $str +.a))
|
||||
:: =- (of [str+so act+(su (perk -)) ~])
|
||||
:: :~ %ctrl %shift %alt %meta %entr %esc %caps %uncap
|
||||
:: %pgup %pgdn %home %end %baxp %del %ins
|
||||
:: %up %down %left %right
|
||||
:: == ==
|
||||
++ kyev
|
||||
|= kev=^kyev ^- dill-belt
|
||||
~| dill-belt-incomplete/kev
|
||||
?: ?=([%act ?(%ctrl %shift %alt %meta)] q.kev)
|
||||
|= kev/^kyev ^- dill-belt
|
||||
~| dill-belt-incomplete+kev
|
||||
?: ?=({$act ?($ctrl $shift $alt $meta)} q.kev)
|
||||
[%txt ~] :: ignore
|
||||
=+ mod=(~(del in p.kev) %shift)
|
||||
?^ mod
|
||||
@ -37,21 +38,21 @@
|
||||
q.kev
|
||||
(con 96 q.kev) :: ctrl key decoding
|
||||
=+ cha=(tuba (trip q.kev))
|
||||
?> ?=([@ ~] cha) :: of a single character
|
||||
?> ?=({@ $~} cha) :: of a single character
|
||||
?+ mod !! :: modified by one buckykey
|
||||
[%ctrl ~ ~] [%ctl i.cha]
|
||||
[%alt ~ ~] [%met i.cha]
|
||||
{$ctrl $~ $~} [%ctl i.cha]
|
||||
{$alt $~ $~} [%met i.cha]
|
||||
==
|
||||
?@ q.kev
|
||||
[%txt (tuba (trip q.kev))]
|
||||
?+ +.q.kev !!
|
||||
%del [%del ~]
|
||||
%baxp [%bac ~]
|
||||
%entr [%ret ~]
|
||||
%up [%aro %u]
|
||||
%down [%aro %d]
|
||||
%left [%aro %l]
|
||||
%right [%aro %r]
|
||||
$del [%del ~]
|
||||
$baxp [%bac ~]
|
||||
$entr [%ret ~]
|
||||
$up [%aro %u]
|
||||
$down [%aro %d]
|
||||
$left [%aro %l]
|
||||
$right [%aro %r]
|
||||
== :: %yow, %rez?
|
||||
::
|
||||
++ noun dill-belt :: clam from %noun
|
||||
|
@ -4,7 +4,7 @@
|
||||
/? 314
|
||||
/- sole
|
||||
[sole .]
|
||||
|_ dib=dill-blit
|
||||
|_ dib/dill-blit
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
@ -14,11 +14,11 @@
|
||||
|%
|
||||
++ json
|
||||
^- ^json
|
||||
?+ -.dib ~|(unsupported-blit/-.dib !!)
|
||||
%mor [%a (turn p.dib |=(a=dill-blit json(dib a)))]
|
||||
%hop (joba %hop (jone p.dib))
|
||||
?(%pro %out) (joba -.dib (jape (tufa p.dib)))
|
||||
?(%bel %clr) (joba %act %s -.dib)
|
||||
?+ -.dib ~|(unsupported-blit+-.dib !!)
|
||||
$mor [%a (turn p.dib |=(a/dill-blit json(dib a)))]
|
||||
$hop (joba %hop (jone p.dib))
|
||||
?($pro $out) (joba -.dib (jape (tufa p.dib)))
|
||||
?($bel $clr) (joba %act %s -.dib)
|
||||
==
|
||||
--
|
||||
--
|
||||
|
@ -8,19 +8,19 @@
|
||||
::::
|
||||
::
|
||||
[markdown .]
|
||||
|_ don=down
|
||||
|_ don/down
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun down :: clam from %noun
|
||||
++ md
|
||||
|= src=@t
|
||||
|= src/@t
|
||||
=+ [atr mud]=(parse:frontmatter (lore src))
|
||||
[[%meta atr] (mark:down-jet mud)]
|
||||
--
|
||||
::
|
||||
++ grow :: convert into
|
||||
|%
|
||||
++ front ?~(don ~ ?:(?=(%meta -.i.don) p.i.don front(don t.don)))
|
||||
++ front ?~(don ~ ?:(?=($meta -.i.don) p.i.don front(don t.don)))
|
||||
++ hymn :: convert to %hymn
|
||||
;html
|
||||
;head:title:"Untitled"
|
||||
|
@ -2,7 +2,7 @@
|
||||
:::: /hoon/elem/mar
|
||||
::
|
||||
/? 314
|
||||
|_ own=manx
|
||||
|_ own/manx
|
||||
::
|
||||
++ grow :: convert to
|
||||
|%
|
||||
|
@ -5,16 +5,16 @@
|
||||
!:
|
||||
::::
|
||||
::
|
||||
|_ all=(map span cord)
|
||||
|_ all/(map knot cord)
|
||||
::
|
||||
++ grow :: convert to
|
||||
++ grow :: convert to
|
||||
|%
|
||||
++ json
|
||||
:- %o
|
||||
%- ~(run by all)
|
||||
|=(a=cord s/a)
|
||||
|=(a/cord s+a)
|
||||
--
|
||||
++ grab |% :: convert from
|
||||
++ noun (map span cord) :: clam from %noun
|
||||
++ grab |% :: convert from
|
||||
++ noun (map knot cord) :: clam from %noun
|
||||
:: ++ elem ,~
|
||||
-- --
|
||||
|
@ -1,17 +1,17 @@
|
||||
::
|
||||
:::: /hoon/helm-hi/mar
|
||||
:::: /hoon+helm-hi+mar
|
||||
::
|
||||
/? 314
|
||||
|_ txt=cord
|
||||
|_ txt/cord
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun ,@t :: clam from %noun
|
||||
++ noun @t :: clam from %noun
|
||||
++ json (cork so:jo need)
|
||||
--
|
||||
++ grow
|
||||
|%
|
||||
++ psal ;div: {(trip txt)}
|
||||
++ mime [text//plain (taco txt)]
|
||||
++ mime [text+/plain (taco txt)]
|
||||
--
|
||||
--
|
||||
|
@ -3,7 +3,7 @@
|
||||
::
|
||||
/? 314
|
||||
!:
|
||||
|_ own=@t
|
||||
|_ own/@t
|
||||
::
|
||||
++ grow :: convert to
|
||||
|%
|
||||
@ -41,8 +41,8 @@
|
||||
--
|
||||
++ grab
|
||||
|% :: convert from
|
||||
++ mime |=([p=mite q=octs] q.q)
|
||||
++ noun ,@t :: clam from %noun
|
||||
++ mime |=({p/mite q/octs} q.q)
|
||||
++ noun @t :: clam from %noun
|
||||
++ txt role
|
||||
--
|
||||
++ grad %txt
|
||||
|
@ -5,7 +5,7 @@
|
||||
::
|
||||
:::: compute
|
||||
::
|
||||
|_ htm=@t
|
||||
|_ htm/@t
|
||||
::
|
||||
++ grow :: convert to
|
||||
|% ::
|
||||
@ -13,6 +13,6 @@
|
||||
++ hymn (need (poxa htm)) :: to %hymn
|
||||
-- ::
|
||||
++ grab |% :: convert from
|
||||
++ noun ,@t :: clam from %noun
|
||||
++ mime |=([p=mite q=octs] q.q) :: retrieve form %mime
|
||||
++ noun @t :: clam from %noun
|
||||
++ mime |=({p/mite q/octs} q.q) :: retrieve form $mime
|
||||
-- --
|
||||
|
@ -1,9 +1,9 @@
|
||||
::
|
||||
:::: /hoon/httr/mar
|
||||
:::: /hoon+httr+mar
|
||||
::
|
||||
/? 314
|
||||
!:
|
||||
|_ hit=httr
|
||||
|_ hit/httr
|
||||
++ grow |% ++ wall (turn wain trip)
|
||||
++ wain (lore cord)
|
||||
++ json (need (poja cord))
|
||||
|
@ -2,7 +2,7 @@
|
||||
:::: /hoon/hymn/mar
|
||||
::
|
||||
/? 314
|
||||
|_ own=manx
|
||||
|_ own/manx
|
||||
::
|
||||
++ grow :: convert to
|
||||
|%
|
||||
|
@ -2,15 +2,15 @@
|
||||
:::: /hoon/jam/mar
|
||||
::
|
||||
!:
|
||||
|_ mud=@
|
||||
|_ mud/@
|
||||
++ grow
|
||||
|%
|
||||
++ mime [/application/octet-stream (taco mud)]
|
||||
--
|
||||
++ grab
|
||||
|% :: convert from
|
||||
++ mime |=([p=mite q=octs] q.q)
|
||||
++ noun ,@ :: clam from %noun
|
||||
++ mime |=({p/mite q/octs} q.q)
|
||||
++ noun @ :: clam from %noun
|
||||
--
|
||||
++ grad %mime
|
||||
--
|
||||
|
@ -2,18 +2,18 @@
|
||||
:::: /hoon/js/mar
|
||||
::
|
||||
!:
|
||||
|_ mud=@
|
||||
|_ mud/@
|
||||
++ grow
|
||||
|%
|
||||
++ mime [/application/javascript (taco (,@t mud))]
|
||||
++ mime [/application/javascript (taco (@t mud))]
|
||||
++ elem ;script
|
||||
;- (trip (,@t mud))
|
||||
;- (trip (@t mud))
|
||||
==
|
||||
++ hymn ;html:(head:"+{elem}" body)
|
||||
--
|
||||
++ grab
|
||||
|% :: convert from
|
||||
++ mime |=([p=mite q=octs] (,@t q.q))
|
||||
++ mime |=({p/mite q/octs} (@t q.q))
|
||||
++ noun cord :: clam from %noun
|
||||
--
|
||||
++ grad %mime
|
||||
|
@ -5,7 +5,7 @@
|
||||
::
|
||||
:::: compute
|
||||
::
|
||||
|_ jon=json
|
||||
|_ jon/json
|
||||
::
|
||||
++ grow :: convert to
|
||||
|%
|
||||
@ -14,7 +14,7 @@
|
||||
--
|
||||
++ grab
|
||||
|% :: convert from
|
||||
++ mime |=([p=mite q=octs] (fall (rush (,@t q.q) apex:poja) *json))
|
||||
++ mime |=({p/mite q/octs} (fall (rush (@t q.q) apex:poja) *json))
|
||||
++ noun json :: clam from %noun
|
||||
++ numb jone
|
||||
++ time jode
|
||||
|
@ -3,7 +3,7 @@
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|_ mud=@t
|
||||
|_ mud/@t
|
||||
++ grow
|
||||
|%
|
||||
++ mime [/text/x-markdown (taco mud)]
|
||||
@ -13,8 +13,8 @@
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ mime |=([p=mite q=octs] q.q)
|
||||
++ noun ,@t
|
||||
++ mime |=({p/mite q/octs} q.q)
|
||||
++ noun @t
|
||||
++ md |=(@t +<)
|
||||
++ txt role
|
||||
--
|
||||
|
@ -3,7 +3,7 @@
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|_ mud=@t
|
||||
|_ mud/@t
|
||||
++ grow
|
||||
|%
|
||||
++ mime [/text/x-markdown (taco mud)]
|
||||
@ -12,8 +12,8 @@
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ mime |=([p=mite q=octs] q.q)
|
||||
++ noun ,@t
|
||||
++ mime |=({p/mite q/octs} q.q)
|
||||
++ noun @t
|
||||
++ txt role
|
||||
--
|
||||
++ grad %txt
|
||||
|
@ -3,17 +3,17 @@
|
||||
::
|
||||
/? 314
|
||||
!:
|
||||
|_ own=mime
|
||||
|_ own/mime
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun mime :: clam from %noun
|
||||
++ tape |=(a=_"" [/application/x-urb-unknown (tact a)])
|
||||
++ tape |=(a/_"" [/application/x-urb-unknown (tact a)])
|
||||
--
|
||||
++ grad
|
||||
|%
|
||||
++ form %mime
|
||||
++ diff |=(mime +<)
|
||||
++ pact |=(mime +<)
|
||||
++ join |=([mime mime] `(unit mime)`~)
|
||||
++ join |=({mime mime} `(unit mime)`~)
|
||||
--
|
||||
--
|
||||
|
@ -1,8 +1,8 @@
|
||||
::
|
||||
:::: /hoon/purl/mar
|
||||
:::: /hoon+purl+mar
|
||||
::
|
||||
/? 314
|
||||
|_ url=purl
|
||||
|_ url/purl
|
||||
::
|
||||
++ grow |% ++ hiss [url %get ~ ~]
|
||||
--
|
||||
|
@ -2,13 +2,13 @@
|
||||
:::: /hoon/quri/mar
|
||||
::
|
||||
/? 314
|
||||
|_ url=quri
|
||||
|_ url/quri
|
||||
::
|
||||
++ grow |% ++ mime [text//x-uri (tact (apex:earn url))]
|
||||
++ grow |% ++ mime [text+/x-uri (tact (apex:earn url))]
|
||||
--
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun quri :: clam from %noun
|
||||
++ mime |=(mim=^mime (rash q.q.mim zest:urlp))
|
||||
++ mime |=(mim/^mime (rash q.q.mim zest:urlp))
|
||||
--
|
||||
--
|
||||
|
@ -1,16 +1,16 @@
|
||||
::
|
||||
:::: /hoon/snip/mar
|
||||
:::: /hoon+core+elem+mar
|
||||
::
|
||||
/? 314
|
||||
!:
|
||||
|%
|
||||
++ words 1
|
||||
++ hedtal
|
||||
=| met=marl
|
||||
|= a=marl ^- [hed=marl tal=marl]
|
||||
=| met/marl
|
||||
|= a/marl ^- {hed/marl tal/marl}
|
||||
?~ a [~ ~]
|
||||
?. ?=(%h1 n.g.i.a)
|
||||
?: ?=(%meta n.g.i.a)
|
||||
?. ?=($h1 n.g.i.a)
|
||||
?: ?=($meta n.g.i.a)
|
||||
$(a t.a, met [i.a met])
|
||||
=+ had=$(a c.i.a)
|
||||
?^ -.had had
|
||||
@ -18,19 +18,19 @@
|
||||
[c.i.a (weld (flop met) (limit words t.a))]
|
||||
::
|
||||
++ limit
|
||||
|= [lim=@u mal=marl]
|
||||
|= {lim/@u mal/marl}
|
||||
=< res
|
||||
|- ^- [rem=@u res=marl]
|
||||
|- ^- {rem/@u res/marl}
|
||||
?~ mal [lim ~]
|
||||
?~ lim [0 ~]
|
||||
=+ ^- [lam=@u hed=manx]
|
||||
?: ?=(_:/(**) i.mal)
|
||||
[lim :/(tay)]:(deword lim v.i.a.g.i.mal)
|
||||
=+ ^- {lam/@u hed/manx}
|
||||
?: ?=(_;/(**) i.mal)
|
||||
[lim ;/(tay)]:(deword lim v.i.a.g.i.mal)
|
||||
[rem ele(c res)]:[ele=i.mal $(mal c.i.mal)]
|
||||
[rem - res]:[hed $(lim lam, mal t.mal)]
|
||||
::
|
||||
++ deword
|
||||
|= [lim=@u tay=tape] ^- [lim=@u tay=tape]
|
||||
|= {lim/@u tay/tape} ^- {lim/@u tay/tape}
|
||||
?~ tay [lim tay]
|
||||
?~ lim [0 ~]
|
||||
=+ wer=(dot 1^1 tay)
|
||||
@ -41,20 +41,20 @@
|
||||
--
|
||||
::
|
||||
!:
|
||||
|_ [hed=marl tal=marl]
|
||||
|_ {hed/marl tal/marl}
|
||||
::
|
||||
++ grow :: convert to
|
||||
++ grow :: convert to
|
||||
|%
|
||||
++ mime
|
||||
=< mime
|
||||
|%
|
||||
++ elem ;div:(h1:"*{hed}" div:"*{tal}") :: convert to %elem
|
||||
++ hymn ;html:(head:title:"snip" body:"+{elem}") :: convert to %hymn
|
||||
++ html (crip (poxo hymn)) :: convert to %html
|
||||
++ mime [/text/html (taco html)] :: convert to %mime
|
||||
++ elem ;div:(h1:"*{hed}" div:"*{tal}") :: convert to %elem
|
||||
++ hymn ;html:(head:title:"snip" body:"+{elem}") :: convert to %hymn
|
||||
++ html (crip (poxo hymn)) :: convert to %html
|
||||
++ mime [/text/html (taco html)] :: convert to %mime
|
||||
--
|
||||
--
|
||||
++ grab |% :: convert from
|
||||
++ noun ,[marl marl] :: clam from %noun
|
||||
++ elem |=(a=manx (hedtal +.a))
|
||||
++ grab |% :: convert from
|
||||
++ noun {marl marl} :: clam from $noun
|
||||
++ elem |=(a/manx (hedtal +.a))
|
||||
-- --
|
||||
|
@ -12,25 +12,25 @@
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ json
|
||||
|= jon=^json ^- sole-action
|
||||
|= jon/^json ^- sole-action
|
||||
%- need %. jon
|
||||
=> [jo ..sole-action]
|
||||
|^ (fo %ret (of det/change ~))
|
||||
|^ (fo %ret (of det+change ~))
|
||||
++ fo
|
||||
|* [a=term b=fist]
|
||||
|=(c=json ?.(=([%s a] c) (b c) (some [a ~])))
|
||||
|* {a/term b/fist}
|
||||
|=(c/json ?.(=([%s a] c) (b c) (some [a ~])))
|
||||
::
|
||||
++ ra
|
||||
|* [a=[p=term q=fist] b=fist]
|
||||
|= c=json %. c
|
||||
?.(=(%a -.c) b (pe p.a (ar q.a)))
|
||||
|* {a/{term fist} b/fist}
|
||||
|= c/json %. c
|
||||
?.(=(%a -.c) b (pe -.a (ar +.a)))
|
||||
::
|
||||
++ change (ot ler/(at ni ni ~) ted/(cu |*(a=* [0v0 a]) edit) ~)
|
||||
++ change (ot ler+(at ni ni ~) ted+(cu |*(a/* [0v0 a]) edit) ~)
|
||||
++ char (cu turf so)
|
||||
++ edit
|
||||
%+ fo %nop
|
||||
%+ ra mor/|=(json (edit +<))
|
||||
(of del/ni set/(cu tuba sa) ins/(ot at/ni cha/char ~) ~)
|
||||
%+ ra mor+|=(json (edit +<))
|
||||
(of del+ni set+(cu tuba sa) ins+(ot at+ni cha+char ~) ~)
|
||||
--
|
||||
::
|
||||
++ noun sole-action :: clam from %noun
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user