Merge branch 'master' into clayhammer

This commit is contained in:
Philip C Monk 2015-09-15 19:16:09 -04:00
commit 852bd5a202
60 changed files with 345 additions and 225 deletions

View File

@ -10,7 +10,7 @@
!: :: ::
=> |% :: external structures
++ house :: all state
$: %1
$: %2
hoc=(map bone session) :: conversations
== ::
++ session :: per conversation
@ -27,6 +27,7 @@
[%pill p=path q=dojo-source] :: noun to unix pill
:: [%tree p=path q=dojo-source] :: noun to unix tree
[%file p=beam q=dojo-source] :: save to clay
[%http p=?(%post %put) q=purl r=dojo-source] :: http outbound
[%poke p=goal q=dojo-source] :: make and poke
[%show p=dojo-source] :: print
[%verb p=term q=(unit dojo-source)] :: store variable
@ -36,20 +37,14 @@
q=dojo-build :: general build
== ::
++ dojo-build :: one ford step
$% [%ec p=mark q=twig] :: caged expression
[%ex p=twig] :: hoon expression
[%di p=dojo-model] :: dialog
[%dv p=path] :: gate from source
[%fi p=dojo-filter q=dojo-source] :: filter
$% [%ur p=purl] :: http GET request
[%ge p=dojo-model] :: generator
[%sc p=dojo-model] :: script
[%dv p=path] :: core from source
[%ex p=twig] :: hoon expression
[%as p=mark q=dojo-source] :: simple transmute
[%do p=twig q=dojo-source] :: gate apply
[%tu p=(list dojo-source)] :: tuple
[%ur p=purl] :: http GET request
== ::
++ dojo-filter :: pipeline filter
$| mark :: simple transmute
twig :: function gate
::
++ dojo-model :: data construction
$: p=dojo-server :: core source
q=dojo-config :: configuration
@ -76,7 +71,7 @@
++ goal ,[p=ship q=term] :: flat application
++ clap :: action, user
$% [%peer p=path] :: subscribe
[%poke p=term q=*] :: apply
[%poke p=(cask)] :: apply
[%pull ~] :: unsubscribe
== ::
++ club :: action, system
@ -87,7 +82,7 @@
++ card :: general card
$% [%diff %sole-effect sole-effect] ::
[%send wire [ship term] clap] ::
[%hiss wire mark [%purl purl]] ::
[%hiss wire mark [%hiss hiss]] ::
[%exec wire @p (unit ,[beak silk])] ::
[%deal wire sock term club] ::
[%info wire @p toro] ::
@ -108,67 +103,44 @@
|_ [[ost=bone moz=(list move)] session] ::
++ dp :: dojo parser
|%
++ dp-default-app %hood
++ dp-specify
|= [gol=goal mod=dojo-model]
^- (pair goal dojo-source)
[gol [0 [%ge mod(q.p [q.gol q.p.mod])]]]
::
++ dp-command-line ;~(sfix dp-command (just '\0a'))
++ dp-command :: ++dojo-command
%+ knee *dojo-command |. ~+
;~ pose
;~ pfix bar
%+ cook
|= [a=path b=dojo-config]
^- dojo-command
[%poke [our.hid %hood] [0 %ge [0 [%cat %hood a]] b]]
;~(plug (most fas sym) dp-config)
;~ plug (cold %poke bar)
%+ cook dp-specify
(stag [our.hid dp-default-app] dp-model)
==
::
;~ plug (cold %poke col)
%+ cook
|= [a=goal b=(each dojo-source (trel term path dojo-config))]
|= [a=goal b=$&(dojo-model dojo-source)]
^- (pair goal dojo-source)
:- a
?- -.b
%& p.b
%| ?+ p.p.b !!
%di [0 %di [0 [%dog q.a q.p.b]] r.p.b]
%ge [0 %ge [0 [%cat q.a q.p.b]] r.p.b]
%sc [0 %sc [0 [%pig q.a q.p.b]] r.p.b]
==
==
?@ -.b [a b]
(dp-specify a b)
;~ plug
dp-goal
%+ pick ;~(pfix ace dp-source)
;~ plug
;~ pose
(cold %di wut)
(cold %ge lus)
(cold %sc pam)
==
(most fas sym)
dp-config
;~ pose
;~(pfix bar dp-model)
;~(pfix ace dp-source)
==
==
==
::
;~ plug (cold %verb tis)
;~(plug sym (punt ;~(pfix ace dp-source)))
==
::
;~ pfix fas
%+ cook
|=(a=(list twig) `dojo-command`[%verb %dir ~ [0 %ex %clsg a]])
dp-poor
==
::
;~ plug (cold %file tar)
;~((glue ace) dp-beam dp-source)
==
::
;~ plug (cold %flat pat)
;~((glue ace) (most fas sym) dp-source)
==
::
;~ plug (cold %pill dot)
;~((glue ace) (most fas sym) dp-source)
==
;~(plug (cold %file tar) dp-beam ;~(pfix ace dp-source))
;~(plug (cold %flat pat) (most fas sym) ;~(pfix ace dp-source))
;~(plug (cold %pill dot) (most fas sym) ;~(pfix ace dp-source))
;~(plug (cold %http lus) (easy %post) auri:epur ;~(pfix ace dp-source))
;~(plug (cold %http hep) (easy %put) auri:epur ;~(pfix ace dp-source))
;~(plug (cold %verb tis) sym (punt ;~(pfix ace dp-source)))
=< ;~(plug (cold %verb fas) (cook . dp-poor))
|=(a=(list twig) [%dir ~ [0 %ex %clsg a]])
::
(stag %show dp-source)
==
@ -176,38 +148,33 @@
++ dp-build :: ++dojo-build
%+ knee *dojo-build |. ~+
;~ pose
;~(pfix lus ;~(pose (stag %ur auri:epur) (stag %ge dp-model-cat)))
;~(plug (cold %di wut) dp-model-dog)
;~(plug (cold %fi cab) ;~((glue ace) dp-filter dp-source))
;~(plug (cold %ur lus) auri:epur)
;~(plug (cold %ge lus) dp-model)
;~(plug (cold %as pam) sym ;~(pfix ace dp-source))
;~(plug (cold %do cab) dp-twig ;~(pfix ace dp-source))
dp-value
==
::
++ dp-filter ;~(pose ;~(sfix sym cab) dp-twig) :: ++dojo-filter
++ dp-goal :: ++goal
%+ cook |=(a=goal a)
;~ pose
;~ plug
;~(pfix sig fed:ag)
;~(pfix fas sym)
;~(pfix sig fed:ag)
;~(pose ;~(pfix fas sym) (easy dp-default-app))
==
(cook |=(a=term `goal`[our.hid a]) sym)
(easy [our.hid %hood])
%+ stag our.hid
;~(pose sym (easy dp-default-app))
==
++ dp-beam :: ++beam
%+ sear tome
=+ vez=(vang & dp-path)
(sear plex:vez (stag %clsg poor:vez))
::
++ dp-model-cat ;~(plug dp-server-cat dp-config) :: ++dojo-model
++ dp-model-dog ;~(plug dp-server-dog dp-config) :: ++dojo-model
++ dp-model-pig ;~(plug dp-server-pig dp-config) :: ++dojo-model
++ dp-path (tope he-beam) :: ++path
++ dp-server-cat (stag 0 (stag %cat dp-device)) :: ++dojo-server
++ dp-server-dog (stag 0 (stag %dog dp-device)) :: ++dojo-server
++ dp-server-pig (stag 0 (stag %pig dp-device)) :: ++dojo-server
++ dp-twig tall:(vang & dp-path) :: ++twig
++ dp-poor poor:(vang & (tope dir)) :: (list ++twig)
++ dp-device (most fas sym) :: ++dojo-device
++ dp-model ;~(plug dp-server dp-config) :: ++dojo-model
++ dp-path (tope he-beam) :: ++path
++ dp-server (stag 0 (most fas sym)) :: ++dojo-server
++ dp-twig tall:(vang & dp-path) :: ++twig
++ dp-poor poor:(vang & (tope dir)) :: (list ++twig)
++ dp-value :: ++dojo-source
;~ pose
(stag %tu (ifix [kel ker] (most ace dp-source)))
@ -238,10 +205,10 @@
(he-card(poy `+>+<(pux `way)) %exec way our.hid `[he-beak kas])
::
++ dy-eyre :: send work to eyre
|= [way=wire req=[%purl purl]]
|= [way=wire req=hiss]
^+ +>+>
?> ?=(~ pux)
(he-card(poy `+>+<(pux `way)) %hiss way %httr req)
(he-card(poy `+>+<(pux `way)) %hiss way %httr %hiss req)
::
++ dy-stop :: stop work
^+ +>
@ -267,12 +234,16 @@
|= mad=dojo-command
^+ [mad +>]
?- -.mad
%file =^(src +>.$ (dy-init-source q.mad) [[%file p.mad src] +>.$])
%flat =^(src +>.$ (dy-init-source q.mad) [[%flat p.mad src] +>.$])
%pill =^(src +>.$ (dy-init-source q.mad) [[%pill p.mad src] +>.$])
%poke =^(src +>.$ (dy-init-source q.mad) [[%poke p.mad src] +>.$])
%show =^(src +>.$ (dy-init-source p.mad) [[%show src] +>.$])
%verb =^(src +>.$ (dy-init-source-unit q.mad) [[%verb p.mad src] +>.$])
%file =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$])
%flat =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$])
%pill =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$])
%poke =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$])
%show =^(src +>.$ (dy-init-source p.mad) [mad(p src) +>.$])
%verb =^(src +>.$ (dy-init-source-unit q.mad) [mad(q src) +>.$])
%http
=. r.mad [0 %as %mime r.mad]
=^ src +>.$ (dy-init-source r.mad)
[mad(r src) +>.$]
==
::
++ dy-init-source-unit :: (unit dojo-source)
@ -295,14 +266,11 @@
|= bul=dojo-build
^+ [bul +>]
?- -.bul
%ec [bul +>.$]
%ex [bul +>.$]
%di =^(mod +>.$ (dy-init-model p.bul) [[%di mod] +>.$])
%dv [bul +>.$]
%fi =^ mor +>.$ (dy-init-source q.bul)
[bul(q mor) +>.$]
%as =^(mor +>.$ (dy-init-source q.bul) [bul(q mor) +>.$])
%do =^(mor +>.$ (dy-init-source q.bul) [bul(q mor) +>.$])
%ge =^(mod +>.$ (dy-init-model p.bul) [[%ge mod] +>.$])
%sc !!
%ur [bul +>.$]
%tu =^ dof +>.$
|- ^+ [p.bul +>.^$]
@ -323,7 +291,7 @@
++ dy-init-server :: ++dojo-server
|= srv=dojo-server
=. p.srv num
[srv +>.$(num +(num), job (~(put by job) num [%dv q.srv]))]
[srv +>.$(num +(num), job (~(put by job) num [%dv [%gen q.srv]]))]
::
++ dy-init-config :: prepare config
|= cig=dojo-config
@ -380,7 +348,7 @@
::
++ dy-done :: dialog submit
|= txt=tape
?. ?=(^ pro)
?: |(?=(^ per) ?=(^ pux) ?=(~ pro))
~& %dy-no-prompt
(dy-diff %bel ~)
(dy-slam /dial u.pro !>(txt))
@ -445,20 +413,30 @@
=- +(..dy (he-diff %tan - ~))
rose/[" " `~]^~[leaf/"=%" (smyt (tope he-beak s.dir))]
==
::
%http
=+ cay=(~(got by rez) p.r.mad)
?> ?=(%mime p.cay)
=+ mim=;;(mime q.q.cay)
=+ maf=(~(add ja *math) content-type/(moon p.mim))
(dy-eyre /show [q.mad p.mad maf ~ q.mim])
::
%show
=+ cay=(~(got by rez) p.p.mad)
%+ dy-rash %tan
?+ p.cay [(sell q.cay)]~
%tang ;;(tang q.q.cay)
%httr
=+ hit=;;(httr q.q.cay)
=- (flop (turn `wall`- |=(a=tape leaf/(dash:ut a ''))))
:- "HTTP {<p.hit>}"
%+ weld
(turn q.hit |=([a=@t b=@t] "{(trip a)}: {(trip b)}"))
(turn `wain`?~(r.hit ~ (lore q.u.r.hit)) trip)
==
(dy-show (~(got by rez) p.p.mad))
==
::
++ dy-show
|= cay=cage
%+ dy-rash %tan
?+ p.cay [(sell q.cay)]~
%tang ;;(tang q.q.cay)
%httr
=+ hit=;;(httr q.q.cay)
=- (flop (turn `wall`- |=(a=tape leaf/(dash:ut a ''))))
:- "HTTP {<p.hit>}"
%+ weld
(turn q.hit |=([a=@t b=@t] "{(trip a)}: {(trip b)}"))
(turn `wain`?~(r.hit ~ (lore q.u.r.hit)) trip)
==
::
++ dy-edit :: handle edit
@ -480,34 +458,33 @@
::
++ dy-cage |=(num=@ud (~(got by rez) num)) :: known cage
++ dy-vase |=(num=@ud q:(dy-cage num)) :: known vase
++ dy-silk-vase |=(vax=vase [%$ %noun vax]) :: vase to silk
++ dy-silk-config :: configure
|= [cag=cage cig=dojo-config]
^- silk
:+ %ride [%cnzy %$]
:+ %mute [%$ cag]
^- (list (pair wing silk))
:* :- [[~ 12] ~]
(dy-silk-vase !>([now=now.hid eny=eny.hid bec=he-beak]))
::
:- [[~ 26] ~]
%- dy-silk-vase
|- ^- vase
?~ p.cig !>(~)
(slop (dy-vase p.i.p.cig) $(p.cig t.p.cig))
::
%+ turn (~(tap by q.cig))
|= [a=term b=(unit dojo-source)]
^- (pair wing silk)
:- [a [~ 27] ~]
%- dy-silk-vase
?~(b !>([~ ~]) (dy-vase p.u.b))
==
++ dy-silk-vase |=(vax=vase [%$ %noun vax]) :: vase to silk
++ dy-silk-sources :: sources to silk
|= src=(list dojo-source) ^- silk
%- dy-silk-vase
|-
?~ src !>(~)
(slop (dy-vase p.i.src) $(src t.src))
::
++ dy-silk-init-modo :: init and config
|= [cag=cage cig=dojo-config]
^- silk
(dy-silk-config cag cig)
++ dy-silk-config :: configure
|= [cay=cage cig=dojo-config]
^- [wire silk]
:- ?+ -.q.q.cay ~|(%bad-gen ~_((sell (slot 2 q.cay)) !!))
%say /gent
%ask /dial
%get /scar
==
=+ gat=(slot 3 q.cay)
:+ %call (dy-silk-vase gat)
:+ (dy-silk-vase !>([now=now.hid eny=eny.hid bec=he-beak]))
(dy-silk-sources p.cig)
:+ %mute (dy-silk-vase (fall (slew 27 gat) !>(~)))
%+ turn (~(tap by q.cig))
|= [a=term b=(unit dojo-source)]
^- (pair wing silk)
:- [a ~]
%- dy-silk-vase
?~(b !>([~ ~]) (dy-vase p.u.b))
::
++ dy-twig-head :: dynamic state
^- cage
@ -517,7 +494,7 @@
%- ~(rep by var)
|= [[a=term @ b=vase] c=vase] ^- vase
(sloop b(p face/[a p.b]) c)
!>(`[our=@p now=@da eny=@uvI]`[our now eny]:hid)
!>([our=our now=now eny=eny]:hid)
::
++ dy-made-dial :: dialog product
|= cag=cage
@ -541,6 +518,35 @@
[%pro pom(cad [':' ' ' cad.pom])]
==
::
++ dy-made-scar :: scraper product
|= cag=cage
^+ +>+>
?. ?=(^ q.q.cag)
(dy-diff %err q.q.cag)
=+ tan=((list tank) +2.q.q.cag)
=. +>+>.$ (he-diff %tan tan)
=+ vax=(spec (slot 3 q.cag))
~_ (sell q.cag)
?+ -.q.vax !!
%&
?~ +.q.vax
~& %dy-made-scar-abort
(dy-rash %bel ~)
(dy-meal (slot 7 vax))
::
%|
=+ hiz=;;(hiss +<.q.vax)
=. ..dy (he-diff %tan leaf/"< {(earn p.hiz)}" ~)
(dy-eyre(pro `(slap (slot 7 vax) cnzy/%q)) /scar hiz)
==
::
++ dy-sigh-scar :: scraper result
|= dat=cage
?~ pro
~& %dy-no-scraper
(dy-show dat)
(dy-slam(pux ~) /scar u.pro q.dat)
::
++ dy-made-gent :: generator product
|= cag=cage
(dy-meal q.cag)
@ -550,17 +556,15 @@
?> ?=(^ cud)
=+ bil=q.u.cud :: XX =*
?: ?=(%ur -.bil)
(dy-eyre /hand %purl p.bil)
(dy-eyre /hand [p.bil %get ~ ~])
%- dy-ford
^- (pair path silk)
?+ -.bil !!
%di [/dial (dy-silk-init-modo (dy-cage p.p.p.bil) q.p.bil)]
%ge [/gent (dy-silk-init-modo (dy-cage p.p.p.bil) q.p.bil)]
?- -.bil
%ge (dy-silk-config (dy-cage p.p.p.bil) q.p.bil)
%dv [/hand [%core he-beak (flop p.bil)]]
%ec [/hand [%cast p.bil (dy-mare q.bil)]]
%ex [/hand (dy-mare p.bil)]
%fi =+ dat=[%$ (dy-cage p.q.bil)]
[/hand ?@(p.bil [%cast p.bil dat] [%call (dy-mare p.bil) dat])]
%as [/hand [%cast p.bil [%$ (dy-cage p.q.bil)]]]
%do [/hand [%call (dy-mare p.bil) [%$ (dy-cage p.q.bil)]]]
%tu :- /hand
:- %$
:- %noun
@ -694,18 +698,25 @@
[%hand ~] dy-hand:dye
[%dial ~] dy-made-dial:dye
[%gent ~] dy-made-gent:dye
[%scar ~] dy-made-scar:dye
[%edit ~] dy-made-edit:dye
==
%| (he-diff(poy ~) %tan p.reg)
%tabl !!
==
::
++ he-sigh :: result from ford
++ he-sigh :: result from eyre
|= [way=wire hit=httr]
^+ +>
?> ?=(^ poy)
?> ?=([%hand ~] way) :: XX options?
he-pine:(~(dy-hand dy u.poy(pux ~)) %httr !>(hit))
=< he-pine
%. [%httr !>(hit)]
=+ dye=~(. dy u.poy(pux ~))
?+ way !!
[%hand ~] dy-hand:dye
[%show ~] dy-show:dye
[%scar ~] dy-sigh-scar:dye
==
::
++ he-unto :: result from behn
|= [way=wire cit=cuft]
@ -789,15 +800,19 @@
--
::
++ prep
=+ sosh==+(*session ,[_say syd=desk * (unit) _|3.-])
=+ session-1==+(*session ,_-(poy *(unit)))
=+ session-0==+(*session-1 ,[_say syd=desk * _|2.-])
:: ,_`..prep
|= old=(unit ?(house [%0 p=(map bone sosh)])) ^+ [~ ..prep]
=+ hoze=$%([%0 p=(map bone session-0)] [%1 p=(map bone session-1)])
|= old=(unit ?(house hoze)) ^+ [~ ..prep]
?~ old `..prep
?: ?=(%1 -.u.old) `..prep(+<+ u.old)
=< ^$(u.old [%1 (~(run by p.u.old) .)])
|= sos=sosh ^- session
=- ~! [%*(. *session poy *(unit)) -] -
[-.sos [[our.hid syd.sos ud/0] /] ~ |4.sos]
?- -.u.old
%2 `..prep(+<+ u.old)
%1 `..prep(+<+ [%2 (~(run by p.u.old) |=(session-1 +<(poy ~)))])
%0 =< ^$(u.old [%1 (~(run by p.u.old) .)])
|= sos=session-0 ^- session-1
[-.sos [[our.hid syd.sos ud/0] /] |3.sos]
==
::
:: pattern: ++ foo |=(data he-abet:(~(he-foo he (~(got by hoc) ost)) data))
++ arm (arm-session (~(got by hoc) ost.hid))

View File

@ -81,6 +81,7 @@
++ peer-drum (wrap peer):from-drum
++ poke-dill-belt (wrap poke-dill-belt):from-drum
++ poke-drum-link (wrap poke-link):from-drum
::++ poke-drum-exit (wrap poke-exit):from-drum
++ poke-drum-start (wrap poke-start):from-drum
++ poke-helm-hi (wrap poke-hi):from-helm
++ poke-helm-init (wrap poke-init):from-helm

View File

@ -355,7 +355,7 @@
if(this.status !== 205) {
return urb.keep()
}
document.location.reload()
urb.onupdate()
})
urb.wreq.addEventListener('error', urb.keep)
urb.wreq.addEventListener('abort', urb.keep)
@ -365,6 +365,7 @@
setTimeout(urb.call,1000*urb.tries)
urb.tries++
}
urb.onupdate = function(){document.location.reload()}
urb.call()
urb.wasp = function(deh){
var old = /[^/]*$/.exec(urb.wurl)[0]

View File

@ -993,9 +993,10 @@
(fine cof [%atom %t] u.mas)
%+ cope (fang cof for)
|= [cof=cafe tux=vase]
=+ bob=(slot 6 tux)
?: (~(nest ut p.bob) | p.sam)
(fine cof sam)
=+ typ=p:(slot 6 tux)
=. typ ?+(-.typ typ %face q.typ) :: XX vulcanization
?: (~(nest ut typ) | p.sam)
(fine cof typ q.sam)
?. (slob %grab p.tux)
(flaw cof [%leaf "ford: no grab: {<[for bek]>}"]~)
=+ gab=(slap tux [%cnzy %grab])
@ -1003,9 +1004,9 @@
(flaw cof [%leaf "ford: no noun: {<[for bek]>}"]~)
%+ cope (maul cof (slap gab [%cnzy %noun]) [%noun q.sam])
|= [cof=cafe pro=vase]
?> (~(nest ut p.bob) | p.pro)
?> (~(nest ut typ) | p.pro)
?: =(q.pro q.sam)
(fine cof p.bob q.pro)
(fine cof typ q.pro)
(flaw cof [%leaf "ford: invalid content: {<[for bek]>}"]~)
::
++ lamp :: normalize version
@ -1285,7 +1286,9 @@
(fine cof %& p.kas [%atom %t] '')
%+ cope (fang cof p.kas)
|= [cof=cafe tux=vase]
(fine cof [%& p.kas (slot 6 tux)])
=+ [typ=p val=q]:(slot 6 tux)
=. typ ?+(-.typ typ %face q.typ) :: XX vulcanization
(fine cof [%& p.kas [typ val]])
::
%call
:: %+ cool |.(leaf/"ford: call {<`@p`(mug kas)>}")

View File

@ -6,6 +6,7 @@
::
:::::::
!:
:- %say
|= [^ arg=[address=@t contact=@t ~] ~]
:- %address-contact
[address.arg contact.arg]

View File

@ -5,6 +5,7 @@
::
:::::
!:
:- %say
|= [^ [arg1=cord arg2=cord ~] ~] ::[arg=[cord cord ~] ~]]
:- %auth
[arg1 arg2]

View File

@ -5,6 +5,7 @@
::
:::::::
!:
:- %say
|= [^ [amount=@t currency=@t ~] ~]
:- %buy
[amount currency]

View File

@ -6,6 +6,7 @@
::
:::::::
!:
:- %say
|= [^ arg=[contact=@t address=@t ~] ~]
:- %bit-contact
[contact.arg address.arg]

View File

@ -5,6 +5,7 @@
::
:::::::
!:
:- %say
|= [^ ~ ~]
:- %list
~

View File

@ -5,6 +5,7 @@
::
:::::::
!:
:- %say
|= [^ [amount=@t currency=@t ~] ~]
:- %sell
[amount currency]

View File

@ -5,6 +5,7 @@
::
:::::::
!:
:- %say
|= [^ [to=@uc amo=@t ~] ~]
[%bit-send to amo]

View File

@ -1,12 +1,13 @@
:: ConCATenate file listings
::
:::: /hoon/cat/cat
:::: /hoon/gen/cat
::
// /%%/ls/subdir
// /%/pretty
!:
::::
::
:- %say
|= [^ [arg=(list path)] ~]
=- tang/(flop `tang`(zing -))
%+ turn arg

View File

@ -5,6 +5,7 @@
::
::::
!:
:- %say
|= [^ [arg=(list cord) ~]]
:- %keys
arg

6
gen/curl.hoon Normal file
View File

@ -0,0 +1,6 @@
/- sole
[sole]
:- %get |= [^ [a=tape ~] ~]
%+ sole-at (scan a auri:epur)
|= hit=httr
(sole-so %httr hit)

View File

@ -5,5 +5,6 @@
::
:::::
!:
:- %say
|= [^ [arg=tape ~] ~]
purl/(scan arg auri:epur)

View File

@ -1,10 +1,11 @@
::
:::: /hoon/hello/cat
:::: /hoon/hello/gen
::
/? 314
::
::::
!:
|= [* [[txt=@tas ~] ~]]
:- %say
|= [^ [[txt=@tas ~] ~]]
:- %noun
(crip (weld "hello, " (flop (trip txt))))

View File

@ -11,6 +11,7 @@
++ 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]) ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/reload/hood/cat
:::: /hoon/reload/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=(list term) ~]
==

View File

@ -1 +1,2 @@
:- %say
|=([^ [input=path output=path ~] ~] kiln-cp/[input output])

View File

@ -1 +1,2 @@
:- %say
|=([^ [who=ship mez=$|(~ [a=tape ~])] ~] helm-send-hi/[who ?~(mez ~ `a.mez)])

View File

@ -1,10 +1,11 @@
::
:::: /hoon/reload/hood/cat
:::: /hoon/reload/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[~ ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/invite/hood/cat
:::: /hoon/invite/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[[who=@p myl=@t ~] ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/label/hood/cat
:::: /hoon/label/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=[syd=desk lab=@tas ~] ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/link/hood/cat
:::: /hoon/link/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI byk=beak]
[arg=$?([dap=term ~] [who=ship dap=term ~]) ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/mass/hood/cat
:::: /hoon/mass/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=~ ~]
==

View File

@ -1,5 +1,5 @@
::
:::: /hoon/merge/hood/cat
:::: /hoon/merge/hood/gen
::
/? 314
!:
@ -10,6 +10,7 @@
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bek=beak]
[arg=[?(sorc [syd=$|(desk beaky) sorc])] gem=?(%auto germ)]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/mount/hood/cat
:::: /hoon/mount/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[[pax=path pot=$|(~ [v=@tas ~])] ~]
==

View File

@ -1 +1,2 @@
:- %say
|=([^ [input=path output=path ~] ~] kiln-mv/[input output])

View File

@ -1,10 +1,11 @@
::
:::: /hoon/reload/hood/cat
:::: /hoon/reload/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=~ ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/reload/hood/cat
:::: /hoon/reload/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=~ ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/reload/hood/cat
:::: /hoon/reload/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=[desk (list term)] ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/reload/hood/cat
:::: /hoon/reload/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=(list term) ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/reset/hood/cat
:::: /hoon/reset/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=~ ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/reload/hood/cat
:::: /hoon/reload/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=~ ~]
==

View File

@ -1 +1,2 @@
:- %say
|=([^ [input=path ~] ~] kiln-rm/input)

View File

@ -1 +1,2 @@
:- %say
|=([^ [where=path tym=@da eve=@t ~] ~] kiln-schedule/[where tym eve])

View File

@ -1,10 +1,11 @@
::
:::: /hoon/start/hood/cat
:::: /hoon/start/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=[@ $|(~ [@ ~])] ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/sync/hood/cat
:::: /hoon/sync/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=[syd=@tas her=@p sud=@tas ~] ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/unix/hood/cat
:::: /hoon/unix/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[[syd=@tas syn=?(~ [? ~])] ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/mount/hood/cat
:::: /hoon/mount/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[[mon=$|(term [span path]) ~] ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/unsync/hood/cat
:::: /hoon/unsync/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=[syd=@tas her=@p sud=@tas ~] ~]
==

View File

@ -7,6 +7,7 @@
::::
!:
[sole .]
:- %say
|= $: [now=@da eny=@ bec=beak]
[~ ~]
==

View File

@ -1,11 +1,12 @@
:: LiSt directory subnodes
::
:::: /hoon/ls/cat
:::: /hoon/ls/gen
::
// /%/subdir
!:
::::
::
:- %say
|= [^ [arg=path ~] ~]
=+ lon=((hard arch) .^(%cy arg))
tang/[?~(dir.lon leaf/"~" (subdir arg dir.lon))]~

2
gen/make.hoon Normal file
View File

@ -0,0 +1,2 @@
:- %say
|=([^ arg=(list ,@) foo=_`@`1 bar=_`@`2] noun/[arg foo bar])

24
gen/pope.hoon Normal file
View File

@ -0,0 +1,24 @@
:: Input twitter keys
/- sole
!:
=+ cryp=bruw :: XX change to ec2 ++brew eventually
=+ [sole]
:- %ask
|= $: [now=@da eny=@uvI bec=beak]
[[who=ship ~] ~]
==
^- (sole-result (cask tang))
%+ sole-yo leaf/"generating carrier {(scow %p who)} (#{(scow %ud who)})"
%+ sole-lo [%| %pope-pass "passphrase: "]
%+ sole-go (boss 256 (star prn))
|= 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)}"
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/solid/cat
:::: /hoon/solid/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[~ ~]
==

View File

@ -1,10 +1,11 @@
::
:::: /hoon/ticket/cat
:::: /hoon/ticket/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[[her=@p ~] ~]
==

View File

@ -1,10 +1,11 @@
:: Tree view recursive directory contents
::
:::: /hoon/tree/cat
:::: /hoon/tree/gen
::
!:
::::
::
:- %say
|= [^ [pax=path fla=$|(~ [%full ~])] ~]
=+ len=(lent pax)
=+ rend=?^(fla dank:ut |=(a=path (dank:ut (slag len a))))

View File

@ -3,6 +3,7 @@
::::
::
[twitter .]
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[[who=span msg=cord ~] ~]
==

View File

@ -6,6 +6,7 @@
++ baz64 (cook crip (star alp))
--
!:
:- %ask
|= $: [now=@da eny=@uvI bec=beak]
[~ ~]
==

View File

@ -10,6 +10,7 @@
|_ [hide ~]
++ stat ,[id=@u who=@ta now=@da txt=@t]
++ rens
:- %say
|=(stat rose/[": " `~]^~[leaf/"{<now>} @{(trip who)}" leaf/(trip txt)])
++ peer ,_`.
++ poke--args

View File

@ -215,6 +215,9 @@
=< se-abet =< se-view
(se-link gyl)
::
:: ++ poke-exit ::
:: |=(~ se-abet:(se-blit `dill-blit`[%qit ~])) :: XX find bone
:: ::
++ reap-phat ::
|= [way=wire saw=(unit tang)]
=< se-abet =< se-view

View File

@ -7,7 +7,7 @@
|_ ato=@
++ grab |%
++ noun ,@
++ mime |=([^ p=octs] q.p)
++ mime |=([* p=octs] q.p)
--
++ grow |%
++ mime [/aplication/x-urb-unknown (taco ato)]

View File

@ -1,8 +1,8 @@
/+ tree
/: /%%/ /%
/^ [tip=marl sub=(map span marl) ~]
/. /; (getall %h1 ~) /elem/
/_ /; (getall %h1 ~) /elem/
/. /; (getall:tree %h1 ~) /elem/
/_ /; (getall:tree %h1 ~) /elem/
==
!:
::::

View File

@ -13,44 +13,6 @@
haw=@uvH :: source hash
ted=sole-edit :: state change
== ::
++ sole-dialog :: standard dialog
|* out=$+(* *) :: output structure
$+(sole-input (sole-result out)) :: output function
:: ::
++ sole-result :: conditional result
|* out=$+(* *) :: output structure
$|(@ud (sole-product out)) :: error position
:: ::
++ sole-product :: success result
|* out=$+(* *) ::
%+ pair (list tank) ::
%+ each (unit out) :: ~ is abort
(pair sole-prompt (sole-dialog out)) :: ask and continue
:: ::
++ sole-so :: construct result
|* pro=* ::
[p=*(list tank) q=[%& p=[~ u=pro]]] ::
:: ::
++ sole-yo :: add output tank
|* [tan=tank res=(sole-result)] ::
?@ res res ::
[p=[i=tan t=p.res] q=q.res] ::
:: ::
++ sole-lo :: construct prompt
|* [pom=sole-prompt mor=(sole-dialog)] ::
[p=*(list tank) q=[%| p=pom q=mor]] ::
:: ::
++ sole-no :: empty result
[p=*(list tank) q=~] ::
:: ::
++ sole-go :: parse by rule
|* [sef=_rule fun=$+(* *)] ::
|= txt=sole-input ::
=+ vex=(sef [0 0] txt) ::
?: |(!=((lent txt) q.p.vex) ?=(~ q.vex)) ::
q.p.vex ::
(fun p.u.q.vex) ::
:: ::
++ sole-clock ,[own=@ud his=@ud] :: vector clock
++ sole-edit :: shared state change
$% [%del p=@ud] :: delete one at
@ -83,10 +45,69 @@
tag=term :: history mode
cad=tape :: caption
== ::
++ sole-input tape :: prompt input
++ sole-share :: symmetric state
$: ven=sole-clock :: our vector clock
leg=(list sole-edit) :: unmerged edits
buf=sole-buffer :: sole state
== ::
:: ::
:: ::
++ sole-dialog :: standard dialog
|* out=$+(* *) :: output structure
$+(sole-input (sole-result out)) :: output function
:: ::
++ sole-input tape :: prompt input
++ sole-result :: conditional result
|* out=$+(* *) :: output structure
$|(@ud (sole-product out)) :: error position
:: ::
++ sole-product :: success result
|* out=$+(* *) ::
%+ pair (list tank) ::
%+ each (unit out) :: ~ is abort
(pair sole-prompt (sole-dialog out)) :: ask and continue
:: ::
++ sole-request :: scraper result
|* out=$+(* *) :: output structure
%+ pair (list tank) ::
%+ each (unit out) :: ~ is abort
(pair hiss $+(httr (sole-request out))) :: fetch and continue
:: ::
++ sole-gen :: XX virtual type
$% [%say $+((sole-args) (cask))] :: direct noun
[%ask $+((sole-args) (sole-product (cask)))] :: dialog
[%get $+((sole-args) (sole-request (cask)))] :: scraper
== ::
++ sole-args :: generator arguments
|* _[lit=,* opt=,*] ::
,[[now=@da eny=@uvI bek=beak] [lit opt]] ::
:: ::
:: ::
++ sole-so :: construct result
|* pro=* ::
[p=*(list tank) q=[%& p=[~ u=pro]]] ::
:: ::
++ sole-yo :: add output tank
|* [tan=tank res=(sole-result)] ::
?@ res res ::
[p=[i=tan t=p.res] q=q.res] ::
:: ::
++ sole-lo :: construct prompt
|* [pom=sole-prompt mor=(sole-dialog)] ::
[p=*(list tank) q=[%| p=pom q=mor]] ::
:: ::
++ sole-at :: fetch url
|* [pul=_purl fun=$+(httr *)] ::
[p=*(list tank) q=[%| p=[pul %get ~ ~] q=fun]] ::
:: ::
++ sole-no :: empty result
[p=*(list tank) q=~] ::
:: ::
++ sole-go :: parse by rule
|* [sef=_rule fun=$+(* *)] ::
|= txt=sole-input ::
=+ vex=(sef [0 0] txt) ::
?: |(!=((lent txt) q.p.vex) ?=(~ q.vex)) ::
q.p.vex ::
(fun p.u.q.vex) ::
--