Merge remote-tracking branch 'origin/na-release/candidate' into m/flagday-keyfile

This commit is contained in:
Philip Monk 2020-12-01 14:02:37 -08:00
commit e69804a5ae
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
207 changed files with 11573 additions and 8865 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:35d8930b9b35364605196d99766ec713154af9105ce7b9fabfaa50e8ca29a5fd
size 4448128
oid sha256:c55d8f37ad4014bf92f04d0a4a74235f5514de84dad4dca58c40ae2900d06be2
size 4788607

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e5c82dea80aa7c5593f43fa4294db7974211abceedd907663da73889857642e7
size 1309381
oid sha256:85a4e1625d528b5fdc88faeff4fd288a23d6fbf1c11a846fc8f8d5b3cd38370f
size 2118873

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4365f9440cbd9253e5ffc37d10bf27d1ef9ce00853034611eb6b9813a12c486b
size 6430657
oid sha256:d7225be3d29183c74892d556fde2e06a416584e386ece002e81386437ab65770
size 6897081

View File

@ -26,24 +26,27 @@ done
# Update :lens, :dojo and dependencies
# FIXME: reduce this list
cp $ARVO/app/lens.hoon ./pier/home/app/
cp $ARVO/app/dojo.hoon ./pier/home/app/
cp $ARVO/lib/base64.hoon ./pier/home/lib/
cp $ARVO/lib/server.hoon ./pier/home/lib/
cp $ARVO/lib/sole.hoon ./pier/home/lib/
cp $ARVO/lib/xray.hoon ./pier/home/lib/
cp $ARVO/app/lens.hoon ./pier/home/app/
cp $ARVO/app/dojo.hoon ./pier/home/app/
cp $ARVO/lib/base64.hoon ./pier/home/lib/
cp $ARVO/lib/plume.hoon ./pier/home/lib/
cp $ARVO/lib/server.hoon ./pier/home/lib/
cp $ARVO/lib/sole.hoon ./pier/home/lib/
cp $ARVO/lib/xray.hoon ./pier/home/lib/
cp $ARVO/lib/pprint.hoon ./pier/home/lib/
mkdir -p ./pier/home/mar/lens/
cp $ARVO/mar/lens/* ./pier/home/mar/lens/
cp $ARVO/mar/lens/* ./pier/home/mar/lens/
cp $ARVO/sur/lens.hoon ./pier/home/sur/
cp $ARVO/sur/sole.hoon ./pier/home/sur/
cp $ARVO/sur/lens.hoon ./pier/home/sur/
cp $ARVO/sur/plum.hoon ./pier/home/sur/
cp $ARVO/sur/sole.hoon ./pier/home/sur/
cp $ARVO/sur/xray.hoon ./pier/home/sur/
# Update +solid and its dependencies
cp $ARVO/lib/pill.hoon ./pier/home/lib/
cp $ARVO/gen/solid.hoon ./pier/home/gen/
cp $ARVO/lib/pill.hoon ./pier/home/lib/
cp $ARVO/gen/solid.hoon ./pier/home/gen/
chmod -R u+rw ./pier/home/

View File

@ -1269,7 +1269,7 @@
?:(p.timez add sub)
=+ dat=(yore when)
=/ t
|= a/@
|= a=@
%+ weld
?:((lth a 10) "0" ~)
(scow %ud a)

View File

@ -10,17 +10,17 @@
:::: :: ::::
:: :: ::
=> |% :: external structures
++ id @tasession :: session id
++ house :: all state
$: $6
egg/@u :: command count
hoc/(map id session) :: conversations
acl/(set ship) :: remote access whitelist
+$ id @tasession :: session id
+$ house :: all state
$: %6
egg=@u :: command count
hoc=(map id session) :: conversations
acl=(set ship) :: remote access whitelist
== ::
++ session :: per conversation
$: say/sole-share :: command-line state
dir/beam :: active path
poy/(unit dojo-project) :: working
+$ session :: per conversation
$: say=sole-share :: command-line state
dir=beam :: active path
poy=(unit dojo-project) :: working
$: :: sur: structure imports
::
sur=(list cable:clay)
@ -28,75 +28,75 @@
::
lib=(list cable:clay)
==
var/(map term cage) :: variable state
old/(set term) :: used TLVs
buf/tape :: multiline buffer
var=(map term cage) :: variable state
old=(set term) :: used TLVs
buf=tape :: multiline buffer
== ::
++ monkey :: per conversation
$: say/sole-share :: command-line state
dir/beam :: active path
poy/(unit dojo-project) :: working
var/(map term cage) :: variable state
old/(set term) :: used TLVs
buf/tape :: multiline buffer
+$ monkey :: per conversation
$: say=sole-share :: command-line state
dir=beam :: active path
poy=(unit dojo-project) :: working
var=(map term cage) :: variable state
old=(set term) :: used TLVs
buf=tape :: multiline buffer
== ::
++ dojo-command ::
+$ dojo-command ::
$^ (pair dojo-sink dojo-source) :: route value
{$brev p/term} :: unbind variable
[%brev p=term] :: unbind variable
::
++ dojo-sink ::
$% {$flat p/path} :: atom to unix
{$pill p/path} :: noun to unix pill
:: {$tree p/path} :: noun to unix tree
{$file p/beam} :: save to clay
$: $http :: http outbound
p/?($post $put)
r/@t
+$ dojo-sink ::
$% [%flat p=path] :: atom to unix
[%pill p=path] :: noun to unix pill
:: [%tree p=path] :: noun to unix tree
[%file p=beam] :: save to clay
$: %http :: http outbound
p=?(%post %put)
r=@t
==
{$poke p/goal} :: poke app
{$show p/?($0 $1 $2 $3 $4 $5)} :: val/type/hoon/xray
{$verb p/term} :: store variable
[%poke p=goal] :: poke app
[%show p=?(%0 %1 %2 %3 %4 %5)] :: val/type/hoon/xray
[%verb p=term] :: store variable
== ::
++ dojo-source :: construction node
$: p/@ud :: assembly index
q/dojo-build :: general build
+$ dojo-source :: construction node
$: p=@ud :: assembly index
q=dojo-build :: general build
== ::
++ dojo-build :: one arvo step
+$ dojo-build :: one arvo step
$~ [%ex *hoon]
$% {$ur p/@t} :: http GET request
{$ge p/dojo-model} :: generator
{$te p/term q/(list dojo-source)} :: thread
{$dv p/path} :: core from source
{$ex p/hoon} :: hoon expression
{$sa p/mark} :: example mark value
{$as p/mark q/dojo-source} :: simple transmute
{$do p/hoon q/dojo-source} :: gate apply
{$tu p/(list dojo-source)} :: tuple
$% [%ur p=@t] :: http GET request
[%ge p=dojo-model] :: generator
[%te p=term q=(list dojo-source)] :: thread
[%dv p=path] :: core from source
[%ex p=hoon] :: hoon expression
[%sa p=mark] :: example mark value
[%as p=mark q=dojo-source] :: simple transmute
[%do p=hoon q=dojo-source] :: gate apply
[%tu p=(list dojo-source)] :: tuple
== ::
++ dojo-model :: data construction
$: p/dojo-server :: core source
q/dojo-config :: configuration
+$ dojo-model :: data construction
$: p=dojo-server :: core source
q=dojo-config :: configuration
== ::
++ dojo-server :: numbered device
$: p/@ud :: assembly index
q/path :: gate path
+$ dojo-server :: numbered device
$: p=@ud :: assembly index
q=path :: gate path
== ::
++ dojo-config :: configuration
$: p/(list dojo-source) :: by order
q/(map term (unit dojo-source)) :: by keyword
+$ dojo-config :: configuration
$: p=(list dojo-source) :: by order
q=(map term (unit dojo-source)) :: by keyword
== ::
++ dojo-project :: construction state
$: mad/dojo-command :: operation
num/@ud :: number of tasks
cud/(unit dojo-source) :: now solving
pux/(unit path) :: working
pro/(unit vase) :: prompting loop
per/(unit sole-edit) :: pending reverse
job/(map @ud dojo-build) :: problems
rez/(map @ud cage) :: results
+$ dojo-project :: construction state
$: mad=dojo-command :: operation
num=@ud :: number of tasks
cud=(unit dojo-source) :: now solving
pux=(unit path) :: working
pro=(unit vase) :: prompting loop
per=(unit sole-edit) :: pending reverse
job=(map @ud dojo-build) :: problems
rez=(map @ud cage) :: results
== ::
++ bead {p/(set beam) q/cage} :: computed result
++ goal {p/ship q/term} :: flat application
+$ bead [p=(set beam) q=cage] :: computed result
+$ goal [p=ship q=term] :: flat application
--
=>
|%
@ -130,7 +130,7 @@
++ parse-variable
|* [sym=rule src=rule]
%+ cook
|= {a/term b/(unit dojo-source)}
|= [a=term b=(unit dojo-source)]
^- dojo-command
?~(b [%brev a] [[%verb a] u.b])
;~(plug sym (punt src))
@ -146,7 +146,7 @@
::
;~ pfix col
%+ cook
|= {a/goal b/$^(dojo-model dojo-source)}
|= [a=goal b=$^(dojo-model dojo-source)]
?@ -.b [[%poke a] b]
(to-command a b)
;~ plug
@ -183,7 +183,7 @@
;~(plug (cold %pill dot) (most fas sym))
;~(plug (cold %http lus) (stag %post parse-url))
;~(plug (cold %http hep) (stag %put parse-url))
(stag %show (cook $?($1 $2 $3 $4 $5) (cook lent (stun [1 5] wut))))
(stag %show (cook $?(%1 %2 %3 %4 %5) (cook lent (stun [1 5] wut))))
==
::
++ parse-cables
@ -224,7 +224,7 @@
==
::
++ parse-goal
%+ cook |=(a/goal a)
%+ cook |=(a=goal a)
;~ pose
;~ plug
;~(pfix sig fed:ag)
@ -248,7 +248,7 @@
::
=? a &(?=(^ a) =('' i.a))
t.a
(fall (de-beam:format a) [`beak`[p q r]:dir (flop a)])
(fall (de-beam:format a) [`beak`[p q r]:dir a])
=+ vez=hoon-parser
(sear plex:vez (stag %clsg poor:vez))
::
@ -316,7 +316,7 @@
++ xsell `$-(vase tank)`vase-to-tank:pprint
::
++ he :: per session
|_ {hid/bowl:gall =id moz/(list card:agent:gall) session}
|_ [hid=bowl:gall =id moz=(list card:agent:gall) session]
::
++ he-beam
^- beam
@ -363,31 +363,31 @@
[%pass u.pux %arvo %c %warp ship desk ~]
::
++ dy-errd :: reject change, abet
|= {rev/(unit sole-edit) err/@u}
|= [rev=(unit sole-edit) err=@u]
^+ +>+>
(he-errd(poy `+>+<) rev err)
::
++ dy-diff :: send effects, abet
|= fec/sole-effect
|= fec=sole-effect
^+ +>+>
(he-diff(poy `+>+<) fec)
::
++ dy-rash :: send effects, amok
|= fec/sole-effect
|= fec=sole-effect
^+ +>+>
(he-diff(poy ~) fec)
::
++ dy-init-command :: ++dojo-command
|= mad/dojo-command
|= mad=dojo-command
^+ [mad +>]
?@ -.mad [mad +>.$]
=. q.mad
?+(-.p.mad q.mad $http [0 %as %mime q.mad])
?+(-.p.mad q.mad %http [0 %as %mime q.mad])
=^ src +>.$ (dy-init-source q.mad)
[mad(q src) +>.$]
::
++ dy-init-source :: ++dojo-source
|= src/dojo-source
|= src=dojo-source
^+ [src +>]
=^ bul +> (dy-init-build q.src)
=: p.src num
@ -396,48 +396,48 @@
[src +>.$(num +(num), job (~(put by job) -.src +.src))]
::
++ dy-init-source-unit :: (unit dojo-source)
|= urc/(unit dojo-source)
|= urc=(unit dojo-source)
^+ [urc +>]
?~ urc [~ +>]
=^ src +> (dy-init-source u.urc)
[`src +>.$]
::
++ dy-init-build :: ++dojo-build
|= bul/dojo-build
|= bul=dojo-build
^+ [bul +>]
?- -.bul
$ex [bul +>.$]
$dv [bul +>.$]
$sa [bul +>.$]
$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] +>.$])
$te =^(mod +>.$ (dy-init-ordered q.bul) [bul(q mod) +>.$])
$ur [bul +>.$]
$tu =^(dof +>.$ (dy-init-ordered p.bul) [[%tu dof] +>.$])
%ex [bul +>.$]
%dv [bul +>.$]
%sa [bul +>.$]
%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] +>.$])
%te =^(mod +>.$ (dy-init-ordered q.bul) [bul(q mod) +>.$])
%ur [bul +>.$]
%tu =^(dof +>.$ (dy-init-ordered p.bul) [[%tu dof] +>.$])
==
::
++ dy-init-model :: ++dojo-model
|= mol/dojo-model
|= mol=dojo-model
^+ [mol +>]
=^ one +>.$ (dy-init-server p.mol)
=^ two +>.$ (dy-init-config q.mol)
[[one two] +>.$]
::
++ dy-init-server :: ++dojo-server
|= srv/dojo-server
|= srv=dojo-server
=. p.srv num
[srv +>.$(num +(num), job (~(put by job) num [%dv [%gen q.srv]]))]
::
++ dy-init-config :: prepare config
|= cig/dojo-config
|= cig=dojo-config
^+ [cig +>]
=^ ord +>.$ (dy-init-ordered p.cig)
=^ key +>.$ (dy-init-named q.cig)
[[ord key] +>.$]
::
++ dy-init-ordered :: (list dojo-source)
|= ord/(list dojo-source)
|= ord=(list dojo-source)
^+ [ord +>]
?~ ord [~ +>.$]
=^ fir +>.$ (dy-init-source i.ord)
@ -445,7 +445,7 @@
[[fir mor] +>.$]
::
++ dy-init-named :: (map @tas dojo-src)
|= key/(map term (unit dojo-source))
|= key=(map term (unit dojo-source))
^+ [key +>.$]
?~ key [~ +>.$]
=^ top +>.$ (dy-init-source-unit q.n.key)
@ -458,31 +458,31 @@
=^(dam . (dy-init-command mad) +(mad dam))
::
++ dy-hand :: complete step
|= cag/cage
|= cag=cage
^+ +>+>
?> ?=(^ cud)
(dy-step(cud ~, rez (~(put by rez) p.u.cud cag)) +(p.u.cud))
::
++ dy-meal :: vase to cage
|= vax/vase
|= vax=vase
?. &(?=(@ -.q.vax) ((sane %tas) -.q.vax))
~& %dy-meal-cage
(dy-rash %bel ~)
(dy-hand -.q.vax (slot 3 vax))
::
++ dy-made-edit :: sole edit
|= cag/cage
|= cag=cage
^+ +>+>
?> ?=(^ per)
?: ?| ?=(^ q.q.cag)
=((lent buf.say) q.q.cag)
!&(?=($del -.u.per) =(+(p.u.per) (lent buf.say)))
!&(?=(%del -.u.per) =(+(p.u.per) (lent buf.say)))
==
dy-abet(per ~)
(dy-errd(per ~) per q.q.cag)
::
++ dy-done :: dialog submit
|= txt/tape
|= txt=tape
?: |(?=(^ per) ?=(^ pux) ?=(~ pro))
~& %dy-no-prompt
(dy-diff %bel ~)
@ -493,8 +493,8 @@
(dy-made-dial %noun p.res)
::
++ dy-cast
|* {typ/_* bun/vase}
|= a/vase ^- typ
|* [typ=_* bun=vase]
|= a=vase ^- typ
~| [p.bun p.a]
?> (~(nest ut p.bun) & p.a)
;;(typ q.a)
@ -503,51 +503,51 @@
^+ +>
:: XX needs filter
::
?: ?=({$show $3} -.mad)
?: ?=([%show %3] -.mad)
(dy-rash %tan (dy-show-source q.mad) ~)
?: ?=($brev -.mad)
?: ?=(%brev -.mad)
=. var (~(del by var) p.mad)
=< dy-amok
?+ p.mad .
$?($eny $now $our) !!
$lib .(lib ~)
$sur .(sur ~)
$dir .(dir [[our.hid %home ud+0] /])
$?(%eny %now %our) !!
%lib .(lib ~)
%sur .(sur ~)
%dir .(dir [[our.hid %home ud+0] /])
==
=+ cay=(~(got by rez) p.q.mad)
?- -.p.mad
$verb
%verb
=. var (~(put by var) p.p.mad cay)
~| bad-set+[p.p.mad p.q.cay]
=< dy-amok
?+ p.p.mad .
$eny ~|(%entropy-is-eternal !!)
$now ~|(%time-is-immutable !!)
$our ~|(%self-is-immutable !!)
$lib
%eny ~|(%entropy-is-eternal !!)
%now ~|(%time-is-immutable !!)
%our ~|(%self-is-immutable !!)
%lib
%_ .
lib
((dy-cast (list cable:clay) !>(*(list cable:clay))) q.cay)
==
::
$sur
%sur
%_ .
sur
((dy-cast (list cable:clay) !>(*(list cable:clay))) q.cay)
==
::
$dir =+ ^= pax ^- path
%dir =+ ^= pax ^- path
=+ pax=((dy-cast path !>(*path)) q.cay)
?: ?=(~ pax) ~[(scot %p our.hid) %home '0']
?: ?=({@ ~} pax) ~[i.pax %home '0']
?: ?=({@ @ ~} pax) ~[i.pax i.t.pax '0']
?: ?=([@ ~] pax) ~[i.pax %home '0']
?: ?=([@ @ ~] pax) ~[i.pax i.t.pax '0']
pax
=. dir (need (de-beam:format pax))
=- +>(..dy (he-diff %tan - ~))
rose+[" " `~]^~[leaf+"=%" (smyt (en-beam:format he-beak s.dir))]
==
::
$poke
%poke
%- he-card(poy ~)
:* %pass
/poke
@ -557,22 +557,22 @@
cay
==
::
$file
%file
%- he-card(poy ~)
:* %pass /file %arvo %c
%info (foal:space:userlib (en-beam:format p.p.mad) cay)
==
::
$flat
%flat
?^ q.q.cay
(dy-rash %tan [%leaf "not an atom"]~)
(dy-rash %sav p.p.mad q.q.cay)
::
$pill
%pill
(dy-rash %sag p.p.mad q.q.cay)
::
$http
?> ?=($mime p.cay)
%http
?> ?=(%mime p.cay)
=+ mim=;;(mime q.q.cay)
%+ dy-request /show
:* ?:(=(%put p.p.mad) %'PUT' %'POST')
@ -581,7 +581,7 @@
`q.mim
==
::
$show
%show
|^ (prnt cay note)
++ prnt ?: (gte p.p.mad 4)
dy-xprint
@ -591,7 +591,7 @@
%0 ~
%1 [[%rose [~ " " ~] (skol p.q.cay) ~] maar]
%2 [[%rose [~ " " ~] (dy-show-type-noun p.q.cay) ~] maar]
::%3 handled above
::%3 handled above
%4 ~
%5 [[%rose [~ " " ~] (xskol p.q.cay) ~] maar]
==
@ -600,22 +600,22 @@
--
==
::
++ dy-show |=(cay/cage (dy-print cay ~))
++ dy-show |=(cay=cage (dy-print cay ~))
::
:: Print a value (given as a cage) and a note (given as a tang).
::
++ dy-xprint
|= {cay/cage tan/tang}
|= [cay=cage tan=tang]
%+ dy-rash %tan
%- welp :_ tan
?+ p.cay [(xsell q.cay)]~
$tang ;;(tang q.q.cay)
$httr
%tang ;;(tang q.q.cay)
%httr
=+ hit=;;(httr:eyre q.q.cay)
=- (flop (turn `wall`- |=(a/tape leaf+(dash:us a '' ~))))
=- (flop (turn `wall`- |=(a=tape leaf+(dash:us a '' ~))))
:- "HTTP {<p.hit>}"
%+ weld
(turn q.hit |=({a/@t b/@t} "{(trip a)}: {(trip b)}"))
(turn q.hit |=([a=@t b=@t] "{(trip a)}: {(trip b)}"))
:- i=""
t=(turn `wain`?~(r.hit ~ (to-wain:format q.u.r.hit)) trip)
==
@ -623,39 +623,39 @@
:: Print a value (given as a cage) and a note (given as a tang).
::
++ dy-print
|= {cay/cage tan/tang}
|= [cay=cage tan=tang]
%+ dy-rash %tan
%- welp :_ tan
?+ p.cay [(sell q.cay)]~
$tang ;;(tang q.q.cay)
$httr
%tang ;;(tang q.q.cay)
%httr
=+ hit=;;(httr:eyre q.q.cay)
=- (flop (turn `wall`- |=(a/tape leaf+(dash:us a '' ~))))
=- (flop (turn `wall`- |=(a=tape leaf+(dash:us a '' ~))))
:- "HTTP {<p.hit>}"
%+ weld
(turn q.hit |=({a/@t b/@t} "{(trip a)}: {(trip b)}"))
(turn q.hit |=([a=@t b=@t] "{(trip a)}: {(trip b)}"))
:- i=""
t=(turn `wain`?~(r.hit ~ (to-wain:format q.u.r.hit)) trip)
==
++ dy-show-type-noun
|= a/type ^- tank
|= a=type ^- tank
=- >[-]<
|- ^- $? $% {$atom @tas (unit @)}
{$cell _$ _$}
{$face $@(term tune) _$}
{$fork (set _$)}
{$hold _$ hoon}
|- ^- $? $% [%atom @tas (unit @)]
[%cell _$ _$]
[%face $@(term tune) _$]
[%fork (set _$)]
[%hold _$ hoon]
==
wain :: "<|core|>"
$?($noun $void)
$?(%noun %void)
==
?+ a a
{$face ^} a(q $(a q.a))
{$cell ^} a(p $(a p.a), q $(a q.a))
{$fork *} a(p (silt (turn ~(tap in p.a) |=(b/type ^$(a b)))))
{$hint *} !!
{$core ^} `wain`/core
{$hold *} a(p $(a p.a))
[%face ^] a(q $(a q.a))
[%cell ^] a(p $(a p.a), q $(a q.a))
[%fork *] a(p (silt (turn ~(tap in p.a) |=(b=type ^$(a b)))))
[%hint *] !!
[%core ^] `wain`/core
[%hold *] a(p $(a p.a))
==
::
:: XX needs filter
@ -668,42 +668,42 @@
::$? hoon
;: jank-bucwut
hoon
$^ {dy-shown dy-shown}
$% {$ur cord}
{$sa mark}
{$as mark dy-shown}
{$do hoon dy-shown}
{$te term (list dy-shown)}
{$ge path (list dy-shown) (map term (unit dy-shown))}
{$dv path}
$^ [dy-shown dy-shown]
$% [%ur cord]
[%sa mark]
[%as mark dy-shown]
[%do hoon dy-shown]
[%te term (list dy-shown)]
[%ge path (list dy-shown) (map term (unit dy-shown))]
[%dv path]
==
==
::
++ dy-show-source
|= a/dojo-source ^- tank
|= a=dojo-source ^- tank
=- >[-]<
=+ `{@ bil/dojo-build}`a
=+ `[@ bil=dojo-build]`a
|- ^- dy-shown
?- -.bil
$?($ur $dv $sa) bil
$ex ?. ?=({$cltr *} p.bil) p.bil
$?(%ur %dv %sa) bil
%ex ?. ?=([%cltr *] p.bil) p.bil
|- ^- hoon
?~ p.p.bil !!
?~ t.p.p.bil i.p.p.bil
[i.p.p.bil $(p.p.bil t.p.p.bil)]
$tu ?~ p.bil !!
%tu ?~ p.bil !!
|-
?~ t.p.bil ^$(bil q.i.p.bil)
[^$(bil q.i.p.bil) $(p.bil t.p.bil)]
$as bil(q $(bil q.q.bil))
$do bil(q $(bil q.q.bil))
$te bil(q (turn q.bil ..$))
$ge :+ %ge q.p.p.bil
%as bil(q $(bil q.q.bil))
%do bil(q $(bil q.q.bil))
%te bil(q (turn q.bil ..$))
%ge :+ %ge q.p.p.bil
[(turn p.q.p.bil ..$) (~(run by q.q.p.bil) (lift ..$))]
==
::
++ dy-edit :: handle edit
|= cal/sole-change
|= cal=sole-change
^+ +>+>
=^ dat say (~(transceive sole say) cal)
?: |(?=(^ per) ?=(^ pux) ?=(~ pro))
@ -718,18 +718,18 @@
(dy-made-edit %noun p.res)
::
++ dy-type :: sole action
|= act/sole-action
|= act=sole-action
?- -.dat.act
$det (dy-edit +.dat.act)
$ret (dy-done (tufa buf.say))
$clr dy-stop
$tab +>+>
%det (dy-edit +.dat.act)
%ret (dy-done (tufa buf.say))
%clr dy-stop
%tab +>+>
==
::
++ dy-cage |=(num/@ud (~(got by rez) num)) :: known cage
++ dy-vase |=(num/@ud q:(dy-cage num)) :: known vase
++ dy-cage |=(num=@ud (~(got by rez) num)) :: known cage
++ dy-vase |=(num=@ud q:(dy-cage num)) :: known vase
++ dy-sore
|= src/(list dojo-source)
|= src=(list dojo-source)
^- vase
?~ src
!>(~)
@ -742,7 +742,7 @@
?. (~(nest ut [%cell [%atom %$ ~] %noun]) | p.q.cay)
:: naked generator; takes one argument
::
?. &(?=({* ~} p.cig) ?=(~ q.cig))
?. &(?=([* ~] p.cig) ?=(~ q.cig))
~|(%one-argument !!)
=/ res (mule |.((slam q.cay (dy-vase p.i.p.cig))))
?: ?=(%| -.res)
@ -810,7 +810,7 @@
(slam gat sam)
::
++ dy-made-dial :: dialog product
|= cag/cage
|= cag=cage
^+ +>+>
?. ?=(^ q.q.cag)
(dy-errd ~ q.q.cag)
@ -832,11 +832,11 @@
==
::
++ dy-made-gent :: generator product
|= cag/cage
|= cag=cage
(dy-meal q.cag)
::
++ dy-made-noun :: generator product
|= cag/cage
|= cag=cage
(dy-hand %noun q.cag)
::
++ dy-wool-poke
@ -869,7 +869,7 @@
::
%as
=/ cag=cage (dy-cage p.q.bil)
=+ .^(=tube:clay cc+(en-beam:format he-beak /[p.bil]/[p.cag]))
=+ .^(=tube:clay cc+(en-beam:format he-beak /[p.cag]/[p.bil]))
(dy-hand p.bil (tube q.cag))
::
%do
@ -896,14 +896,14 @@
::
++ dy-hoon-var
=+ ^= ope
|= gen/hoon ^- hoon
?: ?=(?($sgld $sgbn) -.gen)
|= gen=hoon ^- hoon
?: ?=(?(%sggl %sggr) -.gen)
$(gen q.gen)
=+ ~(open ap gen)
?.(=(gen -) $(gen -) gen)
|= gen/hoon ^- (unit cage)
|= gen=hoon ^- (unit cage)
=. gen (ope gen)
?: ?=({$cnts {@ ~} ~} gen)
?: ?=([%cnts [@ ~] ~] gen)
(~(get by var) i.p.gen)
~
:: +dy-mere: execute hoon and complete construction step
@ -933,7 +933,7 @@
(slap sut hoon)
::
++ dy-step :: advance project
|= nex/@ud
|= nex=@ud
^+ +>+>
?> ?=(~ cud)
?: =(nex num)
@ -944,19 +944,19 @@
--
::
++ he-dope
|= txt/tape ::
|= txt=tape ::
^- (each (unit (each dojo-command tape)) hair) :: prefix+result
=+ len=+((lent txt)) :: line length
=. txt (weld buf `tape`(weld txt "\0a")) ::
=+ vex=((full parse-command-line:he-parser) [1 1] txt)
?: =(q.p.vex len) :: matched to line end
[%& ~] ::
?: =(p.p.vex +((lent (skim txt |=(a/@ =(10 a)))))) :: parsed all lines
?: =(p.p.vex +((lent (skim txt |=(a=@ =(10 a)))))) :: parsed all lines
[%& ~ ?~(q.vex [%| txt] [%& p.u.q.vex])] :: new buffer+complete
[%| p.p.vex (dec q.p.vex)] :: syntax error
::
++ he-duke :: ++he-dope variant
|= txt/tape
|= txt=tape
^- (each (unit (each dojo-command tape)) @ud)
=+ foy=(he-dope txt)
?- -.foy
@ -975,7 +975,7 @@
%_(+> moz [card moz])
::
++ he-diff :: emit update
|= fec/sole-effect
|= fec=sole-effect
^+ +>
(he-card %give %fact ~[/sole/[id]] %sole-effect !>(fec))
::
@ -984,7 +984,7 @@
?~(poy . ~(dy-stop dy u.poy))
::
++ he-peer :: subscribe to
|= pax/path
|= pax=path
?>(=(~ pax) he-prom)
::
++ he-pine :: restore prompt
@ -993,7 +993,7 @@
he-prom:he-pone
::
++ he-errd :: reject update
|= {rev/(unit sole-edit) err/@u} ^+ +>
|= [rev=(unit sole-edit) err=@u] ^+ +>
=+ red=(fall rev [%nop ~]) :: required for error location sync
=^ lic say (~(transmit sole say) red)
(he-diff %mor [%det lic] [%err err] ~)
@ -1014,7 +1014,7 @@
"/" ?:(=(%home q.dir) "=" (trip q.dir))
"/" ?:(=([%ud 0] r.dir) "=" (scow r.dir))
==
?:(=(~ s.dir) "" (spud (flop s.dir)))
?:(=(~ s.dir) "" (spud s.dir))
::
++ he-prom :: send prompt
%- he-diff
@ -1034,9 +1034,9 @@
==
::
++ he-unto :: result from agent
|= {way/wire cit/sign:agent:gall}
|= [way=wire cit=sign:agent:gall]
^+ +>
?. ?=($poke-ack -.cit)
?. ?=(%poke-ack -.cit)
~& [%strange-unto cit]
+>
?~ p.cit
@ -1087,16 +1087,16 @@
%. [%httr !>((to-httr:iris response-header.response full-file.response))]
=+ dye=~(. dy u.poy(pux ~))
?+ way !!
{$hand ~} dy-hand:dye
{$show ~} dy-show:dye
[%hand ~] dy-hand:dye
[%show ~] dy-show:dye
==
::
++ he-lens
|= com/command:lens
|= com=command:lens
^+ +>
=/ source=dojo-source
=| num/@
=- ?. ?=($send-api -.sink.com) :: XX num is incorrect
=| num=@
=- ?. ?=(%send-api -.sink.com) :: XX num is incorrect
sor
:- 0
:+ %as `mark`(cat 3 api.sink.com '-poke')
@ -1112,12 +1112,12 @@
|- ^- dojo-source
:- num
?- -.source.com
$data [%ex %sand %t data.source.com]
$dojo
%data [%ex %sand %t data.source.com]
%dojo
%+ rash command.source.com
(ifix [(punt gap) (punt gap)] parse-build:he-parser)
::
$clay
%clay
:- %ex
^- hoon
:+ %dtkt
@ -1127,9 +1127,9 @@
%+ rash pax.source.com
rood:(vang | /(scot %p our.hid)/home/(scot %da now.hid))
::
$url [%ur (crip (en-purl:html url.source.com))]
$api !!
$get-api
%url [%ur (crip (en-purl:html url.source.com))]
%api !!
%get-api
:- %ex
^- hoon
:+ %dtkt
@ -1139,27 +1139,27 @@
[%sand %ta (scot %p our.hid)]
[%sand %tas api.source.com]
[%sand %ta (scot %da now.hid)]
(turn endpoint.source.com |=(a/@t [%sand %ta a]))
(turn endpoint.source.com |=(a=@t [%sand %ta a]))
==
::
$listen-api !!
$export !!
$import !!
$export-all !!
$import-all !!
$as
%listen-api !!
%export !!
%import !!
%export-all !!
%import-all !!
%as
:* %as mar.source.com
$(num +(num), source.com next.source.com)
==
::
$hoon
%hoon
:* %do
%+ rash code.source.com
tall:(vang | /(scot %p our.hid)/home/(scot %da now.hid))
$(num +(num), source.com next.source.com)
==
::
$tuple
%tuple
:- %tu
|- ^- (list dojo-source)
?~ next.source.com
@ -1168,31 +1168,31 @@
:- ^$(source.com i.next.source.com)
$(next.source.com t.next.source.com)
==
=+ |- ^- sink/dojo-sink
=+ |- ^- sink=dojo-sink
?- -.sink.com
$stdout [%show %0]
$output-file $(sink.com [%command (cat 3 '@' pax.sink.com)])
$output-pill $(sink.com [%command (cat 3 '.' pax.sink.com)])
$output-clay [%file (need (de-beam:format pax.sink.com))]
$url [%http %post (crip (en-purl:html url.sink.com))]
$to-api !!
$send-api [%poke our.hid api.sink.com]
$command (rash command.sink.com parse-sink:he-parser)
$app [%poke our.hid app.sink.com]
%stdout [%show %0]
%output-file $(sink.com [%command (cat 3 '@' pax.sink.com)])
%output-pill $(sink.com [%command (cat 3 '.' pax.sink.com)])
%output-clay [%file (need (de-beam:format pax.sink.com))]
%url [%http %post (crip (en-purl:html url.sink.com))]
%to-api !!
%send-api [%poke our.hid api.sink.com]
%command (rash command.sink.com parse-sink:he-parser)
%app [%poke our.hid app.sink.com]
==
(he-plan sink source)
::
++ he-like :: accept line
|= buf/(list @c)
|= buf=(list @c)
=(%& -:(he-dope (tufa buf)))
::
++ he-stir :: apply change
|= cal/sole-change
|= cal=sole-change
^+ +>
:: ~& [%his-clock ler.cal]
:: ~& [%our-clock ven.say]
=^ dat say (~(transceive sole say) cal)
?. ?& ?=($del -.dat)
?. ?& ?=(%del -.dat)
=(+(p.dat) (lent buf.say))
==
+>.$
@ -1203,13 +1203,13 @@
(he-errd `dat q.p.foy)
::
++ he-plan :: execute command
|= mad/dojo-command
|= mad=dojo-command
^+ +>
?> ?=(~ poy)
he-pine:(dy-step:~(dy-init dy %*(. *dojo-project mad mad)) 0)
::
++ he-done :: parse command
|= txt/tape
|= txt=tape
^+ +>
?~ txt
=< he-prom(buf ~)
@ -1431,19 +1431,19 @@
--
::
++ he-type :: apply input
|= act/sole-action
|= act=sole-action
^+ +>
?^ poy
he-pine:(~(dy-type dy u.poy) act)
?- -.dat.act
$det (he-stir +.dat.act)
$ret (he-done (tufa buf.say))
$clr he-pine(buf "")
$tab (he-tab +.dat.act)
%det (he-stir +.dat.act)
%ret (he-done (tufa buf.say))
%clr he-pine(buf "")
%tab (he-tab +.dat.act)
==
::
++ he-lame :: handle error
|= {wut/term why/tang}
|= [wut=term why=tang]
^+ +>
%- (slog (flop `tang`[>%dojo-lame wut< why]))
?^ poy
@ -1460,10 +1460,10 @@
::
^- cage
:- %noun
=+ sloop=|=({a/vase b/vase} ?:(=(*vase a) b ?:(=(*vase b) a (slop a b))))
=+ sloop=|=([a=vase b=vase] ?:(=(*vase a) b ?:(=(*vase b) a (slop a b))))
%+ sloop
%- ~(rep by var)
|= {{a/term @ b/vase} c/vase} ^- vase
|= [[a=term @ b=vase] c=vase] ^- vase
(sloop b(p face+[a p.b]) c)
!>([our=our now=now eny=eny]:hid)
--

View File

@ -67,7 +67,7 @@
|- ^+ [fex this]
?~ daz [fex this]
=/ dap-pax=path /app/[i.daz]/hoon
=/ dap-arch .^(arch cy+(en-beam now-beak (flop dap-pax)))
=/ dap-arch .^(arch cy+(en-beam now-beak dap-pax))
?~ fil.dap-arch
$(daz t.daz)
=/ sing=card

View File

@ -147,7 +147,7 @@
|= [wir=wire err=(unit tang)]
^- (quip card _state)
?~ err
=/ req/request:http (request-wttr location)
=/ req=request:http (request-wttr location)
=/ out *outbound-config:iris
:_ state(timer `(add now.bol ~h3))
:~ [%pass /[(scot %da now.bol)] %arvo %i %request req out]

View File

@ -1,6 +1,6 @@
:: :acme domain validation request handler
::
|= [[now=@da eny=@ bek=beak] $~ $~]
|= [[now=@da eny=@ bek=beak] ~ ~]
|= [authorized=? =request:http]
^- simple-payload:http
=/ url=(unit (pair pork:eyre quay:eyre))

View File

@ -8,8 +8,9 @@
::::
!:
:- %say
|= $: {now/@da * bec/beak}
{~ try/_| ~}
|= $: [now=@da eny=@uvJ bec=beak]
arg=$@(~ [top=path ~])
~
==
::
:: we're creating an event series E whose lifecycle can be computed
@ -153,7 +154,9 @@
::
:: sys: root path to boot system, `/~me/[desk]/now/sys`
::
=+ sys=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/sys
=/ sys=path
?^ arg top.arg
/(scot %p p.bec)/[q.bec]/(scot %da now)/sys
::
:: compiler-source: hoon source file producing compiler, `sys/hoon`
::
@ -186,6 +189,13 @@
==
:: a pill is a 3-tuple of event-lists: [boot kernel userspace]
::
=/ bas=path (flop (tail (flop sys)))
:+ boot-ova
(module-ova:pill sys)
[(file-ovum:pill (en-beam:format bec /)) ~]
:~ :~ //arvo
%what
[/sys/hoon hoon/compiler-source]
[/sys/arvo hoon/arvo-source]
==
(file-ovum2:pill bas)
==
[(file-ovum:pill bas) ~]

View File

@ -8,10 +8,10 @@
::::
::
:- %say
|= {^ {arg/(list path)} vane/?($g $c)}
|= [^ [arg=(list path)] vane=?(%g %c)]
=- tang+(flop `tang`(zing -))
%+ turn arg
|= pax/path
|= pax=path
^- tang
=+ ark=.^(arch (cat 3 vane %y) pax)
?^ fil.ark
@ -22,7 +22,7 @@
~
[rose+[" " `~]^~[leaf+"~" (smyt pax)]]~
::
{{@t ~} ~ ~}
[[@t ~] ~ ~]
$(pax (welp pax /[p.n.dir.ark]))
::
*

View File

@ -3,7 +3,7 @@
:::: /hoon/code/gen
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
|= $: [now=@da eny=@uvJ bec=beak]
~
~
==

View File

@ -2,7 +2,7 @@
::
:: outer gate is a standard generator
::
|= [[now=@da eny=@ bek=beak] $~ $~]
|= [[now=@da eny=@ bek=beak] ~ ~]
::
:: :- %build
|= [authorized=? request:http]

View File

@ -1,132 +0,0 @@
:: Produce a glass pill
::
:::: /hoon/glass/gen
::
/? 310
::
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
*
==
=< [%noun ~]
=> |%
++ wasp :: arvo effect
$% {$wack p/@uvJ} :: add entropy
{$what p/(list (pair path (pair term noun)))} :: reset reptile
{$whom p/@p} :: id and boot
==
--
::
:: deterministic test
::
=. eny 0v0
::
:: build arvo with existing compiler
::
|^ ^- *
::
:: neo: root path to boot system, `/~me/[desk]/now/neo`
::
=+ neo=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/neo
::
:: arvo-source: hoon source file producing arvo kernel, `neo/arvo`
::
=+ arvo-source=.^(@t %cx (welp neo /arvo/hoon))
::
:: arvo-twig: parsed arvo source
::
~& [%parsing `@p`(mug arvo-source)]
=+ arvo-twig=(ream arvo-source)
~& %parsed
::
:: arvo-kernel: a living urbit
::
~& [%compiling `@p`(mug arvo-twig)]
=+ arvo-kernel=+:(slap !>(..ream) arvo-twig)
~& %compiled
::
:: events: list of events to feed our urbit
::
~& %loading
=+ events=main-events
~& [%loaded `@p`(mug events)]
::
:: execute events
::
=+ number=0
|- ^- *
?~ events arvo-kernel
~& number+number
%= $
events t.events
number +(number)
arvo-kernel .*(arvo-kernel(+< i.events) -.arvo-kernel)
==
::
++ main-events
=. now ~2017.3.1
=+ mov=main-moves
|- ^- (list (pair @da ovum))
?~ mov ~
:- [now i.mov]
$(mov t.mov, now (add now (bex 48)))
::
++ main-moves
^- (list ovum)
:~ [[%$ ~] [%what boot-files]]
:: [[%$ ~] [%whom ~zod]]
==
++ boot-files
^- (list (pair path (pair term noun)))
::
:: userspace:
::
:: /app %gall applications
:: /gen :dojo generators
:: /lib %ford libraries
:: /mar %ford marks
:: /sur %ford structures
:: /ren %ford renderers
:: /web %eyre web content
:: /sys system files
:: /neo new system files
::
(user-files /neo ~)
::
++ user-files :: userspace loading
|= :: sal: all spurs to load from
::
sal/(list spur)
^- (list (pair path (pair term noun)))
::
:: hav: all user files
::
=| hav/(list (pair path (pair term noun)))
|- ^+ hav
?~ sal ~
=. hav $(sal t.sal)
::
:: tyl: spur
::
=/ tyl i.sal
|- ^+ hav
::
:: pax: full path at `tyl`
:: lon: directory at `tyl`
::
=/ pax (en-beam:format bec tyl)
=/ lon .^(arch %cy pax)
=? hav ?=(^ fil.lon)
::
:: install only hoon files for now
::
?. ?=({$hoon *} tyl) hav
:_(hav [(flop `path`t.tyl) [%hoon .^(@t %cx pax)]])
::
=/ all ~(tap by dir.lon)
|- ^+ hav
?~ all hav
$(all t.all, hav ^$(tyl [p.i.all tyl]))
--

View File

@ -8,6 +8,6 @@
::::
::
:- %say
|= {^ {{txt/@tas ~} ~}}
|= [^ [[txt=@tas ~] ~]]
:- %noun
(crip (weld "hello, " (trip txt)))

View File

@ -8,7 +8,7 @@
::
|%
++ path-heps
|= a/path ^- tape
|= a=path ^- tape
?~ a ""
|- ^- tape
%+ welp (trip i.a)
@ -16,13 +16,13 @@
['-' $(a t.a)]
::
++ rend
|= {a/@thoon b/path} ^- tank
=; c/(pair tape tape)
|= [a=@thoon b=path] ^- tank
=; c=(pair tape tape)
=/ tab (sub 10 (mod (lent "{p.c} ") 10))
[%palm [" {(reap tab ' ')}" ``~] leaf+p.c leaf+q.c ~]
:- ?- b
~ "/" :: XX !! maybe?
{$hood ^} "|{(path-heps t.b)}"
[%hood ^] "|{(path-heps t.b)}"
^ "+{(path-heps b)}" :: XX deal with :graph-store|foo
==
=/ c (to-wain:format a)
@ -32,17 +32,17 @@
(trip i.c)
::
++ read-at
|= {len/@u pax/path}
|= {nam/@t ark/arch} ^- (unit {@t path})
|= [len=@u pax=path]
|= [nam=@t ark=arch] ^- (unit [@t path])
?. (~(has by dir.ark) %hoon) ~
%+ bind (file:space:userlib (welp pax /[nam]/hoon))
|= a/* ^- {cord path}
|= a=* ^- [cord path]
[;;(@t a) (welp (slag len pax) /[nam])]
--
::
:- %say
|= {{now/time @ our/ship ^} typ/$@(~ {p/term ~}) ~}
=/ pax/path /(scot %p our)/home/(scot %da now)/gen :: XX hardcoded
|= [[now=time @ our=ship ^] typ=$@(~ [p=term ~]) ~]
=/ pax=path /(scot %p our)/home/(scot %da now)/gen :: XX hardcoded
=+ len=(lent pax)
=. pax ?~(typ pax (welp pax /[p.typ]))
:- %tang %- flop ^- tang
@ -53,12 +53,12 @@
(drop (bind red rend))
|- ^- tang
=+ =< arl=~(tap by (~(urn by dir.ark) .))
|=({a/@t ~} .^(arch cy+(welp pax /[a])))
|=([a=@t ~] .^(arch cy+(welp pax /[a])))
%+ welp
=/ dir/(list {@ path})
=/ dir=(list [@ path])
(murn arl (read-at len pax))
`tang`(turn (sort dir aor) rend)
%- zing ^- (list tang)
%+ turn (sort arl aor)
|= {a/@t b/arch}
|= [a=@t b=arch]
^$(pax (welp pax /[a]), ark b)

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{mon/term ~}
|= $: [now=@da eny=@uvJ bec=beak]
[mon=term ~]
~
==
:- %kiln-commit

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/(list term) ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=(list term) ~]
==
:+ %helm-reload-desk %base
arg

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{mon/term ~}
|= $: [now=@da eny=@uvJ bec=beak]
[mon=term ~]
auto=_|
==
:- %kiln-commit

View File

@ -5,7 +5,7 @@
/? 310
:- %say
=, space:userlib
|= {^ {input/path output/path ~} ~}
|= [^ [input=path output=path ~] ~]
:- %kiln-info
?. =(-:(flop input) -:(flop output))
["Can't move to a different mark" ~]

View File

@ -0,0 +1,4 @@
:- %say
|= [^ [dap=term wake=$@(~ [%wake ~])] ~]
=/ mode ?@(wake %idle %jolt)
[%helm-pass %g %fade dap mode]

View File

@ -9,8 +9,8 @@
::
=, sole
:- %say
|= $: {now/@da eny/@ bec/beak}
{~ ~}
|= $: [now=@da eny=@ bec=beak]
[~ ~]
==
~& %drum-exit
[%drum-exit ~]

View File

@ -0,0 +1,17 @@
:: Drum: destroy app
::
:::: /hoon/fade/hood/gen
::
/? 310
::
::::
::
:- %say
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[@ $@(~ [@ ~])] ~]
==
:- %drum-fade
?> ((sane %tas) -.arg)
?@ +.arg [q.bec -.arg]
?> ((sane %tas) +<.arg)
[-.arg +<.arg]

View File

@ -4,4 +4,4 @@
::
/? 310
:- %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)])

View File

@ -10,26 +10,26 @@
::
=, generators
:- %ask
|= $: {now/@da eny/@uvJ bec/beak}
{arg/$@(~ {dom/path ~})}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=$@(~ [dom=path ~])]
~
==
^- (sole-result:sole {$write-sec-atom p/host:eyre q/@})
^- (sole-result:sole [%write-sec-atom p=host:eyre q=@])
=- ?~ arg -
(fun.q.q [%& dom.arg])
%+ prompt
[%& %oauth-hostname "api hostname: https://"]
%+ parse thos:de-purl:html
|= hot/host:eyre
|= hot=host:eyre
?: ?=(%| -.hot)
~|(%ips-unsupported !!)
%+ prompt
[%& %oauth-client "client id: "]
%+ parse (boss 256 (star prn))
|= cid/@t
|= cid=@t
%+ prompt
[%& %oauth-secret "client secret: "]
%+ parse (boss 256 (star prn))
|= cis/@t
|= cis=@t
%+ produce %write-sec-atom :: XX typed pair
[hot (of-wain:format cid cis ~)]

View File

@ -12,11 +12,11 @@
=, html
=, format
:- %ask
|= $: {now/@da eny/@uvJ bec/beak}
{arg/$@(~ {jon/json ~})}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=$@(~ [jon=json ~])]
~
==
^- (sole-result:sole {$write-sec-atom p/host:eyre q/@})
^- (sole-result:sole [%write-sec-atom p=host:eyre q=@])
%+ print leaf+"Accepting credentials for https://*.googleapis.com"
=+ hot=[%& /com/googleapis]
=- ?~ arg -
@ -24,9 +24,9 @@
%+ prompt
[%& %oauth-json "json credentials: "]
%+ parse apex:de-json
|= jon/json
|= jon=json
=+ ~| bad-json+jon
=- `{cid/@t cis/@t}`(need (rep jon))
=- `[cid=@t cis=@t]`(need (rep jon))
rep=(ot web+(ot 'client_id'^so 'client_secret'^so ~) ~):dejs-soft:format
%+ produce %write-sec-atom :: XX typed pair
[hot (of-wain:format cid cis ~)]

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/{syd/desk lab/@tas ~} ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[syd=desk lab=@tas ~] ~]
==
:- %kiln-label
[syd lab]:arg

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ byk/beak}
{arg/$?({dap/term ~} {who/ship dap/term ~}) ~}
|= $: [now=@da eny=@uvJ byk=beak]
[arg=$?([dap=term ~] [who=ship dap=term ~]) ~]
==
:- %drum-link
?~ +.arg

View File

@ -7,7 +7,7 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/~ ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=~ ~]
==
[%helm-mass ~]

View File

@ -7,40 +7,40 @@
=, clay
::
|%
++ beaky {knot knot knot ~}
++ sorc ?({bek/beaky ~} {her/@p sud/@tas ~})
+$ beaky [knot knot knot ~]
+$ sorc ?([bek=beaky ~] [her=@p sud=@tas ~])
--
::
::::
::
:- %say
|= $: {now/@da eny/@uvJ bek/beak}
{arg/{?(~ sorc {syd/$@(desk beaky) sorc})} cas/case gem/?(germ $auto)}
|= $: [now=@da eny=@uvJ bek=beak]
[arg=[?(~ sorc [syd=$@(desk beaky) sorc])] cas=case gem=?(germ %auto)]
==
=* our p.bek
|^ :- %kiln-merge
^- $@(~ {syd/desk her/ship sud/desk cas/case gem/?(germ $auto)})
^- $@(~ [syd=desk her=ship sud=desk cas=case gem=?(germ %auto)])
?- arg
~ ((slog (turn help-text |=(=@t leaf+(trip t)))) ~)
{@ @ ~}
[@ @ ~]
=+(arg [sud ?.(=(our her) her (sein:title p.bek now her)) sud (opt-case da+now) gem])
::
{^ ~}
[^ ~]
=+ (pars bek.arg)
[dez ?.(=(our who) who (sein:title p.bek now who)) dez (opt-case caz) gem]
::
{* @ @ ~}
[* @ @ ~]
:- (pars-src syd.arg)
=+(arg [her sud (opt-case da+now) gem])
::
{* ^ ~}
[* ^ ~]
:- (pars-src syd.arg)
=+((pars bek.arg) [who dez (opt-case caz) gem])
==
++ opt-case |=(a/case ?:(=(*case cas) a cas)) :: override
++ pars |=(a/beaky `{{who/ship dez/desk caz/case} *}`(need (de-beam:format a)))
++ opt-case |=(a=case ?:(=(*case cas) a cas)) :: override
++ pars |=(a=beaky `[[who=ship dez=desk caz=case] *]`(need (de-beam:format a)))
++ pars-src
|= syd/$@(desk beaky)
|= syd=$@(desk beaky)
?@ syd syd
=+ (pars syd)
~| [%into-foreign who `path`syd]

View File

@ -16,9 +16,9 @@
^- (unit [=ship =udiff:point:able:jael])
=* our p.bec
=/ ran (clan:title our)
?: ?=({?($earl $pawn)} ran)
?: ?=([?(%earl %pawn)] ran)
%- %- slog :_ ~
leaf+"can't manage a moon from a {?:(?=($earl ran) "moon" "comet")}"
leaf+"can't manage a moon from a {?:(?=(%earl ran) "moon" "comet")}"
~
=/ seg=ship (sein:title our now mon)
?. =(our seg)

View File

@ -17,9 +17,9 @@
^- (unit [=ship =udiff:point:able:jael])
=* our p.bec
=/ ran (clan:title our)
?: ?=({?($earl $pawn)} ran)
?: ?=([?(%earl %pawn)] ran)
%- %- slog :_ ~
leaf+"can't manage a moon from a {?:(?=($earl ran) "moon" "comet")}"
leaf+"can't manage a moon from a {?:(?=(%earl ran) "moon" "comet")}"
~
=/ seg=ship (sein:title our now mon)
?. =(our seg)

View File

@ -16,9 +16,9 @@
^- (unit [=ship =udiff:point:able:jael])
=* our p.bec
=/ ran (clan:title our)
?: ?=({?($earl $pawn)} ran)
?: ?=([?(%earl %pawn)] ran)
%- %- slog :_ ~
leaf+"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
leaf+"can't create a moon from a {?:(?=(%earl ran) "moon" "comet")}"
~
=/ mon=ship
?^ arg

View File

@ -7,11 +7,11 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{{pax/path pot/$@(~ {v/@tas ~})} ~}
|= $: [now=@da eny=@uvJ bec=beak]
[[pax=path pot=$@(~ [v=@tas ~])] ~]
==
?~ pot
=+ bem=(need (de-beam:format pax))
$(pot ~[?^(s.bem i.s.bem q.bem)])
$(pot ~[?^(s.bem (rear s.bem) q.bem)])
:- %kiln-mount
[pax v.pot]

View File

@ -5,7 +5,7 @@
/? 310
=, space:userlib
:- %say
|= {^ {input/path output/path ~} ~}
|= [^ [input=path output=path ~] ~]
:- %kiln-info
?. =(-:(flop input) -:(flop output))
["Can't move to a different mark" ~]

View File

@ -7,7 +7,7 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/~ ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=~ ~]
==
[%helm-pack ~]

View File

@ -0,0 +1,3 @@
:- %say
|= [^ [=note-arvo ~] ~]
[%helm-pass note-arvo]

View File

@ -4,8 +4,8 @@
::
/? 310
:- %say
|= $: {now/@da eny/@ bec/beak}
{{exp/@ud ~} ~}
|= $: [now=@da eny=@ bec=beak]
[[exp=@ud ~] ~]
==
=+ rab=(~(raw og eny) (bex exp))
~& [%random-bytes (met 3 rab) `@p`(mug rab)]

View File

@ -3,8 +3,8 @@
:::: /gen/hood/private/hoon
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/{des/desk may/?($~ {pax/path $~})} $~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[des=desk may=?(~ [pax=path ~])] ~]
==
:- %kiln-permission
[des ?~(may / pax.may) |]:arg

View File

@ -3,8 +3,8 @@
:::: /gen/hood/public/hoon
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/{des/desk may/?($~ {pax/path $~})} $~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[des=desk may=?(~ [pax=path ~])] ~]
==
:- %kiln-permission
[des ?~(may / pax.may) &]:arg

View File

@ -7,7 +7,7 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/~ ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=~ ~]
==
[%helm-reload ~[%c]]

View File

@ -7,7 +7,7 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/~ ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=~ ~]
==
[%helm-reload ~[%z %a %b %c %d %e %g %i %j]]

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/{desk (list term)} ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[desk (list term)] ~]
==
:- %helm-reload-desk
arg

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/(list term) ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=(list term) ~]
==
:- %helm-reload
arg

View File

@ -7,7 +7,7 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/~ ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=~ ~]
==
[%helm-reset ~]

View File

@ -4,4 +4,4 @@
::
/? 310
:- %say
|=({^ {input/path ~} ~} kiln-rm+input)
|=([^ [input=path ~] ~] kiln-rm+input)

View File

@ -4,4 +4,4 @@
::
/? 310
:- %say
|=({^ {where/path tym/@da eve/@t ~} ~} kiln-schedule+[where tym eve])
|=([^ [where=path tym=@da eve=@t ~] ~] kiln-schedule+[where tym eve])

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/{@ $@(~ {@ ~})} ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[@ $@(~ [@ ~])] ~]
==
:- %drum-start
?> ((sane %tas) -.arg)

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/{syd/@tas her/@p sud/@tas ~} ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[syd=@tas her=@p sud=@tas ~] ~]
==
:- %kiln-sync
[syd her sud]:arg

View File

@ -7,5 +7,5 @@
::::
::
:- %say
|= {{now/@da eny/@uvJ bec/beak} ~ ~}
|= [[now=@da eny=@uvJ bec=beak] ~ ~]
[%kiln-syncs ~]

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/{syd/@tas her/@p sud/@tas ~} ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[syd=@tas her=@p sud=@tas ~] ~]
==
:- %kiln-track
[syd her sud]:arg

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ byk/beak}
{arg/$?({dap/term ~} {who/ship dap/term ~}) ~}
|= $: [now=@da eny=@uvJ byk=beak]
[arg=$?([dap=term ~] [who=ship dap=term ~]) ~]
==
:- %drum-unlink
?~ +.arg

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{{mon/$@(term {knot path}) ~} ~}
|= $: [now=@da eny=@uvJ bec=beak]
[[mon=$@(term [knot path]) ~] ~]
==
:- %kiln-unmount
mon

View File

@ -7,8 +7,8 @@
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/{syd/@tas her/@p sud/@tas ~} ~}
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[syd=@tas her=@p sud=@tas ~] ~]
==
:- %kiln-unsync
[syd her sud]:arg

View File

@ -9,8 +9,8 @@
::
=, sole
:- %say
|= $: {now/@da eny/@ bec/beak}
{~ ~}
|= $: [now=@da eny=@ bec=beak]
[~ ~]
==
~& %helm-verb
[%helm-verb ~]

View File

@ -7,11 +7,15 @@
::::
!:
:- %say
|= [[now=@da * bec=beak] *]
|= $: [now=@da eny=@uvJ bec=beak]
arg=$@(~ [top=path ~])
~
==
:- %noun
:: sys: root path to boot system, `/~me/[desk]/now/sys`
::
=/ sys=path
?^ arg top.arg
/(scot %p p.bec)/[q.bec]/(scot %da now)/sys
:: compiler-source: hoon source file producing compiler, `sys/hoon`
::
@ -33,8 +37,8 @@
:: Parsed with a static path for reproducibility.
::
=/ whole-hoon=hoon
:+ %tsbn compiler-hoon
:+ %tsld (rain /sys/arvo/hoon arvo-source)
:+ %tsgr compiler-hoon
:+ %tsgl (rain /sys/arvo/hoon arvo-source)
[%$ 7]
:: compile the whole schmeer
::
@ -48,8 +52,12 @@
:: we include a static path for reproducibility.
::
=/ zuse-ovo=ovum
:- /vane/zuse
[%veer %$ /sys/zuse/hoon .^(@ %cx (weld sys /zuse/hoon))]
:~ //arvo
%what
[/sys/hoon hoon/compiler-source]
[/sys/arvo hoon/arvo-source]
[/sys/zuse hoon/.^(@ %cx (weld sys /zuse/hoon))]
==
:: installed: Arvo gate (formal instance) with %zuse installed
::
:: The :zuse-ovo event occurs at a defaulted date for reproducibility.

View File

@ -12,7 +12,7 @@
%+ print leaf+"generating keys for {(scow %p who)}, life #{(scow %ud life)}"
%+ prompt [%| %pope-pass "passphrase: "]
%+ parse (boss 256 (star prn))
|= fra/@t
|= fra=@t
=/ bur (shaz (add who (shaz fra)))
=/ cub (pit:nu:crub:crypto 512 bur)
::

View File

@ -9,6 +9,6 @@
::
~& %
:- %say
|= {^ {arg/path ~} vane/?($g $c)}
|= [^ [arg=path ~] vane=?(%g %c)]
=+ lon=.^(arch (cat 3 vane %y) arg)
tang+[?~(dir.lon leaf+"~" (show-dir vane arg dir.lon))]~

View File

@ -1,319 +0,0 @@
:: Produce a metal pill
::
:::: /hoon/metal/gen
::
/? 310
::
::::
!:
:- %say
|= $: {now/@da * bec/beak}
{{who/@p ~} try/_| ~}
==
::
:: we're creating an event series E whose lifecycle can be computed
:: with the urbit lifecycle formula L, `[2 [0 3] [0 2]]`. that is:
:: if E is the list of events processed by a computer in its life,
:: its final state is S, where S is nock(E L).
::
:: in practice, the first five nouns in E are: two boot formulas,
:: a hoon compiler as a nock formula, the same compiler as source,
:: and the arvo kernel as source.
::
:: after the first five special events, we enter an iterative
:: sequence of regular events which continues for the rest of the
:: computer's life. during this sequence, each state is a function
:: that, passed the next event, produces the next state.
::
:: each event is a `[date wire type data]` tuple, where `date` is a
:: 128-bit Urbit date; `wire` is an opaque path which output can
:: match to track causality; `type` is a symbol describing the type
:: of input; and `data` is input data specific to `type`.
::
:: in real life we don't actually run the lifecycle loop,
:: since real life is updated incrementally and also cares
:: about things like output. we couple to the internal
:: structure of the state machine and work directly with
:: the underlying arvo engine.
::
:: this arvo core, which is at `+7` (Lisp `cddr`) of the state
:: function (see its public interface in `sys/arvo`), gives us
:: extra features, like output, which are relevant to running
:: a real-life urbit vm, but don't affect the formal definition.
::
:: so a real-life urbit interpreter is coupled to the shape of
:: the arvo core. it becomes very hard to change this shape.
:: fortunately, it is not a very complex interface.
::
:- %noun
::
:: boot-one: lifecycle formula
::
=+ ^= boot-one
::
:: event 1 is the lifecycle formula which computes the final
:: state from the full event sequence.
::
:: the formal urbit state is always just a gate (function)
:: which, passed the next event, produces the next state.
::
=> [boot-formula=* full-sequence=*]
!= ::
:: first we use the boot formula (event 1) to set up
:: the pair of state function and main sequence. the boot
:: formula peels off the first n (currently 3) events
:: to set up the lifecycle loop.
::
=+ [state-gate main-sequence]=.*(full-sequence boot-formula)
::
:: in this lifecycle loop, we replace the state function
:: with its product, called on the next event, until
:: we run out of events.
::
|- ?@ main-sequence
state-gate
%= $
main-sequence +.main-sequence
state-gate .*(state-gate [%9 2 %10 [6 %1 -.main-sequence] %0 1])
==
::
:: boot-two: startup formula
::
=+ ^= boot-two
::
:: event 2 is the startup formula, which verifies the compiler
:: and starts the main lifecycle.
::
=> :* :: event 3: a formula producing the hoon compiler
::
compiler-formula=**
::
:: event 4: hoon compiler source, compiling to event 2
::
compiler-source=*@t
::
:: event 5: arvo kernel source
::
arvo-source=*@t
::
:: events 6..n: main sequence with normal semantics
::
main-sequence=**
==
!= :_ main-sequence
::
:: activate the compiler gate. the product of this formula
:: is smaller than the formula. so you might think we should
:: save the gate itself rather than the formula producing it.
:: but we have to run the formula at runtime, to register jets.
::
:: as always, we have to use raw nock as we have no type.
:: the gate is in fact ++ride.
::
~> %slog.[0 leaf+"1-b"]
=+ ^= compiler-gate
.*(0 compiler-formula)
::
:: compile the compiler source, producing (pair span nock).
:: the compiler ignores its input so we use a trivial span.
::
~> %slog.[0 leaf+"1-c"]
=+ ^= compiler-tool
.*(compiler-gate [%9 2 %10 [6 %1 [%noun compiler-source]] %0 1])
::
:: switch to the second-generation compiler. we want to be
:: able to generate matching reflection nouns even if the
:: language changes -- the first-generation formula will
:: generate last-generation spans for `!>`, etc.
::
~> %slog.[0 leaf+"1-d"]
=. compiler-gate .*(0 +:compiler-tool)
::
:: get the span (type) of the kernel core, which is the context
:: of the compiler gate. we just compiled the compiler,
:: so we know the span (type) of the compiler gate. its
:: context is at tree address `+>` (ie, `+7` or Lisp `cddr`).
:: we use the compiler again to infer this trivial program.
::
~> %slog.[0 leaf+"1-e"]
=+ ^= kernel-span
-:.*(compiler-gate [%9 2 %10 [6 %1 [-.compiler-tool '+>']] %0 1])
::
:: compile the arvo source against the kernel core.
::
~> %slog.[0 leaf+"1-f"]
=+ ^= kernel-tool
.*(compiler-gate [%9 2 %10 [6 %1 [kernel-span arvo-source]] %0 1])
::
:: create the arvo kernel, whose subject is the kernel core.
::
~> %slog.[0 leaf+"1-g"]
.*(+>:compiler-gate +:kernel-tool)
::
:: sys: root path to boot system, `/~me/[desk]/now/sys`
::
=+ sys=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/sys
::
:: compiler-source: hoon source file producing compiler, `sys/hoon`
::
=+ compiler-source=.^(@t %cx (welp sys /hoon/hoon))
::
:: compiler-twig: compiler as hoon expression
::
~& %metal-parsing
=+ compiler-twig=(ream compiler-source)
~& %metal-parsed
::
:: compiler-formula: compiler as nock formula
::
~& %metal-compiling
=+ compiler-formula=q:(~(mint ut %noun) %noun compiler-twig)
~& %metal-compiled
::
:: arvo-source: hoon source file producing arvo kernel, `sys/arvo`
::
=+ arvo-source=.^(@t %cx (welp sys /arvo/hoon))
::
:: main-moves: installation actions
::
=+ ^= main-moves
|^ ^- (list ovum)
:~ ::
:: configure identity
::
[[%name (scot %p who) ~] [%veal who]]
::
:: sys/zuse: standard library
::
(vent %$ /zuse)
::
:: sys/vane/ames: network
::
(vent %a /vane/ames)
::
:: sys/vane/behn: timer
::
(vent %b /vane/behn)
::
:: sys/vane/clay: revision control
::
(vent %c /vane/clay)
::
:: sys/vane/dill: console
::
(vent %d /vane/dill)
::
:: sys/vane/eyre: web
::
(vent %e /vane/eyre)
::
:: sys/vane/gall: applications
::
(vent %g /vane/gall)
::
:: sys/vane/jael: security
::
(vent %j /vane/jael)
::
:: legacy boot event
::
[[%$ %term '1' ~] [%boot %sith who `@uw`who &]]
::
:: userspace:
::
:: /app %gall applications
:: /gen :dojo generators
:: /lib %ford libraries
:: /mar %ford marks
:: /sur %ford structures
:: /ren %ford renderers
:: /web %eyre web content
:: /sys system files
::
(user /app /gen /lib /mar /ren /sec /sur /sys /web ~)
==
:: ::
++ user :: userspace loading
|= :: sal: all spurs to load from
::
sal/(list spur)
^- ovum
::
:: hav: all user files
::
=; hav ~& user-files+(lent hav)
[[%$ %sync ~] [%into %$ & hav]]
=| hav/mode:clay
|- ^+ hav
?~ sal ~
=. hav $(sal t.sal)
::
:: tyl: spur
::
=/ tyl i.sal
|- ^+ hav
::
:: pax: full path at `tyl`
:: lon: directory at `tyl`
::
=/ pax (en-beam:format bec tyl)
=/ lon .^(arch %cy pax)
=? hav ?=(^ fil.lon)
?. ?=({$hoon *} tyl)
::
:: install only hoon files for now
::
hav
::
:: cot: file as plain-text octet-stream
::
=; cot [[(flop `path`tyl) `[/text/plain cot]] hav]
^- octs
?- tyl
{$hoon *}
=/ dat .^(@t %cx pax)
[(met 3 dat) dat]
==
=/ all ~(tap by dir.lon)
|- ^- mode:clay
?~ all hav
$(all t.all, hav ^$(tyl [p.i.all tyl]))
::
++ vent
|= {abr/term den/path}
=+ pax=(weld sys den)
=+ txt=.^(@ %cx (welp pax /hoon))
`ovum`[[%vane den] [%veer abr pax txt]]
--
::
:: main-events: full events with advancing times
::
=. now ~2017.3.1
=+ ^= main-events
|- ^- (list (pair @da ovum))
?~ main-moves ~
:- [now i.main-moves]
$(main-moves t.main-moves, now (add now (bex 48)))
::
~? try
~& %metal-testing
=+ ^= yop
^- @p
%- mug
.* :* boot-one
boot-two
compiler-formula
compiler-source
arvo-source
main-events
==
[2 [0 3] [0 2]]
[%metal-tested yop]
::
:* boot-one
boot-two
compiler-formula
compiler-source
arvo-source
main-events
==

View File

@ -35,7 +35,7 @@
:: compile arvo against hoon, with our current compiler
::
=/ whole-hoon=hoon
[%tsbn compiler-hoon [%tsbn [%$ 7] (rain arvo-path arvo-src)]]
[%tsgr compiler-hoon [%tsgr [%$ 7] (rain arvo-path arvo-src)]]
~& %solid-parsed
=/ whole-formula q:(~(mint ut %noun) %noun whole-hoon)
~& %solid-arvo
@ -64,7 +64,14 @@
=/ installed
=< q
%^ spin
(module-ova:pill sys)
^- (list ovum)
:~ :~ //arvo
%what
[/sys/hoon hoon/compiler-src]
[/sys/arvo hoon/arvo-src]
==
(file-ovum2:pill (flop (tail (flop sys))))
==
.*(0 arvo-formula)
|= [ovo=ovum ken=*]
[~ (slum ken [now ovo])]

View File

@ -5,5 +5,5 @@
[%tang >timers< ~]
.^ (list [date=@da =duct])
%bx
(en-beam:format [p.bec %$ r.bec] /timers/debug)
(en-beam:format [p.bec %$ r.bec] /debug/timers)
==

View File

@ -16,9 +16,9 @@
:: dep: depth in chain
:: ind: index at depth
:: pif: parent fingerprint (4 bytes)
|_ [prv=@ pub=pont cad=@ dep=@ud ind=@ud pif=@]
|_ [prv=@ pub=point.ecc cad=@ dep=@ud ind=@ud pif=@]
::
+= keyc [key=@ cai=@] :: prv/pub key + chain code
+$ keyc [key=@ cai=@] :: prv/pub key + chain code
::
:: elliptic curve operations and values
::
@ -26,7 +26,7 @@
::
++ ser-p compress-point.ecc
::
++ n ^n:ecc
++ n n:t.ecc
::
:: core initialization
::
@ -46,7 +46,7 @@
+>(pub (decompress-point.ecc key), cad cai)
::
++ from-public-point
|= [pon=pont cai=@]
|= [pon=point.ecc cai=@]
+>(pub pon, cad cai)
::
++ from-extended
@ -67,9 +67,9 @@
?> =(0 x) :: sanity check
%. [d i p]
=< set-metadata
=+ v=(scag 4 t)
?: =("xprv" v) (from-private k c)
?: =("xpub" v) (from-public k c)
=+ v=(swag [1 3] t)
?: =("prv" v) (from-private k c)
?: =("pub" v) (from-public k c)
!!
::
++ set-metadata
@ -150,7 +150,7 @@
:: rare exception, invalid key, go to the next one
?: (gte left n) $(i +(i)) ::TODO or child key is "point at infinity"
%_ +>.$
pub (jc-add.ecc (point left) pub)
pub (add-points.ecc (point left) pub)
cad right
dep +(dep)
ind i
@ -168,12 +168,24 @@
++ identity (hash160 public-key)
++ fingerprint (cut 3 [16 4] identity)
::
++ address
|= network=?(%main %regtest %testnet)
^- @uc
:: removes checksum
::
%^ rsh 3 4
%+ en-base58check
[4 (version-bytes network %pub %.n)]
[20 identity]
::
++ prv-extended
%+ en-b58c-bip32 0x488.ade4
|= network=?(%main %regtest %testnet)
%+ en-b58c-bip32 (version-bytes network %prv %.y)
(build-extended private-key)
::
++ pub-extended
%+ en-b58c-bip32 0x488.b21e
|= network=?(%main %regtest %testnet)
%+ en-b58c-bip32 (version-bytes network %pub %.y)
(build-extended public-key)
::
++ build-extended
@ -188,6 +200,7 @@
::
++ en-b58c-bip32
|= [v=@ k=@]
%- en-base58:mimes:html
(en-base58check [4 v] [74 k])
::
:: base58check
@ -196,7 +209,6 @@
:: v: version bytes
:: d: data
|= [v=byts d=byts]
%- en-base58:mimes:html
=+ p=[(add wid.v wid.d) (can 3 ~[d v])]
=- (can 3 ~[4^- p])
%^ rsh 3 28
@ -213,4 +225,19 @@
++ hash160
|= d=@
(ripemd-160:ripemd:crypto 32 (sha-256:sha d))
::
++ version-bytes
|= [network=?(%main %regtest %testnet) type=?(%pub %prv) bip32=?]
^- @ux
|^
?- type
%pub ?:(bip32 xpub-key pay-to-pubkey)
%prv ?:(bip32 xprv-key private-key)
==
::
++ pay-to-pubkey ?:(=(network %main) 0x0 0x6f)
++ private-key ?:(=(network %main) 0x80 0xef)
++ xpub-key ?:(=(network %main) 0x488.b21e 0x435.87cf)
++ xprv-key ?:(=(network %main) 0x488.ade4 0x435.8394)
--
--

View File

@ -168,8 +168,8 @@
(cu (cury slav %uv) so)
::
++ re :: recursive reparsers
|* {gar/* sef/_|.(fist:dejs-soft:format)}
|= jon/json
|* [gar=* sef=_|.(fist:dejs-soft:format)]
|= jon=json
^- (unit _gar)
=- ~! gar ~! (need -) -
((sef) jon)

View File

@ -2,8 +2,8 @@
/+ base64, group-store, resource
|%
++ nu :: parse number as hex
|= jon/json
?> ?=({$s *} jon)
|= jon=json
?> ?=([%s *] jon)
(rash p.jon hex)
::
++ hook-update-to-json

View File

@ -1,50 +1,50 @@
|%
++ static :: freeze .mdh hoon subset
|= gen/hoon ^- {inf/(map term dime) elm/manx}
|= gen=hoon ^- [inf=(map term dime) elm=manx]
?+ -.gen
=/ gen ~(open ap gen)
?: =(gen ^gen) ~|([%cram-dynamic -.gen] !!)
$(gen gen)
::
$xray [~ (single (shut gen))]
%xray [~ (single (shut gen))]
^ [(malt (frontmatter p.gen)) (single (shut q.gen))]
==
::
++ single :: unwrap one-elem marl
|= xml/marl ^- manx
?: ?=({* ~} xml) i.xml
|= xml=marl ^- manx
?: ?=([* ~] xml) i.xml
~|(%many-elems !!)
::
++ shut-mart :: xml attrs
|=({n/mane v/(list beer:hoot)} [n (turn v |=(a/beer:hoot ?^(a !! a)))])
|=([n=mane v=(list beer:hoot)] [n (turn v |=(a=beer:hoot ?^(a !! a)))])
::
++ shut :: as xml constant
|= gen/hoon ^- marl
|= gen=hoon ^- marl
?+ -.gen ~|([%bad-xml -.gen] !!)
$dbug $(gen q.gen)
%dbug $(gen q.gen)
::
$xray
%xray
[[n.g.p.gen (turn a.g.p.gen shut-mart)] $(gen [%mcts c.p.gen])]~
::
$mcts
%mcts
?~ p.gen ~
=- (weld - $(p.gen t.p.gen))
?^ -.i.p.gen $(gen [%xray i.p.gen])
~| [%shut-tuna -.i.p.gen]
?+ -.i.p.gen !!
$manx ?>(?=($xray -.p.i.p.gen) $(gen p.i.p.gen))
$marl ?>(?=($mcts -.p.i.p.gen) $(gen p.i.p.gen))
%manx ?>(?=(%xray -.p.i.p.gen) $(gen p.i.p.gen))
%marl ?>(?=(%mcts -.p.i.p.gen) $(gen p.i.p.gen))
==
==
::
::
++ frontmatter :: parse ~[[%foo 1] [%bar ~s2]]
|= gen/hoon ^- (list {term dime})
?: ?=({$bust $null} gen) ~
?: ?=($dbug -.gen) $(gen q.gen)
?. ?=($clsg -.gen) ~|([%bad-frontmatter -.gen] !!)
|= gen=hoon ^- (list [term dime])
?: ?=([%bust %null] gen) ~
?: ?=(%dbug -.gen) $(gen q.gen)
?. ?=(%clsg -.gen) ~|([%bad-frontmatter -.gen] !!)
%+ turn p.gen
|= gen/hoon
|= gen=hoon
?. ?=(^ -.gen)
=/ gen ~(open ap gen)
?: =(gen ^gen) ~|([%bad-frontmatter-elem -.gen] !!)
@ -54,8 +54,8 @@
[q.hed (as-dime q.gen)]
::
++ as-dime :: %foo ~.foo 0vbar etc
|= gen/hoon ^- dime
?: ?=($dbug -.gen) $(gen q.gen)
?. ?=({?($rock $sand) @ @} gen) ~|([%bad-literal gen] !!)
|= gen=hoon ^- dime
?: ?=(%dbug -.gen) $(gen q.gen)
?. ?=([?(%rock %sand) @ @] gen) ~|([%bad-literal gen] !!)
+.gen
--

View File

@ -175,7 +175,7 @@
:: advance until
::
++ till
|= tub/nail
|= tub=nail
^- (like (list @D))
?~ q.tub
(fail tub)

View File

@ -9,7 +9,7 @@
~+ ^- (map term cord)
%- molt ^- (list (pair term cord))
:- [%class 'className']
=- (rash - (more next (cook |=(a/tape [(crip (cass a)) (crip a)]) (star alf))))
=- (rash - (more next (cook |=(a=tape [(crip (cass a)) (crip a)]) (star alf))))
'''
accept acceptCharset accessKey action allowFullScreen allowTransparency alt
async autoComplete autoFocus autoPlay cellPadding cellSpacing charSet checked
@ -27,12 +27,12 @@
::
:: special handling for <pre urb:codemirror>foo</pre>
++ urb-codemirror :: render code blocks
|= src/manx ^- manx
?> ?=({{$pre *} _;/(**) ~} src)
|= src=manx ^- manx
?> ?=([[%pre *] _;/(**) ~] src)
;codemirror(value "{v.i.a.g.i.c.src}");
::
++ elem-to-react-json :: serialize DOM as json
|= src/manx ^- json
|= src=manx ^- json
?: ?=(_;/(**) src)
(tape:enjs v.i.a.g.src)
=+ atr=(molt `(list (pair mane tape))`a.g.src)
@ -42,14 +42,14 @@
c+a+(turn c.src ..$)
gn+s+(mane-to-cord n.g.src)
=< ga+(pairs:enjs (turn a.g.src .))
|= {a/mane b/tape} ^- {cord json}
|= [a=mane b=tape] ^- [cord json]
:_ (tape:enjs b)
?^ a (mane-to-cord a)
(~(gut by react-attrs) a a)
==
::
++ mane-to-cord :: namespaced xml names
|=(a/mane `cord`?@(a a (rap 3 -.a ':' +.a ~)))
|=(a=mane `cord`?@(a a (rap 3 -.a ':' +.a ~)))
--
::
::::

View File

@ -6,19 +6,19 @@
=, format
|%
++ 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)
@ -30,6 +30,6 @@
$(wan t.wan)
=- $(wan t.wan, atr (~(put by atr) (crip key) (crip val)))
~| malformed-attribute+i.t.wan
^- {key/tape ^ val/tape}
^- [key=tape ^ val=tape]
+>:(atr-key 1^1 (trip i.t.wan))
--

View File

@ -2,21 +2,21 @@
=, sole
|%
++ produce :: construct result
|* pro/* ::
|* pro=* ::
[p=*(list tank) q=[%& p=[~ u=pro]]] ::
:: ::
++ print :: add output tank
|* {tan/tank res/(sole-result)} ::
|* [tan=tank res=(sole-result)] ::
?@ res res ::
[p=[i=tan t=p.res] q=q.res] ::
:: ::
++ prompt :: construct prompt
|* {pom/sole-prompt mor/(sole-dialog)} ::
|* [pom=sole-prompt mor=(sole-dialog)] ::
[p=*(list tank) q=[%| p=pom q=mor]] ::
:: ::
++ curl :: fetch url
=| usr/knot ::
|* {pul/_purl:eyre fun/$-(httr:eyre *)} ::
=| usr=knot ::
|* [pul=_purl:eyre fun=$-(httr:eyre *)] ::
:- p=*(list tank) ::
q=[%| p=`usr q=[pul %get ~ ~] r=fun] ::
:: ::
@ -24,10 +24,10 @@
[p=*(list tank) q=[%& ~]] ::
:: ::
++ parse :: parse by rule
|* {sef/rule fun/$-(* *)} ::
|= txt/sole-input ::
|* [sef=rule fun=$-(* *)] ::
|= txt=sole-input ::
=+ vex=(sef [0 0] txt) ::
?: |(!=((lent txt) q.p.vex) ?=($~ q.vex)) ::
?: |(!=((lent txt) q.p.vex) ?=(~ q.vex)) ::
q.p.vex ::
(fun p.u.q.vex) ::
--

View File

@ -7,13 +7,13 @@
|%
:: NOTE: move these functions to zuse
++ nu :: parse number as hex
|= jon/json
?> ?=({$s *} jon)
|= jon=json
?> ?=([%s *] jon)
(rash p.jon hex)
::
++ re :: recursive reparsers
|* {gar/* sef/_|.(fist:dejs-soft:format)}
|= jon/json
|* [gar=* sef=_|.(fist:dejs-soft:format)]
|= jon=json
^- (unit _gar)
=- ~! gar ~! (need -) -
((sef) jon)
@ -319,7 +319,7 @@
++ post
%- ot
:~ [%author (su ;~(pfix sig fed:ag))]
[%index index]
[%index index]
[%time-sent di]
[%contents (ar content)]
[%hash (mu nu)]
@ -375,7 +375,7 @@
++ uid
%- ot
:~ [%resource dejs:res]
[%index index]
[%index index]
==
::
++ index (su ;~(pfix fas (more fas dem)))

View File

@ -1,18 +0,0 @@
/- *group-store
|%
++ groups-to-json
|= grp=groups
^- json
=, enjs:format
%- pairs
%+ turn ~(tap by grp)
|= [pax=^path =group]
^- [@t json]
:- (spat pax)
(set-to-array group ship:enjs:format)
::
++ set-to-array
|* {a/(set) b/$-(* json)}
^- json
[%a (turn ~(tap in a) b)]
--

View File

@ -295,7 +295,7 @@
|= [a=(map @t json) b=$-(@t @t)]
^+ a
=- (malt -)
|-
|-
^- (list [@t json])
?~ a ~
:- [(b p.n.a) q.n.a]
@ -304,13 +304,13 @@
$(a r.a)
::
++ of
|* wer/(pole {cord fist})
|= jon/json
?> ?=({$o {@ *} $~ $~} jon)
|* wer=(pole [cord fist])
|= jon=json
?> ?=([%o [@ *] ~ ~] jon)
|-
?- wer
:: {{key/@t wit/*} t/*}
{{key/@t *} t/*}
?- wer
:: [[key=@t wit=*] t=*]
[[key=@t *] t=*]
=> .(wer [[* wit] *]=wer)
?: =(key.wer (enkebab p.n.p.jon))
[key.wer ~|(val+q.n.p.jon (wit.wer q.n.p.jon))]

View File

@ -10,7 +10,7 @@
::
++ index
^- $-(json index:graph-store)
(su ;~(pfix net (more net dem)))
(su ;~(pfix fas (more fas dem)))
::
++ graph-index
%- ot

View File

@ -5,49 +5,49 @@
+$ state [%2 pith-2]
::
++ pith-2 ::
$: eel/(set gill:gall) :: connect to
ray/(set well:gall) ::
fur/(map dude:gall (unit server)) :: servers
bin/(map bone source) :: terminals
$: eel=(set gill:gall) :: connect to
ray=(set well:gall) ::
fur=(map dude:gall (unit server)) :: servers
bin=(map bone source) :: terminals
== ::
:: ::
++ server :: running server
$: syd/desk :: app identity
cas/case :: boot case
$: syd=desk :: app identity
cas=case :: boot case
== ::
++ kill :: kill ring
$: pos/@ud :: ring position
num/@ud :: number of entries
max/_60 :: max entries
old/(list (list @c)) :: entries proper
$: pos=@ud :: ring position
num=@ud :: number of entries
max=_60 :: max entries
old=(list (list @c)) :: entries proper
== ::
++ source :: input device
$: edg/_80 :: terminal columns
off/@ud :: window offset
kil/kill :: kill buffer
inx/@ud :: ring index
fug/(map gill:gall (unit target)) :: connections
mir/(pair @ud stub) :: mirrored terminal
$: edg=_80 :: terminal columns
off=@ud :: window offset
kil=kill :: kill buffer
inx=@ud :: ring index
fug=(map gill:gall (unit target)) :: connections
mir=(pair @ud stub) :: mirrored terminal
== ::
++ 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
$: $= blt :: curr & prev belts
%+ pair
(unit dill-belt:dill)
(unit dill-belt:dill)
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
== ::
--
:: :: ::
@ -144,14 +144,14 @@
+$ any-state ^any-state :: proxy
++ on-init se-abet:this(eel (deft-fish our.hid))
++ diff-sole-effect-phat :: app event
|= {way/wire fec/sole-effect}
|= [way=wire fec=sole-effect]
=< se-abet =< se-view
=+ gyl=(de-gill way)
?: (se-aint gyl) +>.$
(se-diff gyl fec)
::
++ peer ::
|= pax/path
|= pax=path
~| [%drum-unauthorized our+our.hid src+src.hid] :: ourself
?> (team:title our.hid src.hid) :: or our own moon
=< se-abet =< se-view
@ -169,26 +169,31 @@
[~ sat]
::
++ poke-dill-belt :: terminal event
|= bet/dill-belt:dill
|= bet=dill-belt:dill
=< se-abet =< se-view
(se-belt bet)
::
++ poke-dill-blit :: terminal output
|= bit/dill-blit:dill
|= bit=dill-blit:dill
se-abet:(se-blit-sys bit)
::
++ poke-start :: start app
|= wel/well:gall
|= wel=well:gall
=< se-abet =< se-view
(se-born & wel)
::
++ poke-fade :: fade app
|= wel=well:gall
=< se-abet =< se-view
(se-fade wel)
::
++ poke-link :: connect app
|= gyl/gill:gall
|= gyl=gill:gall
=< se-abet =< se-view
(se-link gyl)
::
++ poke-unlink :: disconnect app
|= gyl/gill:gall
|= gyl=gill:gall
=< se-abet =< se-view
(se-drop:(se-pull gyl) & gyl)
::
@ -197,7 +202,7 @@
se-abet:(se-blit-sys `dill-blit:dill`[%qit ~])
::
++ poke-put :: write file
|= {pax/path txt/@}
|= [pax=path txt=@]
se-abet:(se-blit-sys [%sav pax txt]) ::
::
++ poke
@ -210,6 +215,7 @@
%drum-put =;(f (f !<(_+<.f vase)) poke-put)
%drum-set-boot-apps =;(f (f !<(_+<.f vase)) poke-set-boot-apps)
%drum-start =;(f (f !<(_+<.f vase)) poke-start)
%drum-fade =;(f (f !<(_+<.f vase)) poke-fade)
%drum-unlink =;(f (f !<(_+<.f vase)) poke-unlink)
==
::
@ -256,7 +262,7 @@
..on-load
::
++ reap-phat :: ack connect
|= {way/wire saw/(unit tang)}
|= [way=wire saw=(unit tang)]
=< se-abet =< se-view
=+ gyl=(de-gill way)
?~ saw
@ -273,7 +279,7 @@
+>.sign-arvo
::
++ take-coup-phat :: ack poke
|= {way/wire saw/(unit tang)}
|= [way=wire saw=(unit tang)]
=< se-abet =< se-view
?~ saw +>
=+ gyl=(de-gill way)
@ -283,14 +289,14 @@
>[%drum-coup-fail src.hid gyl]<
::
++ take-onto :: ack start
|= {way/wire saw/(each suss:gall tang)}
|= [way=wire saw=(each suss:gall tang)]
=< se-abet =< se-view
?> ?=({@ @ ~} way)
?> ?=([@ @ ~] way)
?> (~(has by fur) i.t.way)
=/ wel/well:gall [i.way i.t.way]
=/ wel=well:gall [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]))
==
@ -311,7 +317,7 @@
==
::
++ quit-phat ::
|= way/wire
|= way=wire
=< se-abet =< se-view
=+ gyl=(de-gill way)
~& [%drum-quit src.hid gyl]
@ -321,7 +327,7 @@
:: :: ::
++ se-abet :: resolve
^- (quip card:agent:gall state)
=. . se-subze:se-adze:se-adit
=. . se-subze:se-adze:se-subit:se-adit
:_ sat(bin (~(put by bin) ost dev))
^- (list card:agent:gall)
?~ biz (flop moz)
@ -386,6 +392,17 @@
$(priorities t.priorities)
--
::
++ se-subit :: downdate servers
=/ ruf=(list term) ~(tap in ~(key by fur))
|- ^+ this
?~ ruf
this
?: (~(has in ray) [%home i.ruf])
$(ruf t.ruf)
=/ wire [%drum %fade i.ruf ~]
=. this (se-emit %pass wire %arvo %g %fade i.ruf %slay)
$(ruf t.ruf, fur (~(del by fur) i.ruf))
::
++ se-adze :: update connections
^+ .
%+ roll
@ -396,7 +413,7 @@
?: =(b %dojo) %.y
(aor a b)
=< .(con +>)
|: $:{gil/gill:gall con/_.} ^+ con
|: $:,[gil=gill:gall con=_.] ^+ con
=. +>.$ con
?: (~(has by fug) gil)
+>.$
@ -408,7 +425,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))
::
@ -416,21 +433,21 @@
^+ .
%- ~(rep by fug)
=< .(con +>)
|: $:{{gil/gill:gall *} con/_.} ^+ con
|: $:,[[gil=gill:gall *] con=_.] ^+ con
=. +>.$ con
?: (~(has in eel) gil)
+>.$
(se-nuke gil)
::
++ se-aint :: ignore result
|= gyl/gill:gall
|= gyl=gill:gall
^- ?
?. (~(has by bin) ost) &
=+ gyr=(~(get by fug) gyl)
|(?=(~ gyr) ?=(~ u.gyr))
::
++ se-alas :: recalculate index
|= gyl/gill:gall
|= gyl=gill:gall
=+ [xin=0 wag=se-amor]
|- ^+ +>.^$
?~ wag +>.^$(inx 0)
@ -440,7 +457,7 @@
++ se-amor :: live targets
^- (list gill:gall)
%+ skim ~(tap in eel)
|=(a/gill:gall ?=({~ ~ *} (~(get by fug) a)))
|=(a=gill:gall ?=([~ ~ *] (~(get by fug) a)))
::
++ se-anon :: rotate index
=+ wag=se-amor
@ -456,14 +473,14 @@
`(snag inx `(list gill:gall)`wag)
::
++ se-belt :: handle input
|= bet/dill-belt:dill
|= bet=dill-belt:dill
^+ +>
?: ?=({?($cru $hey $rez $yow) *} bet) :: target-agnostic
?: ?=([?(%cru %hey %rez %yow) *] bet) :: target-agnostic
?- bet
{$cru *} (se-dump:(se-text (trip p.bet)) q.bet)
{$hey *} +>(mir [0 ~]) :: refresh
{$rez *} +>(edg (dec p.bet)) :: resize window
{$yow *} ~&([%no-yow -.bet] +>)
[%cru *] (se-dump:(se-text (trip p.bet)) q.bet)
[%hey *] +>(mir [0 ~]) :: refresh
[%rez *] +>(edg (dec p.bet)) :: resize window
[%yow *] ~&([%no-yow -.bet] +>)
==
=+ gul=se-agon
?: |(?=(~ gul) (se-aint u.gul))
@ -481,8 +498,17 @@
eel (~(put in eel) [our.hid q.wel])
==
::
++ se-fade :: delete server
|= wel=well:gall
^+ +>
?. (~(has in ray) wel)
(se-text "[fade not running {<p.wel>}/{<q.wel>}]")
%= +>
ray (~(del in ray) wel)
==
::
++ se-drop :: disconnect
|= {pej/? gyl/gill:gall}
|= [pej=? gyl=gill:gall]
^+ +>
=+ lag=se-agon
?. (~(has by fug) gyl) +>.$
@ -497,7 +523,7 @@
+>.$
::
++ se-tab :: print tab completions
|= tl/(list {=cord =tank})
|= tl=(list [=cord =tank])
^+ +>
=/ lots (gth (lent tl) 10)
=/ long
@ -526,10 +552,10 @@
leaf+tape
::
++ se-dump :: print tanks
|= tac/(list tank)
|= tac=(list tank)
^+ +>
=/ 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 +>.^$
?. ((sane %t) (crip i.wol)) :: XX upstream validation
@ -538,35 +564,35 @@
$(wol t.wol, +>.^$ (se-blit %out (tuba i.wol)))
::
++ se-join :: confirm connection
|= gyl/gill:gall
|= gyl=gill:gall
^+ +>
=. +> (se-text "[linked to {<gyl>}]")
?> ?=(~ (~(got by fug) gyl))
(se-alas(fug (~(put by fug) gyl `*target)) gyl)
::
++ se-nuke :: teardown connection
|= gyl/gill:gall
|= gyl=gill:gall
^+ +>
(se-drop:(se-pull gyl) & gyl)
::
++ se-klin :: disconnect app
|= gyl/gill:gall
|= gyl=gill:gall
+>(eel (~(del in eel) gyl))
::
++ se-link :: connect to app
|= gyl/gill:gall
|= gyl=gill:gall
+>(eel (~(put in eel) gyl))
::
++ se-blit :: give output
|= bil/dill-blit:dill
|= bil=dill-blit:dill
+>(biz [bil biz])
::
++ se-blit-sys :: output to system
|= bil/dill-blit:dill ^+ +>
|= bil=dill-blit:dill ^+ +>
(se-emit %give %fact ~[/drum] %dill-blit !>(bil))
::
++ se-show :: show buffer, raw
|= lin/(pair @ud stub)
|= lin=(pair @ud stub)
^+ +>
?: =(mir lin) +>
=. +> ?:(=(p.mir p.lin) +> (se-blit %hop p.lin))
@ -574,7 +600,7 @@
+>(mir lin)
::
++ se-just :: adjusted buffer
|= {pom/stub lin/(pair @ud (list @c))}
|= [pom=stub lin=(pair @ud (list @c))]
^+ +>
=/ pol (lent-char:klr pom)
=/ pos (add pol p.lin)
@ -604,7 +630,7 @@
%_(+> moz [+< moz])
::
++ se-text :: return text
|= txt/tape
|= txt=tape
^+ +>
?. ((sane %t) (crip txt)) :: XX upstream validation
~& bad-text+<`*`txt>
@ -612,82 +638,82 @@
(se-blit %out (tuba txt))
::
++ se-poke :: send a poke
|= {gyl/gill:gall par/cage}
|= [gyl=gill:gall par=cage]
(se-emit %pass (en-gill gyl) %agent gyl %poke par)
::
++ se-peer :: send a peer
|= gyl/gill:gall
|= gyl=gill:gall
=/ =path /sole/(cat 3 'drum_' (scot %p our.hid))
%- se-emit(fug (~(put by fug) gyl ~))
[%pass (en-gill gyl) %agent gyl %watch path]
::
++ se-pull :: cancel subscription
|= gyl/gill:gall
|= gyl=gill:gall
(se-emit %pass (en-gill gyl) %agent gyl %leave ~)
::
++ se-tame :: switch connection
|= gyl/gill:gall
|= gyl=gill:gall
^+ ta
~(. ta gyl (need (~(got by fug) gyl)))
::
++ se-diff :: receive results
|= {gyl/gill:gall fec/sole-effect}
|= [gyl=gill:gall fec=sole-effect]
^+ +>
ta-abet:(ta-fec:(se-tame gyl) fec)
::
++ ta :: per target
|_ {gyl/gill:gall target} :: app and state
|_ [gyl=gill:gall target] :: app and state
++ ta-abet :: resolve
^+ ..ta
..ta(fug (~(put by fug) gyl ``target`+<+))
::
++ ta-poke |=(a/cage +>(..ta (se-poke gyl a))) :: poke gyl
++ ta-poke |=(a=cage +>(..ta (se-poke gyl a))) :: poke gyl
::
++ ta-act :: send action
|= act/sole-action
|= act=sole-action
^+ +>
(ta-poke %sole-action !>(act))
::
++ ta-id (cat 3 'drum_' (scot %p our.hid)) :: per-ship duct id
::
++ ta-aro :: hear arrow
|= key/?($d $l $r $u)
|= key=?(%d %l %r %u)
^+ +>
=. ris ~
?- key
$d ?. =(num.hit pos.hit)
%d ?. =(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))
$r ?: =((lent buf.say.inp) pos.inp)
%r ?: =((lent buf.say.inp) pos.inp)
ta-bel
+>(pos.inp +(pos.inp))
$u ?:(=(0 pos.hit) ta-bel (ta-mov (dec pos.hit)))
%u ?:(=(0 pos.hit) ta-bel (ta-mov (dec pos.hit)))
==
::
++ ta-bel :: beep
.(..ta (se-blit %bel ~), q.blt ~) :: forget belt
::
++ ta-belt :: handle input
|= bet/dill-belt:dill
|= bet=dill-belt:dill
^+ +>
?< ?=({?($cru $hey $rez $yow) *} bet) :: target-specific
?< ?=([?(%cru %hey %rez %yow) *] bet) :: target-specific
=. blt [q.blt `bet] :: remember belt
?- bet
{$aro *} (ta-aro p.bet)
{$bac *} ta-bac
{$ctl *} (ta-ctl p.bet)
{$del *} ta-del
{$met *} (ta-met p.bet)
{$ret *} ta-ret
{$txt *} (ta-txt p.bet)
[%aro *] (ta-aro p.bet)
[%bac *] ta-bac
[%ctl *] (ta-ctl p.bet)
[%del *] ta-del
[%met *] (ta-met p.bet)
[%ret *] ta-ret
[%txt *] (ta-txt p.bet)
==
::
++ ta-det :: send edit
|= ted/sole-edit
|= ted=sole-edit
^+ +>
%^ ta-act
ta-id
@ -707,50 +733,50 @@
(ta-hom %del (dec pos.inp))
::
++ ta-ctl :: hear control
|= key/@ud
|= key=@ud
^+ +>
=. ris ?.(?=(?($g $r) key) ~ ris)
=. ris ?.(?=(?(%g %r) key) ~ ris)
?+ key ta-bel
$a +>(pos.inp 0)
$b (ta-aro %l)
$c ta-bel
$d ?^ buf.say.inp
%a +>(pos.inp 0)
%b (ta-aro %l)
%c ta-bel
%d ?^ buf.say.inp
ta-del
?: (~(has in (deft-fish our.hid)) gyl)
+>(..ta (se-blit qit+~)) :: quit pier
+>(..ta (se-klin gyl)) :: unlink app
$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 ~])
$i ta-tab
$k =+ len=(lent buf.say.inp)
%i ta-tab
%k =+ len=(lent buf.say.inp)
?: =(pos.inp len)
ta-bel
(ta-kil %r [pos.inp (sub len pos.inp)])
$l +>(..ta (se-blit %clr ~))
$n (ta-aro %d)
$p (ta-aro %u)
$r ?~ ris
%l +>(..ta (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=(sub pos.inp ?:(=(len pos.inp) 2 1))
(ta-hom (rep:edit [sop 2] (flop (swag [sop 2] buf.say.inp))))
$u ?: =(0 pos.inp)
%u ?: =(0 pos.inp)
ta-bel
(ta-kil %l [0 pos.inp])
$v ta-bel
$w ?: =(0 pos.inp)
%v ta-bel
%w ?: =(0 pos.inp)
ta-bel
=+ sop=(ta-pos %l %ace pos.inp)
(ta-kil %l [(sub pos.inp sop) sop])
$x +>(..ta se-anon)
$y ?: =(0 num.kil)
%x +>(..ta se-anon)
%y ?: =(0 num.kil)
ta-bel
(ta-hom (cat:edit pos.inp ta-yan))
==
@ -762,78 +788,78 @@
(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 *} +>(..ta (se-blit fec))
{$det *} (ta-got +.fec)
{$err *} (ta-err p.fec)
{$klr *} +>(..ta (se-blit %klr (make:klr p.fec)))
{$mor *} |- ^+ +>.^$
[%bel *] ta-bel
[%blk *] +>
[%clr *] +>(..ta (se-blit fec))
[%det *] (ta-got +.fec)
[%err *] (ta-err p.fec)
[%klr *] +>(..ta (se-blit %klr (make:klr p.fec)))
[%mor *] |- ^+ +>.^$
?~ p.fec +>.^$
$(p.fec t.p.fec, +>.^$ ^$(fec i.p.fec))
{$nex *} ta-nex
{$pro *} (ta-pro +.fec)
{$tab *} +>(..ta (se-tab p.fec))
{$tan *} +>(..ta (se-dump p.fec))
{$sag *} +>(..ta (se-blit fec))
{$sav *} +>(..ta (se-blit fec))
{$txt *} +>(..ta (se-text p.fec))
{$url *} +>(..ta (se-blit fec))
[%nex *] ta-nex
[%pro *] (ta-pro +.fec)
[%tab *] +>(..ta (se-tab p.fec))
[%tan *] +>(..ta (se-dump p.fec))
[%sag *] +>(..ta (se-blit fec))
[%sav *] +>(..ta (se-blit fec))
[%txt *] +>(..ta (se-text p.fec))
[%url *] +>(..ta (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-off :: reset buffer offset
|= ted/sole-edit
=? off (any:edit ted |=(a/sole-edit ?=($set -.a))) 0
|= ted=sole-edit
=? off (any:edit ted |=(a=sole-edit ?=(%set -.a))) 0
+>
::
++ ta-got :: apply change
|= cal/sole-change
|= cal=sole-change
=^ ted say.inp (~(receive sole say.inp) cal)
(ta-dog:(ta-off ted.cal) ted)
::
++ ta-hom :: local edit
|= ted/sole-edit
|= ted=sole-edit
^+ +>
=. +> (ta-det:(ta-off ted) ted)
(ta-dog(say.inp (~(commit sole say.inp) ted)) ted)
::
++ ta-jump :: buffer pos
|= {dir/?($l $r) til/?($ace $edg $wrd) pos/@ud}
|= [dir=?(%l %r) til=?(%ace %edg %wrd) pos=@ud]
^- @ud
%- ?:(?=($l dir) sub add)
%- ?:(?=(%l dir) sub add)
[pos (ta-pos dir til pos)]
::
++ ta-kil :: kill selection
|= {dir/?($l $r) sel/{@ @}}
|= [dir=?(%l %r) sel=[@ @]]
^+ +>
=+ buf=(swag sel buf.say.inp)
%. (cut:edit sel)
@ -841,8 +867,8 @@
kil
?. ?& ?=(^ old.kil)
?=(^ p.blt)
?| ?=({$ctl ?($k $u $w)} u.p.blt)
?=({$met ?($d $bac)} u.p.blt)
?| ?=([%ctl ?(%k %u %w)] u.p.blt)
?=([%met ?(%d %bac)] u.p.blt)
== ==
%= kil :: prepend
num +(num.kil)
@ -853,32 +879,32 @@
pos num.kil
old :_ t.old.kil
?- dir
$l (welp buf i.old.kil)
$r (welp i.old.kil buf)
%l (welp buf i.old.kil)
%r (welp i.old.kil buf)
== ==
==
::
++ ta-met :: meta key
|= key/@ud
|= key=@ud
^+ +>
=. ris ~
?+ key ta-bel
$dot ?. &(?=(^ old.hit) ?=(^ i.old.hit)) :: last "arg" from hist
%dot ?. &(?=(^ old.hit) ?=(^ i.old.hit)) :: last "arg" from hist
ta-bel
=+ old=`(list @c)`i.old.hit
=+ sop=(ta-jump(buf.say.inp old) %l %ace (lent old))
(ta-hom (cat:edit pos.inp (slag sop old)))
::
$bac ?: =(0 pos.inp) :: kill left-word
%bac ?: =(0 pos.inp) :: kill left-word
ta-bel
=+ sop=(ta-pos %l %edg pos.inp)
(ta-kil %l [(sub pos.inp sop) sop])
::
$b ?: =(0 pos.inp) :: jump left-word
%b ?: =(0 pos.inp) :: jump left-word
ta-bel
+>(pos.inp (ta-jump %l %edg pos.inp))
::
$c ?: =(pos.inp (lent buf.say.inp)) :: capitalize
%c ?: =(pos.inp (lent buf.say.inp)) :: capitalize
ta-bel
=+ sop=(ta-jump %r %wrd pos.inp)
%- ta-hom(pos.inp (ta-jump %r %edg sop))
@ -886,20 +912,20 @@
^- (list @c) ^- (list @) :: XX unicode
(cuss `tape``(list @)`(swag [sop 1] buf.say.inp))
::
$d ?: =(pos.inp (lent buf.say.inp)) :: kill right-word
%d ?: =(pos.inp (lent buf.say.inp)) :: kill right-word
ta-bel
(ta-kil %r [pos.inp (ta-pos %r %edg pos.inp)])
::
$f ?: =(pos.inp (lent buf.say.inp)) :: jump right-word
%f ?: =(pos.inp (lent buf.say.inp)) :: jump right-word
ta-bel
+>(pos.inp (ta-jump %r %edg pos.inp))
::
$r %- ta-hom(lay.hit (~(put by lay.hit) pos.hit ~))
%r %- ta-hom(lay.hit (~(put by lay.hit) pos.hit ~))
:- %set :: revert hist edit
?: =(pos.hit num.hit) ~
(snag (sub num.hit +(pos.hit)) old.hit)
::
$t =+ a=(ta-jump %r %edg pos.inp) :: transpose words
%t =+ a=(ta-jump %r %edg pos.inp) :: transpose words
=+ b=(ta-jump %l %edg a)
=+ c=(ta-jump %l %edg b)
?: =(b c)
@ -912,10 +938,10 @@
(rep:edit prev (swag next buf.say.inp))
==
::
?($u $l) :: upper/lower case
?(%u %l) :: upper/lower case
?: =(pos.inp (lent buf.say.inp))
ta-bel
=+ case=?:(?=($u key) cuss cass)
=+ case=?:(?=(%u key) cuss cass)
=+ sop=(ta-jump %r %wrd pos.inp)
=+ sel=[sop (ta-pos %r %edg sop)]
%- ta-hom
@ -923,10 +949,10 @@
^- (list @c) ^- (list @) :: XX unicode
(case `tape``(list @)`(swag sel buf.say.inp))
::
$y ?. ?& ?=(^ old.kil) :: rotate & yank
%y ?. ?& ?=(^ old.kil) :: rotate & yank
?=(^ p.blt)
?| ?=({$ctl $y} u.p.blt)
?=({$met $y} u.p.blt)
?| ?=([%ctl %y] u.p.blt)
?=([%met %y] u.p.blt)
== ==
ta-bel
=+ las=(lent ta-yan)
@ -935,7 +961,7 @@
==
::
++ ta-mov :: move in history
|= sop/@ud
|= sop=@ud
^+ +>
?: =(sop pos.hit) +>
%- %= ta-hom
@ -961,24 +987,24 @@
==
::
++ ta-pos :: buffer pos offset
|= {dir/?($l $r) til/?($ace $edg $wrd) pos/@ud}
|= [dir=?(%l %r) til=?(%ace %edg %wrd) pos=@ud]
^- @ud
%- ?- til $ace ace:offset
$edg edg:offset
$wrd wrd:offset
%- ?- til %ace ace:offset
%edg edg:offset
%wrd wrd:offset
==
?- dir $l (flop (scag pos buf.say.inp))
$r (slag pos buf.say.inp)
?- dir %l (flop (scag pos buf.say.inp))
%r (slag pos buf.say.inp)
==
::
++ ta-pro :: set prompt
|= pom/sole-prompt
|= pom=sole-prompt
%_ +>
pom
%_ pom
cad
;: welp
?. ?=($earl (clan:title p.gyl))
?. ?=(%earl (clan:title p.gyl))
(cite:title p.gyl)
(scow %p p.gyl)
::
@ -996,7 +1022,7 @@
(ta-act ta-id %tab pos.inp)
::
++ ta-ser :: reverse search
|= ext/(list @c)
|= ext=(list @c)
^+ +>
?: |(?=(~ ris) =(0 pos.u.ris))
ta-bel
@ -1013,15 +1039,15 @@
(ta-mov(str.u.ris tot, pos.u.ris u.sup) (dec u.sup))
::
++ ta-txt :: hear text
|= txt/(list @c)
|= txt=(list @c)
^+ +>
?^ ris
(ta-ser txt)
(ta-hom (cat:edit pos.inp txt))
::
++ ta-vew :: computed prompt
^- {pom/stub lin/(pair @ud (list @c))}
=; vew/(pair (list @c) styx)
^- [pom=stub lin=(pair @ud (list @c))]
=; vew=(pair (list @c) styx)
[(make:klr q.vew) pos.inp p.vew]
?: vis.pom
:- buf.say.inp :: default prompt
@ -1040,7 +1066,7 @@
++ edit :: produce sole-edits
|%
++ cat :: mass insert
|= {pos/@ud txt/(list @c)}
|= [pos=@ud txt=(list @c)]
^- sole-edit
:- %mor
|- ^- (list sole-edit)
@ -1048,7 +1074,7 @@
[[%ins pos i.txt] $(pos +(pos), txt t.txt)]
::
++ cut :: mass delete
|= {pos/@ud num/@ud}
|= [pos=@ud num=@ud]
^- sole-edit
:- %mor
|- ^- (list sole-edit)
@ -1056,30 +1082,30 @@
[[%del pos] $(num (dec num))]
::
++ rep :: mass replace
|= {{pos/@ud num/@ud} txt/(list @c)}
|= [[pos=@ud num=@ud] txt=(list @c)]
^- sole-edit
:~ %mor
(cut pos num)
(cat pos txt)
==
++ any :: matches?
|= {a/sole-edit b/$-(sole-edit ?)}
|= [a=sole-edit b=$-(sole-edit ?)]
^- ?
?. ?=($mor -.a) (b a)
(lien p.a |=(c/sole-edit ^$(a c)))
?. ?=(%mor -.a) (b a)
(lien p.a |=(c=sole-edit ^$(a c)))
--
++ offset :: calculate offsets
|%
++ alnm :: alpha-numeric
|= a/@ ^- ?
|= a=@ ^- ?
?| &((gte a '0') (lte a '9'))
&((gte a 'A') (lte a 'Z'))
&((gte a 'a') (lte a 'z'))
==
::
++ ace :: next whitespace
|= a/(list @)
=| {b/_| i/@ud}
|= a=(list @)
=| [b=_| i=@ud]
|- ^- @ud
?~ a i
=/ c !=(32 i.a)
@ -1088,8 +1114,8 @@
$(i +(i), a t.a)
::
++ edg :: next word boundary
|= a/(list @)
=| {b/_| i/@ud}
|= a=(list @)
=| [b=_| i=@ud]
|- ^- @ud
?~ a i
=/ c (alnm i.a)
@ -1098,8 +1124,8 @@
$(i +(i), a t.a)
::
++ wrd :: next or current word
|= a/(list @)
=| i/@ud
|= a=(list @)
=| i=@ud
|- ^- @ud
?: |(?=(~ a) (alnm i.a)) i
$(i +(i), a t.a)
@ -1109,22 +1135,22 @@
=, dill
|%
++ make :: stub from styx
|= a/styx ^- stub
=| b/stye
|= a=styx ^- stub
=| b=stye
%+ reel
|- ^- stub
%- zing %+ turn a
|= a/$@(@t (pair styl styx))
|= a=$@(@t (pair styl styx))
?@ a [b (tuba (trip a))]~
^$(a q.a, b (styd p.a b))
::
|= {a/(pair stye (list @c)) b/stub}
|= [a=(pair stye (list @c)) b=stub]
?~ b [a ~]
?. =(p.a p.i.b) [a b]
[[p.a (weld q.a q.i.b)] t.b]
::
++ styd :: stye from styl
|= {a/styl b/stye} ^+ b :: with inheritance
|= [a=styl b=stye] ^+ b :: with inheritance
:+ ?~ p.a p.b
?~ u.p.a ~
(~(put in p.b) u.p.a)
@ -1132,18 +1158,18 @@
(fall q.q.a q.q.b)
::
++ lent-char
|= a/stub ^- @
|= a=stub ^- @
(roll (lnts-char a) add)
::
++ lnts-char :: stub pair tail lengths
|= a/stub ^- (list @)
|= a=stub ^- (list @)
%+ turn a
|= a/(pair stye (list @c))
|= a=(pair stye (list @c))
(lent q.a)
::
++ brek :: index + incl-len of
|= {a/@ b/(list @)} :: stub pair w/ idx a
=| {c/@ i/@}
|= [a=@ b=(list @)] :: stub pair w= idx a
=| [c=@ i=@]
|- ^- (unit (pair @ @))
?~ b ~
=. c (add c i.b)
@ -1152,7 +1178,7 @@
$(i +(i), b t.b)
::
++ slag :: slag stub, keep stye
|= {a/@ b/stub}
|= [a=@ b=stub]
^- stub
=+ c=(lnts-char b)
=+ i=(brek a c)
@ -1165,7 +1191,7 @@
(^slag (sub (snag p.u.i c) (sub q.u.i a)) q.n)
::
++ scag :: scag stub, keep stye
|= {a/@ b/stub}
|= [a=@ b=stub]
^- stub
=+ c=(lnts-char b)
=+ i=(brek a c)
@ -1179,7 +1205,7 @@
(^scag (sub (snag p.u.i c) (sub q.u.i a)) q.n)
::
++ swag :: swag stub, keep stye
|= {{a/@ b/@} c/stub}
|= [[a=@ b=@] c=stub]
(scag b (slag a c))
--
--

View File

@ -108,6 +108,10 @@
|= ~ =< abet
(emit %pass /pack %arvo %d %flog %pack ~)
::
++ poke-pass
|= =note-arvo =< abet
(emit %pass /helm/pass %arvo note-arvo)
::
++ take-wake-automass
|= [way=wire error=(unit tang)]
?^ error
@ -122,7 +126,7 @@
==
::
++ poke-send-hi
|= {her/ship mes/(unit tape)} =< abet
|= [her=ship mes=(unit tape)] =< abet
%- emit
:* %pass /helm/hi/(scot %p her)
%agent [her %hood] %poke
@ -131,7 +135,7 @@
::
::
++ poke-hi
|= mes/@t
|= mes=@t
~| %poke-hi-fail
?: =(%fail mes)
~& %poke-hi-fail
@ -139,33 +143,33 @@
abet:(flog %text "< {<src.bowl>}: {(trip mes)}")
::
++ poke-atom
|= ato/@
|= ato=@
=+ len=(scow %ud (met 3 ato))
=+ gum=(scow %p (mug ato))
=< abet
(flog %text "< {<src.bowl>}: atom: {len} bytes, mug {gum}")
::
++ coup-hi
|= {pax/path cop/(unit tang)} =< abet
?> ?=({@t ~} pax)
|= [pax=path cop=(unit tang)] =< abet
?> ?=([@t ~] pax)
(flog %text "hi {(trip i.pax)} {?~(cop "" "un")}successful")
::
++ 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
%+ turn all
=+ top=`path`/(scot %p our.bowl)/[syd]/(scot %da now.bowl)
=/ van/(list {term ~})
=/ van=(list [term ~])
:- zus=[%zuse ~]
~(tap by dir:.^(arch %cy (welp top /sys/vane)))
|= nam/@tas
|= nam=@tas
=. nam
?. =(1 (met 3 nam))
nam
=/ zaz/(list {p/knot ~})
(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)
=+ zus==('z' tip)
@ -247,6 +251,7 @@
%helm-meld =;(f (f !<(_+<.f vase)) poke-meld)
%helm-moon =;(f (f !<(_+<.f vase)) poke-moon)
%helm-pack =;(f (f !<(_+<.f vase)) poke-pack)
%helm-pass =;(f (f !<(_+<.f vase)) poke-pass)
%helm-rekey =;(f (f !<(_+<.f vase)) poke-rekey)
%helm-reload =;(f (f !<(_+<.f vase)) poke-reload)
%helm-reload-desk =;(f (f !<(_+<.f vase)) poke-reload-desk)
@ -276,5 +281,6 @@
?>(?=(%wake +<.sign-arvo) +>.sign-arvo)
[%serv *] %+ take-bound t.wire
?>(?=(%bound +<.sign-arvo) +>.sign-arvo)
[%pass *] abet
==
--

View File

@ -73,7 +73,7 @@
?~(+< +> $(+< t.+<, +> (emit i.+<)))
::
++ render
|= {mez/tape sud/desk who/ship syd/desk}
|= [mez=tape sud=desk who=ship syd=desk]
:^ %palm [" " ~ ~ ~] leaf+(weld "kiln: " mez)
~[leaf+"from {<sud>}" leaf+"on {<who>}" leaf+"to {<syd>}"]
::
@ -113,7 +113,7 @@
``noun+!>(ota)
::
++ poke-commit
|= [mon/kiln-commit auto=?]
|= [mon=kiln-commit auto=?]
=< abet
=. +>.$ (emit %pass /commit %arvo %c [%dirk mon])
?. auto
@ -124,7 +124,7 @@
(emit %pass way.commit-timer %arvo %b [%wait nex.commit-timer])
::
++ poke-autocommit
|= [mon/kiln-commit auto=?]
|= [mon=kiln-commit auto=?]
=< abet
=. +>.$ (emit %pass /commit %arvo %c [%dirk mon])
?. auto
@ -147,7 +147,7 @@
abet:(emit %pass /mount %arvo %c [%mont pot u.bem])
::
++ poke-unmount
|= mon/kiln-unmount
|= mon=kiln-unmount
?^ mon
=+ bem=(de-beam mon)
?~ bem
@ -157,7 +157,7 @@
abet:(emit %pass /unmount-point %arvo %c [%ogre mon])
::
++ poke-track ::
|= hos/kiln-sync
|= hos=kiln-sync
?: (~(has by syn) hos)
abet:(spam (render "already tracking" [sud her syd]:hos) ~)
abet:abet:start-track:(auto hos)
@ -271,7 +271,7 @@
=. ..abet (render-ket "OTA cancelled (1), retrying" ~)
(poke-internal `[ship desk]:u.ota)
=. ..abet (render-ket "downloading OTA update" ~)
=? aeon.u.ota ?=($w p.p.u.p.sign-arvo)
=? aeon.u.ota ?=(%w p.p.u.p.sign-arvo)
ud:;;(cass:clay q.q.r.u.p.sign-arvo)
%: emit
%pass (make-wire /download) %arvo %c
@ -337,7 +337,7 @@
--
::
++ 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)
@ -361,10 +361,10 @@
?: =(0 ~(wyt by syn))
[%leaf "no other syncs configured"]~
%+ turn ~(tap in ~(key by syn))
|=(a/kiln-sync (render "sync configured" [sud her syd]:a))
|=(a=kiln-sync (render "sync configured" [sud her syd]:a))
::
++ 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)
@ -381,13 +381,13 @@
abet:(emit %pass /cancel %arvo %c [%drop a])
::
++ poke-info
|= {mez/tape tor/(unit toro)}
|= [mez=tape tor=(unit toro)]
?~ tor
abet:(spam leaf+mez ~)
abet:(emit:(spam leaf+mez ~) %pass /kiln %arvo %c [%info u.tor])
::
++ poke-rm
|= a/path
|= a=path
=+ b=.^(arch %cy a)
?~ fil.b
=+ ~[leaf+"No such file:" leaf+"{<a>}"]
@ -395,19 +395,19 @@
(poke-info "removed" `(fray a))
::
++ poke-label
|= {syd/desk lab/@tas}
|= [syd=desk lab=@tas]
=+ pax=/(scot %p our)/[syd]/[lab]
(poke-info "labeled {(spud pax)}" `[syd %| lab])
::
++ poke-schedule
|= {where/path tym/@da eve/@t}
|= [where=path tym=@da eve=@t]
=. where (welp where /sched)
%+ poke-info "scheduled"
=+ old=;;((map @da cord) (fall (file where) ~))
`(foal where %sched !>((~(put by old) tym eve)))
::
++ poke-permission
|= {syd/desk pax/path pub/?}
|= [syd=desk pax=path pub=?]
=< abet
%- emit
=/ =rite [%r ~ ?:(pub %black %white) ~]
@ -447,7 +447,7 @@
abet:(emit %pass /kiln %arvo %g %sear ship)
::
++ done
|= {way/wire saw/(unit error:ames)}
|= [way=wire saw=(unit error:ames)]
~? ?=(^ saw) [%kiln-nack u.saw]
abet
::
@ -481,24 +481,24 @@
?>(?=(%mere +<.sign-arvo) +>.sign-arvo)
==
==
++ 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-coup-fancy ::
|= {way/wire saw/(unit tang)}
|= [way=wire saw=(unit tang)]
abet:abet:(coup-fancy:(take way) saw)
::
++ take-coup-spam ::
|= {way/wire saw/(unit tang)}
|= [way=wire saw=(unit tang)]
~? ?=(^ saw) [%kiln-spam-lame u.saw]
abet
::
++ 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)
@ -508,9 +508,9 @@
abet:abet:(mere:(auto hos) mes)
::
++ take-writ-find-ship ::
|= {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)
@ -520,9 +520,9 @@
abet:abet:(take-find-ship:(auto hos) rot)
::
++ 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)
@ -546,7 +546,7 @@
::
::
++ spam
|= mes/(list tank)
|= mes=(list tank)
((slog mes) ..spam)
::
++ auto
@ -557,7 +557,7 @@
..auto(syn (~(put by syn) [syd her sud] let))
::
++ blab
|= new/(list card:agent:gall)
|= new=(list card:agent:gall)
^+ +>
+>.$(moz (welp new moz))
::
@ -598,7 +598,7 @@
(render "on sync" sud her syd)
~
start-sync
=. let ?. ?=($w p.p.u.rot) let ud:;;(cass:clay q.q.r.u.rot)
=. let ?. ?=(%w p.p.u.rot) let ud:;;(cass:clay q.q.r.u.rot)
=/ =wire /kiln/sync/merg/[syd]/(scot %p her)/[sud]
:: germ: merge mode for sync merges
::
@ -648,7 +648,7 @@
q.p.mes
==
::
$no-ali-disc
%no-ali-disc
:~ (render "sync activated" sud her syd)
leaf+"note: blank desk {<sud>} on {<her>}"
==
@ -658,7 +658,7 @@
--
::
++ work :: state machine
|= syd/desk
|= syd=desk
=/ ,per-desk
%+ ~(gut by rem) syd
=+ *per-desk
@ -668,7 +668,7 @@
..work(rem (~(put by rem) syd auto gem her sud cas))
::
++ blab
|= new/(list card:agent:gall)
|= new=(list card:agent:gall)
^+ +>
+>.$(moz (welp new moz))
::
@ -685,7 +685,7 @@
(blab [%pass /kiln/[syd] %arvo %c [%merg 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)]
^+ +>
=/ =cage [%kiln-merge !>([syd her sud cas gem])]
%- blab :_ ~
@ -694,9 +694,9 @@
++ 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 ud:.^(cass:clay %cw /(scot %p our)/[syd]/(scot %da now)))
=> $(gim %init)
@ -705,7 +705,7 @@
.(auto &)
::
++ coup-fancy
|= saw/(unit tang)
|= saw=(unit tang)
?~ saw
+>
=+ :- "failed to set up conflict resolution scratch space"
@ -713,7 +713,7 @@
lose:(spam leaf+-< leaf+-> u.saw)
::
++ mere
|= are/(each (set path) (pair term tang))
|= are=(each (set path) (pair term tang))
^+ +>
?: =(%meld gem)
?: ?=(%& -.are)
@ -786,27 +786,27 @@
?+ 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])
::
$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" ~)
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" ~)
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)
=> .(gem %meld)
@ -824,11 +824,11 @@
==
::
++ 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< ~)
--

View File

@ -1,7 +1,7 @@
/- *invite-store
/+ resource
|%
++ slan |=(mod/@tas |=(txt/@ta (need (slaw mod txt))))
++ slan |=(mod=@tas |=(txt=@ta (need (slaw mod txt))))
::
++ seri ::: serial
=, dejs:format

View File

@ -34,11 +34,11 @@
:: :: ++apex:en-json:html
++ apex
=, en-json:html
|= {val/json sor/$-(^ ?) rez/tape}
|= [val=json sor=$-(^ ?) rez=tape]
^- tape
?~ val (weld "null" rez)
?- -.val
$a
%a
:- '['
=. rez [']' rez]
!.
@ -47,9 +47,9 @@
?~ t.p.val ^$(val i.p.val)
^$(val i.p.val, rez [',' $(p.val t.p.val)])
::
$b (weld ?:(p.val "true" "false") rez)
$n (weld (trip p.val) rez)
$s
%b (weld ?:(p.val "true" "false") rez)
%n (weld (trip p.val) rez)
%s
:- '"'
=. rez ['"' rez]
=+ viz=(trip p.val)
@ -57,11 +57,11 @@
|- ^- tape
?~ viz rez
=+ hed=(jesc i.viz)
?: ?=({@ $~} hed)
?: ?=([@ ~] hed)
[i.hed $(viz t.viz)]
(weld hed $(viz t.viz))
::
$o
%o
:- '{'
=. rez ['}' rez]
=/ viz

View File

@ -9,7 +9,7 @@
:: Like +rose except also produces line number
::
++ lily
|* {los/tape sab/rule}
|* [los=tape sab=rule]
=+ vex=(sab [[1 1] los])
?~ q.vex
[%| p=p.vex(q (dec q.p.vex))]
@ -142,9 +142,8 @@
`['' (~(play ut sut) wing+t.p.gen)]
::
[^ *] (both p.gen q.gen)
[%ktcn *] loop(gen p.gen)
[%brcn *] (grow q.gen)
[%brvt *] (grow q.gen)
[%brpt *] (grow q.gen)
[%cnts *]
|- ^- (unit [term type])
=* inner-loop $
@ -165,13 +164,13 @@
[%hand *] ~
[%ktbr *] loop(gen p.gen)
[%ktls *] (both p.gen q.gen)
[%ktpd *] loop(gen p.gen)
[%ktpm *] loop(gen p.gen)
[%ktsg *] loop(gen p.gen)
[%ktwt *] loop(gen p.gen)
[%note *] loop(gen q.gen)
[%sgzp *] (both p.gen q.gen)
[%sgbn *] loop(gen q.gen) :: should check for hoon in p.gen
[%tsbn *] (change p.gen q.gen)
[%sggr *] loop(gen q.gen) :: should check for hoon in p.gen
[%tsgr *] (change p.gen q.gen)
[%tscm *]
%+ replace
loop(gen p.gen)
@ -185,7 +184,7 @@
[%lost *] loop(gen p.gen)
[%zpmc *] (both p.gen q.gen)
[%zpts *] loop(gen p.gen)
[%zpvt *] (both q.gen r.gen)
[%zppt *] (both q.gen r.gen)
[%zpzp *] ~
*
=+ doz=~(open ap gen)

View File

@ -1,32 +1,32 @@
:: Fast type printing that's easy on the eyes or your money back
::
=> |%
++ cape {p/(map @ud wine) q/wine}
++ wine
$@ $? $noun
$path
$type
$void
$wall
$wool
$yarn
+$ cape [p=(map @ud wine) q=wine]
+$ wine
$@ $? %noun
%path
%type
%void
%wall
%wool
%yarn
==
$% {$mato p/term}
{$gate p/hoon q/type r/wine}
{$core p/(list @ta) q/wine}
{$face p/term q/wine}
{$list p/term q/wine}
{$pear p/term q/@}
{$bswt p/(list wine)}
{$plot p/(list wine)}
{$stop p/@ud}
{$tree p/term q/wine}
{$unit p/term q/wine}
$% [%mato p=term]
[%gate p=hoon q=type r=wine]
[%core p=(list @ta) q=wine]
[%face p=term q=wine]
[%list p=term q=wine]
[%pear p=term q=@]
[%bcwt p=(list wine)]
[%plot p=(list wine)]
[%stop p=@ud]
[%tree p=term q=wine]
[%unit p=term q=wine]
==
--
|_ sut/type
|_ sut=type
++ dash
|= {mil/tape lim/char lam/tape}
|= [mil=tape lim=char lam=tape]
^- tape
=/ esc (~(gas in *(set @tD)) lam)
:- lim
@ -41,33 +41,33 @@
[i.mil $(mil t.mil)]
['\\' ~(x ne (rsh 2 1 i.mil)) ~(x ne (end 2 1 i.mil)) $(mil t.mil)]
::
++ deal |=(lum/* (dish dole lum))
++ deal |=(lum=* (dish dole lum))
++ dial
|= ham/cape
|= ham=cape
=+ gid=*(set @ud)
=| top-level=? :: don't need circumfix punctuation
=< `tank`-:$
|%
++ many
|= haz/(list wine)
^- {(list tank) (set @ud)}
|= haz=(list wine)
^- [(list tank) (set @ud)]
?~ haz [~ gid]
=^ mor gid $(haz t.haz)
=^ dis gid ^$(q.ham i.haz)
[[dis mor] gid]
::
++ $
^- {tank (set @ud)}
^- [tank (set @ud)]
?- q.ham
$noun :_(gid [%leaf '*' ~])
$path :_(gid [%leaf '/' ~])
$type :_(gid [%leaf '#' 't' ~])
$void :_(gid [%leaf '#' '!' ~])
$wool :_(gid [%leaf '*' '"' '"' ~])
$wall :_(gid [%leaf '*' '\'' '\'' ~])
$yarn :_(gid [%leaf '"' '"' ~])
{$mato *} :_(gid [%leaf '@' (trip p.q.ham)])
{$gate *}
%noun :_(gid [%leaf '*' ~])
%path :_(gid [%leaf '/' ~])
%type :_(gid [%leaf '#' 't' ~])
%void :_(gid [%leaf '#' '!' ~])
%wool :_(gid [%leaf '*' '"' '"' ~])
%wall :_(gid [%leaf '*' '\'' '\'' ~])
%yarn :_(gid [%leaf '"' '"' ~])
[%mato *] :_(gid [%leaf '@' (trip p.q.ham)])
[%gate *]
=^ sam gid
?. ?=([%plot * * *] r.q.ham)
?: ?=(%plot -.r.q.ham)
@ -92,7 +92,7 @@
==
~
::
{$core *}
[%core *]
=^ sam gid
?. ?=([%plot * * ~] q.q.ham)
`gid
@ -114,26 +114,26 @@
[[%leaf (rip 3 i.p.q.ham)] $(p.q.ham t.p.q.ham)]
~
::
{$face *}
[%face *]
=^ cox gid $(q.ham q.q.ham)
:_(gid [%palm [['=' ~] ~ ~ ~] [%leaf (trip p.q.ham)] cox ~])
::
{$list *}
[%list *]
=^ cox gid $(q.ham q.q.ham)
:_(gid [%rose [" " (weld (trip p.q.ham) "(") ")"] cox ~])
::
{$bswt *}
[%bcwt *]
=^ coz gid (many p.q.ham)
:_(gid [%rose [[' ' ~] ['?' '(' ~] [')' ~]] coz])
::
{$plot *}
[%plot *]
=^ coz gid (many p.q.ham)
:_(gid [%rose [[' ' ~] ['[' ~] [']' ~]] coz])
::
{$pear *}
[%pear *]
:_(gid [%leaf '$' ~(rend co [%$ p.q.ham q.q.ham])])
::
{$stop *}
[%stop *]
=+ num=~(rend co [%$ %ud p.q.ham])
?: (~(has in gid) p.q.ham)
:_(gid [%leaf '#' num])
@ -144,26 +144,26 @@
==
:_(gid [%palm [['.' ~] ~ ~ ~] [%leaf ['^' '#' num]] cox ~])
::
{$tree *}
[%tree *]
=^ cox gid $(q.ham q.q.ham)
:_(gid [%rose [" " (weld (trip p.q.ham) "(") ")"] cox ~])
::
{$unit *}
[%unit *]
=^ cox gid $(q.ham q.q.ham)
:_(gid [%rose [" " (weld (trip p.q.ham) "(") ")"] cox ~])
==
--
::
++ dish !:
|= {ham/cape lum/*} ^- tank
|= [ham=cape lum=*] ^- tank
~| [%dish-h ?@(q.ham q.ham -.q.ham)]
~| [%lump lum]
~| [%ham ham]
%- need
=| gil/(set {@ud *})
=| gil=(set [@ud *])
|- ^- (unit tank)
?- q.ham
$noun
%noun
%= $
q.ham
?: ?=(@ lum)
@ -173,7 +173,7 @@
[%noun ?:(?=(@ +.lum) [[%mato %$] ~] $(lum +.lum))]
==
::
$path
%path
:- ~
:+ %rose
[['/' ~] ['/' ~] ~]
@ -183,7 +183,7 @@
?> ?=(@ -.lum)
[[%leaf (rip 3 -.lum)] $(lum +.lum)]
::
$type
%type
=+ tyr=|.((dial dole))
=+ vol=tyr(sut lum)
=+ cis=;;(tank .*(vol [%9 2 %0 1]))
@ -191,7 +191,7 @@
[~ ~ ~ ~]
[[%leaf '#' 't' '/' ~] cis ~]
::
$wall
%wall
:- ~
:+ %rose
[[' ' ~] ['<' '|' ~] ['|' '>' ~]]
@ -200,7 +200,7 @@
?@ lum !!
[[%leaf (trip ;;(@ -.lum))] $(lum +.lum)]
::
$wool
%wool
:- ~
:+ %rose
[[' ' ~] ['<' '<' ~] ['>' '>' ~]]
@ -209,28 +209,28 @@
?@ lum !!
[(need ^$(q.ham %yarn, lum -.lum)) $(lum +.lum)]
::
$yarn
%yarn
[~ %leaf (dash (tape lum) '"' "\{")]
::
$void
%void
~
::
{$mato *}
[%mato *]
?. ?=(@ lum)
~
:+ ~
%leaf
?+ (rash p.q.ham ;~(sfix (cook crip (star low)) (star hig)))
~(rend co [%$ p.q.ham lum])
$$ ~(rend co [%$ %ud lum])
$t (dash (rip 3 lum) '\'' ~)
$tas ['%' ?.(=(0 lum) (rip 3 lum) ['$' ~])]
%$ ~(rend co [%$ %ud lum])
%t (dash (rip 3 lum) '\'' ~)
%tas ['%' ?.(=(0 lum) (rip 3 lum) ['$' ~])]
==
::
{$gate *}
[%gate *]
!!
::
{$core *}
[%core *]
:: XX needs rethinking for core metal
:: ?. ?=(^ lum) ~
:: => .(lum `*`lum)
@ -244,13 +244,13 @@
:: ?~(mur ~ [~ [[%leaf (rip 3 i.p.q.ham)] u.mur]])
[~ (dial ham)]
::
{$face *}
[%face *]
=+ wal=$(q.ham q.q.ham)
?~ wal
~
[~ %palm [['=' ~] ~ ~ ~] [%leaf (trip p.q.ham)] u.wal ~]
::
{$list *}
[%list *]
?: =(~ lum)
[~ %leaf '~' ~]
=- ?~ tok
@ -265,7 +265,7 @@
~
[~ u.for u.aft]
::
{$bswt *}
[%bcwt *]
|- ^- (unit tank)
?~ p.q.ham
~
@ -274,7 +274,7 @@
$(p.q.ham t.p.q.ham)
wal
::
{$plot *}
[%plot *]
=- ?~ tok
~
[~ %rose [[' ' ~] ['[' ~] [']' ~]] u.tok]
@ -282,7 +282,7 @@
|- ^- (unit (list tank))
?~ p.q.ham
~
?: ?=({* ~} p.q.ham)
?: ?=([* ~] p.q.ham)
=+ wal=^$(q.ham i.p.q.ham)
?~(wal ~ [~ [u.wal ~]])
?@ lum
@ -295,25 +295,25 @@
~
[~ u.gim u.myd]
::
{$pear *}
[%pear *]
?. =(lum q.q.ham)
~
=. p.q.ham
(rash p.q.ham ;~(sfix (cook crip (star low)) (star hig)))
=+ fox=$(q.ham [%mato p.q.ham])
?> ?=({~ $leaf ^} fox)
?: ?=(?($n $tas) p.q.ham)
?> ?=([~ %leaf ^] fox)
?: ?=(?(%n %tas) p.q.ham)
fox
[~ %leaf '%' p.u.fox]
::
{$stop *}
[%stop *]
?: (~(has in gil) [p.q.ham lum]) ~
=+ kep=(~(get by p.ham) p.q.ham)
?~ kep
~|([%stop-loss p.q.ham] !!)
$(gil (~(put in gil) [p.q.ham lum]), q.ham u.kep)
::
{$tree *}
[%tree *]
=- ?~ tok
~
[~ %rose [[' ' ~] ['{' ~] ['}' ~]] u.tok]
@ -322,7 +322,7 @@
|- ^- (unit (list tank))
?: =(~ lum)
[~ tuk]
?. ?=({n/* l/* r/*} lum)
?. ?=([n=* l=* r=*] lum)
~
=+ rol=$(lum r.lum)
?~ rol
@ -332,7 +332,7 @@
~
$(lum l.lum, tuk [u.tim u.rol])
::
{$unit *}
[%unit *]
?@ lum
?.(=(~ lum) ~ [~ %leaf '~' ~])
?. =(~ -.lum)
@ -344,17 +344,17 @@
==
::
++ doge
|= ham/cape
|= ham=cape
=- ?+ woz woz
{$list * {$mato $'ta'}} %path
{$list * {$mato $'t'}} %wall
{$list * {$mato $'tD'}} %yarn
{$list * $yarn} %wool
[%list * [%mato %'ta']] %path
[%list * [%mato %'t']] %wall
[%list * [%mato %'tD']] %yarn
[%list * %yarn] %wool
==
^= woz
^- wine
?. ?=({$stop *} q.ham)
?: ?& ?= {$bswt {$pear $n $0} {$plot {$pear $n $0} {$face *} ~} ~}
?. ?=([%stop *] q.ham)
?: ?& ?= [%bcwt [%pear %n %0] [%plot [%pear %n %0] [%face *] ~] ~]
q.ham
=(1 (met 3 p.i.t.p.i.t.p.q.ham))
==
@ -364,13 +364,13 @@
?~ may
q.ham
=+ nul=[%pear %n 0]
?. ?& ?=({$bswt *} u.may)
?=({* * ~} p.u.may)
?. ?& ?=([%bcwt *] u.may)
?=([* * ~] p.u.may)
|(=(nul i.p.u.may) =(nul i.t.p.u.may))
==
q.ham
=+ din=?:(=(nul i.p.u.may) i.t.p.u.may i.p.u.may)
?: ?& ?=({$plot {$face *} {$face * $stop *} ~} din)
?: ?& ?=([%plot [%face *] [%face * %stop *] ~] din)
=(p.q.ham p.q.i.t.p.din)
=(1 (met 3 p.i.p.din))
=(1 (met 3 p.i.t.p.din))
@ -378,10 +378,10 @@
:+ %list
(cat 3 p.i.p.din p.i.t.p.din)
q.i.p.din
?: ?& ?= $: $plot
{$face *}
{$face * $stop *}
{{$face * $stop *} ~}
?: ?& ?= $: %plot
[%face *]
[%face * %stop *]
[[%face * %stop *] ~]
==
din
=(p.q.ham p.q.i.t.p.din)
@ -403,24 +403,24 @@
=+ gil=*(set type)
=+ dex=[p=*(map type @) q=*(map @ wine)]
=< [q.p q]
|- ^- {p/{p/(map type @) q/(map @ wine)} q/wine}
|- ^- [p=[p=(map type @) q=(map @ wine)] q=wine]
=- [p.tez (doge q.p.tez q.tez)]
^= tez
^- {p/{p/(map type @) q/(map @ wine)} q/wine}
^- [p=[p=(map type @) q=(map @ wine)] q=wine]
?: (~(meet ut sut) -:!>(*type))
[dex %type]
?- sut
$noun [dex sut]
$void [dex sut]
{$atom *} [dex ?~(q.sut [%mato p.sut] [%pear p.sut u.q.sut])]
{$cell *}
%noun [dex sut]
%void [dex sut]
[%atom *] [dex ?~(q.sut [%mato p.sut] [%pear p.sut u.q.sut])]
[%cell *]
=+ hin=$(sut p.sut)
=+ yon=$(dex p.hin, sut q.sut)
:- p.yon
:- %plot
?:(?=({$plot *} q.yon) [q.hin p.q.yon] [q.hin q.yon ~])
?:(?=([%plot *] q.yon) [q.hin p.q.yon] [q.hin q.yon ~])
::
{$core *}
[%core *]
?: ?=([[%$ * [[%$ @ *] ~ ~]] ~ ~] q.r.q.sut)
=/ dad $(sut p.sut)
:- p.dad
@ -428,8 +428,8 @@
[%gate q.n.q.q.n.q.r.q.sut sut(r.p.q %gold) q.dad]
=+ yad=$(sut p.sut)
:- p.yad
=+ ^= doy ^- {p/(list @ta) q/wine}
?: ?=({$core *} q.yad)
=+ ^= doy ^- [p=(list @ta) q=wine]
?: ?=([%core *] q.yad)
[p.q.yad q.q.yad]
[~ q.yad]
:- %core
@ -441,7 +441,7 @@
%- ~(rep by (~(run by q.r.q.sut) |=(tome ~(wyt by q.+<))))
|=([[@ a=@u] b=@u] (add a b))
%^ cat 3
?-(r.p.q.sut $gold '.', $iron '|', $lead '?', $zinc '&')
?-(r.p.q.sut %gold '.', %iron '|', %lead '?', %zinc '&')
=+ gum=(mug q.r.q.sut)
%+ can 3
:~ [1 (add 'a' (mod gum 26))]
@ -449,24 +449,24 @@
[1 (add 'a' (mod (div gum 676) 26))]
==
::
{$hint *}
[%hint *]
$(sut q.sut)
::
{$face *}
[%face *]
=+ yad=$(sut q.sut)
?^(p.sut yad [p.yad [%face p.sut q.yad]])
::
{$fork *}
[%fork *]
=+ yed=(sort ~(tap in p.sut) aor)
=- [p [%bswt q]]
|- ^- {p/{p/(map type @) q/(map @ wine)} q/(list wine)}
=- [p [%bcwt q]]
|- ^- [p=[p=(map type @) q=(map @ wine)] q=(list wine)]
?~ yed
[dex ~]
=+ mor=$(yed t.yed)
=+ dis=^$(dex p.mor, sut i.yed)
[p.dis q.dis q.mor]
::
{$hold *}
[%hold *]
=+ hey=(~(get by p.dex) sut)
?^ hey
[dex [%stop u.hey]]

View File

@ -197,10 +197,6 @@
"""
$\{1:iron-core}
"""
:- '^%'
"""
$\{1:body}
"""
:- '^.'
"""
$\{1:a}

View File

@ -48,7 +48,7 @@
::
++ nu
|= jon=json
?> ?=({$s *} jon)
?> ?=([%s *] jon)
(rash p.jon hex)
::
++ metadata

View File

@ -45,19 +45,19 @@
/lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
|%
++ ins ::~/ %ins :: parse prefix
|= a/@tas
|= a=@tas
=+ b=0
|- ^- (unit @)
?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
++ ind ::~/ %ind :: parse suffix
|= a/@tas
|= a=@tas
=+ b=0
|- ^- (unit @)
?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
++ tos ::~/ %tos :: fetch prefix
|=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
|=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
++ tod ::~/ %tod :: fetch suffix
|=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
|=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
--
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eL, formatting (path) ::
@ -66,11 +66,11 @@
|%
++ hif (boss 256 ;~(plug tip tiq (easy ~)))
++ huf %+ cook
|=({a/@ b/@} (wred:un ~(zug mu ~(zag mu [a b]))))
|=([a=@ b=@] (wred:un ~(zug mu ~(zag mu [a b]))))
;~(plug hif ;~(pfix hep hif))
++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~)))
++ tip (sear |=(a/@ (ins:po a)) til)
++ tiq (sear |=(a/@ (ind:po a)) til)
++ tip (sear |=(a=@ (ins:po a)) til)
++ tiq (sear |=(a=@ (ind:po a)) til)
++ til (boss 256 (stun [3 3] low))
--
++ ag
@ -87,7 +87,7 @@
--
::
++ mu
|_ {top/@ bot/@}
|_ [top=@ bot=@]
++ zag [p=(end 4 1 (add top bot)) q=bot]
++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
++ zug (mix (lsh 4 1 top) bot)
@ -98,16 +98,16 @@
++ un :: =(x (wred (wren x)))
|%
++ wren :: conceal structure
|= pyn/@ ^- @
|= pyn=@ ^- @
=+ len=(met 3 pyn)
?: =(0 len)
0
=> .(len (dec len))
=+ mig=(zaft (xafo len (cut 3 [len 1] pyn)))
%+ can 3
%- flop ^- (list {@ @})
%- flop ^- (list [@ @])
:- [1 mig]
|- ^- (list {@ @})
|- ^- (list [@ @])
?: =(0 len)
~
=> .(len (dec len))
@ -115,27 +115,27 @@
[[1 mog] $(mig mog)]
::
++ wred :: restore structure
|= cry/@ ^- @
|= cry=@ ^- @
=+ len=(met 3 cry)
?: =(0 len)
0
=> .(len (dec len))
=+ mig=(cut 3 [len 1] cry)
%+ can 3
%- flop ^- (list {@ @})
%- flop ^- (list [@ @])
:- [1 (xaro len (zart mig))]
|- ^- (list {@ @})
|- ^- (list [@ @])
?: =(0 len)
~
=> .(len (dec len))
=+ mog=(cut 3 [len 1] cry)
[[1 :(mix mig (end 3 1 len) (zyrt mog))] $(mig mog)]
::
++ xafo |=({a/@ b/@} +((mod (add (dec b) a) 255)))
++ xaro |=({a/@ b/@} +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
++ xafo |=([a=@ b=@] +((mod (add (dec b) a) 255)))
++ xaro |=([a=@ b=@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
::
++ zaft :: forward 255-sbox
|= a/@D
|= a=@D
=+ ^= b
0xcc.75bc.86c8.2fb1.9a42.f0b3.79a0.92ca.21f6.1e41.cde5.fcc0.
7e85.51ae.1005.c72d.1246.07e8.7c64.a914.8d69.d9f4.59c2.8038.
@ -151,7 +151,7 @@
(cut 3 [(dec a) 1] b)
::
++ zart :: reverse 255-sbox
|= a/@D
|= a=@D
=+ ^= b
0x68.4f07.ea1c.73c9.75c2.efc8.d559.5125.f621.a7a8.8591.5613.
dd52.40eb.65a2.60b7.4bcb.1123.ceb0.1bd6.3c84.2906.b164.19b3.
@ -167,7 +167,7 @@
(cut 3 [(dec a) 1] b)
::
++ zyft :: forward 256-sbox
|= a/@D
|= a=@D
=+ ^= b
0xbb49.b71f.b881.b402.17e4.6b86.69b5.1647.115f.dddb.7ca5.
8371.4bd5.19a9.b092.605d.0d9b.e030.a0cc.78ba.5706.4d2d.
@ -184,7 +184,7 @@
(cut 3 [a 1] b)
::
++ zyrt :: reverse 256-sbox
|= a/@D
|= a=@D
=+ ^= b
0x9fc8.2753.6e02.8fcf.8b35.2b20.5598.7caa.c9a9.30b0.9b48.
47ce.6371.80f6.407d.00dd.0aa5.ed10.ecb7.0f5a.5c3a.e605.

View File

@ -12,6 +12,7 @@
+$ unix-event
%+ pair wire
$% [%wack p=@]
[%what p=(list (pair path (cask)))]
[%whom p=ship]
[%boot ? $%($>(%fake task:able:jael) $>(%dawn task:able:jael))]
unix-task
@ -60,14 +61,14 @@
%. directories
|= :: sal: all spurs to load from
::
sal/(list spur)
sal=(list spur)
^- unix-event
::
:: hav: all user files
::
=; hav ~& user-files+(lent hav)
[[%$ %sync ~] [%into %$ & hav]]
=| hav/mode:clay
[/c/sync [%into %$ & hav]]
=| hav=mode:clay
|- ^+ hav
?~ sal ~
=. hav $(sal t.sal)
@ -87,7 +88,7 @@
=? hav ?=(^ fil.lon)
:: XX this whitelist needs to be reviewed
::
?. ?= ?($css $hoon $html $js $json $md $png $txt $udon $umd)
?. ?= ?(%css %hoon %html %js %json %md %png %txt %udon %umd)
-.tyl
::
:: install only files with whitelisted marks
@ -100,11 +101,11 @@
=; cot [[(flop `path`tyl) `[/text/plain cot]] hav]
^- octs
?- tyl
{$json *}
[%json *]
=/ dat .^(json %cx pax)
(as-octt:mimes:html (en-json:html dat))
::
{$txt *}
[%txt *]
=/ dat .^(wain %cx pax)
(as-octs:mimes:html (of-wain:format dat))
::
@ -116,4 +117,47 @@
|- ^- mode:clay
?~ all hav
$(all t.all, hav ^$(tyl [p.i.all tyl]))
::
:: +file-ovum2: electric boogaloo
::
++ file-ovum2 |=(p=path `unix-event`[//arvo what/(user-files p)])
::
:: +user-files: all userspace hoon files
::
++ user-files
|= bas=path
%. directories:file-ovum
|= sal=(list spur)
^- (list (pair path (cask)))
::
:: hav: all user files
::
=| hav=(list (pair path (cask)))
|- ^+ hav
?~ sal ~
=. hav $(sal t.sal)
::
:: tyl: spur
::
=/ tyl i.sal
|- ^+ hav
::
:: pax: full path at `tyl`
:: lon: directory at `tyl`
::
=/ pax (weld bas (flop tyl))
=/ lon .^(arch %cy pax)
=? hav ?=(^ fil.lon)
::
:: install only hoon files for now
::
?. ?=([%hoon *] tyl)
hav
:_ hav
[(flop `path`t.tyl) hoon/.^(@t %cx pax)]
::
=/ all ~(tap by dir.lon)
|- ^+ hav
?~ all hav
$(all t.all, hav ^$(tyl [p.i.all tyl]))
--

420
pkg/arvo/lib/plume.hoon Normal file
View File

@ -0,0 +1,420 @@
/- *plum
::
:: This library includes `plume`, the actual pretty printing logic,
:: and a handful of utilities for constructing plums.
::
:: Generally, you'll just use `plume` like this:
::
:: ~(tall plume plum) :: Pretty print `plum` in tall mode.
:: ~(flat plume plum) :: Pretty print `plum` in wide mode.
::
:: There is probably no reason to look at the utility routines unless
:: you are writing something to generate `plum`s.
::
:: This is the pretty-printer. Use the `flat` arm to render a plum
:: into a single line and use the `tall` arm to get a nice multi-line
:: rendering that switches to wide mode if there's enough space.
::
:: For details about how this works and what exactly it does in various
:: cases, take a look at the docs for `plum`, `plumfmt`, and at the
:: docs on the arms of this door.
::
^? |%
++ plume
|_ =plum
::
:: An line, indented by `indent` spaces.
::
+$ line [indent=@ud text=tape]
::
:: An sequence of indented lines.
::
+$ block (list line)
::
:: +flat: print as a single line
::
++ flat
^- wain
text:linear
::
:: +tall: print as multiple lines
::
++ tall
^- wain
%+ turn window
|= line
(crip (runt [indent ' '] text))
::
:: +adjust: adjust lines to right
::
++ adjust
|= [tab=@ud =block] ^- ^block
(turn block |=([@ud tape] [(add tab +<-) +<+]))
::
:: Prepend `n` spaces to a tape.
::
++ prepend-spaces
|= [n=@ t=tape] ^- tape
(runt [n ' '] t)
::
:: +window: print as list of tabbed lines
::
++ window
^- block
~+ :: for random access
?@ plum [0 (trip plum)]~ :: trivial text
?- -.plum
::
:: %para: Line-wrappable paragraph. This is a stub; it should
:: wrap text to 40 characters.
::
%para
[0 +:linear]~
::
:: %sbrk: nested subexpression
::
:: This is an opportunity to switch to wide mode. First, try
:: rendered in wide mode. If that's possible and the result
:: isn't too big, use that. Otherwise recurse into the subplum
:: without switching to wide mode.
::
%sbrk
=/ sub kid.plum
?+ sub
window(plum sub)
[%tree *]
=/ wideresult
?~(wide.fmt.sub ~ [~ u=linear])
?: ?&(?=(^ wideresult) (lte length.u.wideresult 40))
[0 text.u.wideresult]~
window(plum sub)
==
::
:: %tree: Try to render a text tree in tall mode.
::
:: We want to render this in tall mode. First, verify that there
:: the plum has a tall render (if not, fall back to `linear`
:: formatting), then render all the subplums, and then render
:: them in one of three ways:
::
:: - If the `plumfmt` contains an `indef` and that indef has
:: no prefix, then this is a variable-arity rune with a
:: terminator: Use vertical formatting.
::
:: - If the `plumfmt` contains an `indef` and that indef DOES have
:: a prefix, then this is something that looks like a core: Use
:: `core-like` formatting.
::
:: - Otherwise, this is a rune with a fixed number of arguments
:: Render the subplums using backstep indentation.
::
:: There's also a special case where something has exactly one sub-plum.
:: where something has exactly one sub-block. For example, we
:: want this output:
::
:: |-
:: foo
::
%tree
?~ tall.fmt.plum [0 text:linear]~
=/ prelude (trip intro.u.tall.fmt.plum)
|^ =/ blocks (turn kids.plum |=(=^plum window(plum plum)))
=/ prelude (trip intro.u.tall.fmt.plum)
?~ indef.u.tall.fmt.plum
?: =(1 (lent blocks))
[[0 prelude] (zing blocks)]
(backstep prelude blocks)
=/ prefix (trip sigil.u.indef.u.tall.fmt.plum)
=/ finale (trip final.u.indef.u.tall.fmt.plum)
?~ blocks %+ weld
?~(prelude ~ [0 prelude]~)
?~(finale ~ [0 finale]~)
?~ prefix (running prelude blocks finale)
(core-like prelude prefix blocks finale)
--
==
::
:: Render a plum in tall-mode using backstep indentation. Here,
:: we are rendering things that look something like this:
::
:: :+ foo
:: bar
:: baz
::
++ backstep
|= [prelude=tape blocks=(list block)]
^- block
%- zing
=/ nkids (lent blocks)
=/ idx 1
|- ^- (list block)
?~ blocks ~
:_ $(blocks t.blocks, idx +(idx))
^- block
=/ indent (mul 2 (sub nkids idx))
?. =(1 idx) (adjust indent i.blocks)
(rune-inline-with-block prelude indent i.blocks)
::
:: To make things look a bit nicer, we want to put the first
:: sub-block on the same line as the rune. We want this:
::
:: :- foo
:: baz
::
:: Instead of this:
::
:: :-
:: foo
:: baz
::
:: This handles the "foo" case.
::
++ rune-inline-with-block
|= [rune=tape indent=@ blk=block]
^- block
=. indent (max indent (add 2 (lent rune)))
=. blk (adjust indent blk)
?~ rune blk
?~ blk [0 rune]~
:_ t.blk
:- 0
%+ weld rune
=/ spaces-btwn (sub indent.i.blk (lent rune))
(prepend-spaces spaces-btwn text.i.blk)
::
:: Render a tall hoon with running indentation. Here, we are
:: rendering things that look sopmething like:
::
:: :~ foo
:: bar
:: baz
:: ==
::
:: So, there's basically three cases here: Either the prelude
:: is a rune, the prelude is empty, or prelude is some other
:: random-ass thing.
::
:: - If there is no prelude, then just combine all of the
:: sub-blocks together unaltered.
:: - If it's a rune (two-characters wide), then combine the
:: rune and the first line into one line (separated by two
:: spaces) and indent the rest of the lines by four spaces.
:: - If the rune is some other random-ass thing (has a length
:: that isn't 0 or 2), then render the prelude alone on the
:: first line and then combine the sub-blocks together,
:: all indented by another two spaces.
::
:: Regardless, if there's a finale, stick it on the end without
:: any indentation.
::
++ running
|= [prelude=tape blocks=(list block) finale=tape]
^- block
=/ result=block (zing blocks)
=. result
?+ (lent prelude)
[[0 prelude] (adjust 2 result)] :: unusual prelude
%0 :: empty prelude
result
%2 :: rune prelude
(rune-inline-with-block prelude 4 result)
==
?~ finale result
(snoc result [0 finale])
::
:: This renders sub-blocks where each sub-block needs to be
:: prefixed by some tape. For example:
::
:: |%
:: ++ foo
:: bar
:: ++ baz
:: qux
:: --
::
++ core-like
|= [prelude=tape prefix=tape blocks=(list block) finale=tape]
^- block
=/ clear (add 2 (lent prefix))
=/ result
^- block
%- zing
^- (list block)
%+ turn blocks
|= blk=block
^- block
^+ +<
=* tab ?~(blk 0 (sub clear (min clear indent.i.blk)))
=. blk (adjust tab blk)
?~ blk ~
:_ t.blk
:- 0
%+ weld prefix
(runt [(sub indent.i.blk (lent prefix)) ' '] text.i.blk)
=. result
?~ finale result
(snoc result [0 finale])
?~ prelude result
[[0 prelude] result]
::
:: +linear: Render a plum onto a single line, even if it only has a
:: wide form.
::
++ linear
^- [length=@ud text=tape]
~+ :: ~+ for random access
?@ plum [(met 3 plum) (trip plum)] :: Just a cord.
?- -.plum
::
:: This is already in wide mode, so %sbrk nodes don't matter here.
::
%sbrk
linear(plum kid.plum)
::
:: %para: To write a wrappable text paragraph to a single line,
:: we just combine all the lines into one, interspersing single
:: spaces chars.
::
%para
|- ^- [length=@ud text=tape]
?~ lines.plum [0 ~]
=/ next $(lines.plum t.lines.plum)
=/ this [length=(met 3 i.lines.plum) text=(trip i.lines.plum)]
:- (add +(length.this) length.next)
(weld text.this `tape`[' ' text.next])
::
:: Render a text tree to a single line.
::
%tree
|^ ^- [length=@ud text=tape]
?~ wide.fmt.plum (force-wide window)
=/ body (render-body delimit.u.wide.fmt.plum kids.plum)
?~ enclose.u.wide.fmt.plum body
(wrap-with-enclose u.enclose.u.wide.fmt.plum body)
::
:: Given a list of subplums and a delimiter, render all the
:: subplums onto a single line, and combine them into a single
:: string by interspersing the delimiter.
::
++ render-body
|= [delimit=cord kids=(list ^plum)]
=/ stop (trip delimit)
|- ^- [length=@ud text=tape]
?~ kids [0 ~]
=/ next $(kids t.kids)
=/ this linear(plum i.kids)
?~ text.next this
:- :(add length.this (lent stop) length.next)
:(weld text.this stop text.next)
::
:: Wrap a wide-form-rendered result with the `enclose` cords
:: from its `plumefmt`.
::
++ wrap-with-enclose
|= [clamps=(pair cord cord) body=[length=@ text=tape]]
^- [length=@ud text=tape]
::
=/ close [(trip -.clamps) (trip +.clamps)]
:- :(add length.body (lent -.close) (lent +.close))
:(weld -.close text.body +.close)
::
:: Given the result of rendering a plum in tall form, combine
:: all the lines into one by separating each by two spaces.
::
++ force-wide
|= render=(list [@ud text=tape])
^- [length=@ud text=tape]
::
?~ render [0 ~]
=/ next (force-wide t.render)
:- :(add (lent text.i.render) 2 length.next)
?~(text.next text.i.render :(weld text.i.render " " text.next))
--
==
--
::
:: Convenience function to build a `plumfmt` for a rune with a fixed
:: number of parameters.
::
++ fixed
|= rune=@ta
^- plumfmt
[wide=`[' ' `[(cat 3 +< '(') ')']] tall=`[+< ~]]
::
:: Same as `fixed` but only outputs in `tall` mode.
::
++ tall-fixed
|= rune=cord
^- (unit [cord (unit [cord cord])])
`[rune ~]
::
:: Convenience function to build a the `tall` part of a `plumfmt` for
:: a running-style rune (one that takes a variable number of parameters
:: and has a terminator).
::
++ tall-running
|= [rune=cord sigil=cord term=cord]
^- (unit [cord (unit [cord cord])])
`[rune `[sigil term]]
::
:: Convenience function for rendering a rune into a plum. This takes
:: a rune, an optional tall-form terminator, optionally a short-form (if
:: you don't supply a short-form, it'll just construct the standard
:: wide-form (e.g. "?~(x x ~)") for you, and a list of sub-plums.
::
++ rune
|= $: rune=cord
term=(unit cord)
short=(unit [cord cord cord])
kids=(list plum)
==
^. plum
|^ :- %sbrk
:+ %tree
:- (rune-wide-form rune short)
?~ term (tall-fixed rune)
(tall-running rune '' u.term)
kids
::
:: If you just give this a rune, it'll build the standard wide-form.
:: Otherwise, it'll just use the one that you gave it.
::
++ rune-wide-form
|= [rune=cord short=(unit [fst=cord mid=cord lst=cord])]
^- (unit (pair cord (unit [cord cord])))
=* fst (cat 3 rune '(')
=* std `[' ' `[fst ')']]
?~ short std
`[mid.u.short `[fst.u.short lst.u.short]]
--
::
:: Just a helper function for constructing a wide-form %tree plum.
::
++ simple-wide
|= [init=cord sep=cord end=cord kids=(list plum)]
^- plum
=/ fmt=plumfmt [wide=[~ sep [~ init end]] tall=~]
[%tree fmt kids]
::
:: Convenience function that builds a plum for a subexpression. The
:: `%sbrk` tells the pretty-printer that this is a valid place to
:: switch from tall mode to wide mode.
::
++ subtree
|= [p=plumfmt q=(list plum)]
^- plum
[%sbrk [%tree p q]]
::
:: Convenience for generating plums that look like s-expressions. Useful
:: for quickly getting decent-looking debug output.
::
++ sexp
|= [sym=cord kids=(list plum)]
^- plum
=/ head=cord (cat 3 '(' sym)
=/ headspc=cord (cat 3 head ' ')
=/ symcol=cord (cat 3 sym ':')
=/ fmt=plumfmt [[~ ' ' [~ headspc ')']] [~ symcol [~ '' '']]]
?~ kids (cat 3 '(' (cat 3 sym ')'))
[%sbrk [%tree fmt kids]]
--

View File

@ -1,4 +1,6 @@
/+ libxray=xray
/- *plum, *xray
/+ *plume,
libxray=xray
::
:: This code pretty-prints a variety of things using the `xray` and
:: `plum` libraries:
@ -117,14 +119,18 @@
++ type-to-tank
|= t=type
^- tank
[%plum (type-to-plum t)]
:+ %rose [~ ~ ~]
%+ turn (render-type t)
|=(=cord leaf+(trip cord))
::
:: Pretty-print a vase to a tank.
::
++ vase-to-tank
|= v=vase
^- tank
[%plum (vase-to-plum v)]
:+ %rose [~ ~ ~]
%+ turn (render-vase v)
|=(=cord leaf+(trip cord))
::
:: Render an `axis`.
::
@ -151,7 +157,7 @@
limb
?- -.limb
%& (axis-to-cord p.limb)
:: {%| p/@ud q/(unit term) ]
:: [%| p=@ud q=(unit term) ]
%| (crip (runt [0 p.limb] ?~(q.limb "," (trip u.q.limb))))
==
::
@ -340,7 +346,7 @@
[%brsg *] (rune '|~' ~ ~ (spec p.x) (hn q.x) ~)
[%brtr *] (rune '|*' ~ ~ (spec p.x) (hn q.x) ~)
[%brts *] (rune '|=' ~ ~ (spec p.x) (hn q.x) ~)
[%brvt *] (chapter '|@' ~ q.x) :: Ignoring p.x
[%brpt *] (chapter '|@' ~ q.x) :: Ignoring p.x
[%brwt *] (rune '|?' ~ ~ (hn p.x) ~)
[%clcb *] (rune ':_' ~ ~ (hoons ~[p q]:x))
[%clkt *] (rune ':^' ~ ~ (hoons ~[p q r s]:x))
@ -366,11 +372,10 @@
[%dtts *] (rune '.=' ~ `['=(' spc ')'] (hoons ~[p q]:x))
[%dtwt *] (rune '.?' ~ ~ (hoons ~[p.x]))
[%ktbr *] (rune '^|' ~ ~ (hoons ~[p.x]))
[%ktcn *] (rune '^%' ~ ~ (hoons ~[p]:x))
[%ktdt *] (rune '^.' ~ ~ (hoons ~[p q]:x))
[%ktls *] (rune '^+' ~ ~ (hoons ~[p q]:x))
[%kthp *] (rune '^-' ~ ~ ~[(spec p.x) (hn q.x)])
[%ktpd *] (rune '^&' ~ ~ (hoons ~[p]:x))
[%ktpm *] (rune '^&' ~ ~ (hoons ~[p]:x))
[%ktsg *] (rune '^~' ~ ~ (hoons ~[p]:x))
[%ktts *] (rune '^=' ~ `['' '=' ''] ~[(skin p.x) (hn q.x)])
[%ktwt *] (rune '^?' ~ ~ (hoons ~[p]:x))
@ -379,56 +384,58 @@
[%sgbr *] (rune '~|' ~ ~ (hoons ~[p q]:x))
[%sgcb *] (rune '~_' ~ ~ (hoons ~[p q]:x))
[%sgcn *] (rune '~%' ~ ~ (chum p.x) (hn q.x) (tyre r.x) (hn s.x) ~)
[%sgnt *] (rune '~/' ~ ~ (chum p.x) (hn q.x) ~)
[%sgld *] (rune '~<' ~ ~ (hint p.x) (hn q.x) ~)
[%sgbn *] (rune '~>' ~ ~ (hint p.x) (hn q.x) ~)
[%sgbs *] (rune '~$' ~ ~ p.x (hn q.x) ~)
[%sgfs *] (rune '~/' ~ ~ (chum p.x) (hn q.x) ~)
[%sggl *] (rune '~<' ~ ~ (hint p.x) (hn q.x) ~)
[%sggr *] (rune '~>' ~ ~ (hint p.x) (hn q.x) ~)
[%sgbc *] (rune '~$' ~ ~ p.x (hn q.x) ~)
[%sgls *] (rune '~+' ~ ~ (hn q.x) ~) :: Ignoring p.x
[%sgpd *] (rune '~&' ~ ~ (hoons ~[q r]:x)) :: Ignoring p.x
[%sgpm *] (rune '~&' ~ ~ (hoons ~[q r]:x)) :: Ignoring p.x
[%sgts *] (rune '~=' ~ ~ (hoons ~[p q]:x))
[%sgwt *] (rune '~?' ~ ~ (hoons ~[q r s]:x)) :: Ignoring p.x
[%sgzp *] (rune '~!' ~ ~ (hoons ~[p q]:x))
[%mcts *] %ast-node-mcts
[%mccl *] (rune ';:' `'==' `[':(' spc ')'] (hoons [p q]:x))
[%mcnt *] (rune ';/' ~ ~ (hoons ~[p]:x))
[%mcfs *] (rune ';/' ~ ~ (hoons ~[p]:x))
[%mcgl *] (rune ';<' ~ ~ (spec p.x) (hoons ~[q r s]:x))
[%mcsg *] (rune ';~' `'==' ~ (hoons [p q]:x))
[%mcmc *] (rune ';;' ~ ~ ~[(spec p.x) (hn q.x)])
[%tsbr *] (rune '=|' ~ ~ ~[(spec p.x) (hn q.x)])
[%tscl *] (tiscol-to-plum p.x q.x)
[%tsnt *] (rune '=/' ~ ~ (skin p.x) (hn q.x) (hn r.x) ~)
[%tsfs *] (rune '=/' ~ ~ (skin p.x) (hn q.x) (hn r.x) ~)
[%tsmc *] (rune '=;' ~ ~ [(skin p.x) (hoons ~[q r]:x)])
[%tsdt *] (rune '=.' ~ ~ [(wing p.x) (hoons ~[q r]:x)])
[%tswt *] (rune '=?' ~ ~ [(wing p.x) (hoons ~[q r s]:x)])
[%tsld *] (rune '=>' ~ `['' ':' ''] (hoons ~[p q]:x))
:: XX %tsld to %tsgl, but should be %tsgr? (to match =>)
[%tsgl *] (rune '=>' ~ `['' ':' ''] (hoons ~[p q]:x))
[%tshp *] (rune '=-' ~ ~ (hoons ~[p q]:x))
[%tsbn *] (rune '=<' ~ ~ (hoons ~[p q]:x))
:: XX %tsbn to %tsgr, but should be %tsgl? (to match =<)
[%tsgr *] (rune '=<' ~ ~ (hoons ~[p q]:x))
[%tskt *] (rune '=^' ~ ~ [(skin p.x) (wing q.x) (hoons ~[r s]:x)])
[%tsls *] (rune '=+' ~ ~ (hoons ~[p q]:x))
[%tssg *] (rune '=~' `'==' ~ (hoons p:x))
[%tstr *] ?~ q.p.x
(rune '=*' ~ ~ p.p.x (hoons ~[q r]:x))
(rune '=*' ~ ~ (spec [%bsts p.p.x u.q.p.x]) (hoons ~[q r]:x))
(rune '=*' ~ ~ (spec [%bcts p.p.x u.q.p.x]) (hoons ~[q r]:x))
[%tscm *] (rune '=,' ~ ~ (hoons ~[p q]:x))
[%wtbr *] (rune '?|' `'--' `['|(' ' ' ')'] (hoons p:x))
[%wthp *] (rune '?-' `'==' ~ (wing p.x) (matches q.x))
[%wtcl *] (rune '?:' ~ ~ (hoons ~[p q r]:x))
[%wtdt *] (rune '?.' ~ ~ (hoons ~[p q r]:x))
[%wtkt *] (rune '?^' ~ ~ [(wing p.x) (hoons ~[q r]:x)])
[%wtld *] (rune '?<' ~ ~ (hoons ~[p q]:x))
[%wtbn *] (rune '?>' ~ ~ (hoons ~[p q]:x))
[%wtgl *] (rune '?<' ~ ~ (hoons ~[p q]:x))
[%wtgr *] (rune '?>' ~ ~ (hoons ~[p q]:x))
[%wtls *] (rune '?+' `'==' ~ (wing p.x) (hn q.x) (matches r.x))
[%wtpd *] (rune '?&' `'==' `['&(' ' ' ')'] (hoons p:x))
[%wtvt *] (rune '?@' ~ ~ (wing p.x) (hoons ~[q r]:x))
[%wtpm *] (rune '?&' `'==' `['&(' ' ' ')'] (hoons p:x))
[%wtpt *] (rune '?@' ~ ~ (wing p.x) (hoons ~[q r]:x))
[%wtsg *] (rune '?~' ~ ~ (wing p.x) (hoons ~[q r]:x))
[%wthx *] (rune '?#' ~ ~ (skin p.x) (wing q.x) ~)
[%wtts *] (rune '?=' ~ ~ (spec p.x) (wing q.x) ~)
[%wtzp *] (rune '?!' ~ `['!' '' ''] (hoons ~[p]:x))
[%zpcm *] (rune '!,' ~ ~ (hoons ~[p q]:x))
[%zpbn *] (rune '!>' ~ ~ (hoons ~[p]:x))
[%zpgr *] (rune '!>' ~ ~ (hoons ~[p]:x))
[%zpmc *] (rune '!;' ~ ~ (hoons ~[p q]:x))
[%zpts *] (rune '!=' ~ ~ (hoons ~[p]:x))
[%zpvt *] (rune '!@' ~ ~ (wingseq p.x) (hoons ~[q r]:x))
[%zppt *] (rune '!@' ~ ~ (wingseq p.x) (hoons ~[q r]:x))
[%zpwt *] (hn q.x) :: Ignore p.x
[%zpzp ~] '!!'
==
@ -642,37 +649,37 @@
?: =(- 3) '%^'
?: =(- 2) '%+' '%-'
[(dohoon p.spec) (turn q.spec ..$)]
%bsbs (core-spec-to-plum '$$' p.spec q.spec)
%bsbr (subtree (fixed '$|') $(spec p.spec) (dohoon q.spec) ~)
%bscb (dohoon p.spec)
%bscl :- %sbrk
%bcbc (core-spec-to-plum '$$' p.spec q.spec)
%bcbr (subtree (fixed '$|') $(spec p.spec) (dohoon q.spec) ~)
%bccb (dohoon p.spec)
%bccl :- %sbrk
:+ %tree
[`[' ' `['[' ']']] `['$:' `['' '==']]]
(turn `(list ^spec)`+.spec ..$)
%bscn (subtree (varying '$%' '==') (turn `(list ^spec)`+.spec ..$))
%bsdt (core-spec-to-plum '$.' p.spec q.spec)
%bsld (subtree (fixed '$<') $(spec p.spec) $(spec q.spec) ~)
%bsbn (subtree (fixed '$>') $(spec p.spec) $(spec q.spec) ~)
%bshp (subtree (fixed '$-') $(spec p.spec) $(spec q.spec) ~)
%bskt (subtree (fixed '$^') $(spec p.spec) $(spec q.spec) ~)
%bsls (subtree (fixed '$+') (stud-to-plum p.spec) $(spec q.spec) ~)
%bsnt (core-spec-to-plum '$/' p.spec q.spec)
%bsmc (subtree (fixed '$;') (dohoon p.spec) ~)
%bspd (subtree (fixed '$&') $(spec p.spec) (dohoon q.spec) ~)
%bssg (subtree (fixed '$~') (dohoon p.spec) $(spec q.spec) ~)
%bstc (core-spec-to-plum '$`' p.spec q.spec)
%bsts :- %sbrk
%bccn (subtree (varying '$%' '==') (turn `(list ^spec)`+.spec ..$))
%bcdt (core-spec-to-plum '$.' p.spec q.spec)
%bcgl (subtree (fixed '$<') $(spec p.spec) $(spec q.spec) ~)
%bcgr (subtree (fixed '$>') $(spec p.spec) $(spec q.spec) ~)
%bchp (subtree (fixed '$-') $(spec p.spec) $(spec q.spec) ~)
%bckt (subtree (fixed '$^') $(spec p.spec) $(spec q.spec) ~)
%bcls (subtree (fixed '$+') (stud-to-plum p.spec) $(spec q.spec) ~)
%bcfs (core-spec-to-plum '$/' p.spec q.spec)
%bcmc (subtree (fixed '$;') (dohoon p.spec) ~)
%bcpm (subtree (fixed '$&') $(spec p.spec) (dohoon q.spec) ~)
%bcsg (subtree (fixed '$~') (dohoon p.spec) $(spec q.spec) ~)
%bctc (core-spec-to-plum '$`' p.spec q.spec)
%bcts :- %sbrk
:+ %tree
[`['=' ~] `['$=' ~]]
:~ (skin-to-plum p.spec)
$(spec q.spec)
==
%bsvt (subtree (fixed '$@') $(spec p.spec) $(spec q.spec) ~)
%bswt :- %sbrk
%bcpt (subtree (fixed '$@') $(spec p.spec) $(spec q.spec) ~)
%bcwt :- %sbrk
:+ %tree
[`[' ' `['?(' ')']] `['$?' `['' '==']]]
(turn `(list ^spec)`+.spec ..$)
%bszp (core-spec-to-plum '$.' p.spec q.spec)
%bczp (core-spec-to-plum '$.' p.spec q.spec)
==
::
++ varying
@ -850,7 +857,7 @@
|= [=sample=xkey =product=xkey]
^- plum
%- spec-to-plum :*
%bshp
%bchp
(ximage-to-spec:libxray sample-xkey img)
(ximage-to-spec:libxray product-xkey img)
==

View File

@ -7,24 +7,24 @@
=< pretty-file
|%
++ pretty-noun
|= pri/* ^- tank
|= pri=* ^- tank
?~ pri
leaf+"~"
?@ pri
leaf+?:(((sane %tas) pri) <`@tas`pri> <pri>)
=< rose+[" " ?:(- "~[" "[") "]"]^+
|- ^- {? (list tank)}
|- ^- [? (list tank)]
?~ +.pri
[& ^$(pri -.pri) ~]
?@ +.pri
[| ^$(pri -.pri) ^$(pri +.pri) ~]
[+< - +>]:[^$(pri -.pri) $(pri +.pri)]
::
++ vale-cord |=(a/cord `?`(levy (trip a) |=(b/@ |((gte b 32) =(10 b)))))
++ vale-cord |=(a=cord `?`(levy (trip a) |=(b=@ |((gte b 32) =(10 b)))))
::
++ wain-to-tang |=(a/wain (turn a |=(b/cord leaf+(trip b))))
++ wain-to-tang |=(a=wain (turn a |=(b=cord leaf+(trip b))))
++ pretty-file
|= fyl/* ^- tang
|= fyl=* ^- tang
=+ `(unit wain)`?@(fyl `(to-wain:format fyl) ((soft wain) fyl))
?^ - (wain-to-tang u)
[(pretty-noun fyl)]~

View File

@ -5,7 +5,7 @@
|%
:: +key:rsa: rsa public or private key
::
+= key
+$ key
$: :: pub: public parameters (n=modulus, e=pub-exponent)
::
pub=[n=@ux e=@ux]
@ -39,7 +39,7 @@
=/ e :(con 1 (lsh 0 (dec a) 1) (~(raw og c) a))
:: XX what algorithm is this modular remainder check?
::
?: ?& (levy b |=(f/@ !=(1 (mod e f))))
?: ?& (levy b |=(f=@ !=(1 (mod e f))))
(pram:number e)
==
e

View File

@ -319,7 +319,7 @@
:: +seed-to-private-key-scalar: keyfile form to scalar we can multiply with
::
++ seed-to-private-key-scalar
|= sk/@I ^- @udscalar
|= sk=@I ^- @udscalar
?: (gth (met 3 sk) 32) !!
=+ h=(shal (rsh 0 3 b:ed:crypto) sk)
%+ add

View File

@ -3,20 +3,20 @@
:::: /hoon/show-dir/lib
::
/? 310
|= {vane/?($g $c) pax/path des/(map @t ~)}
|= [vane=?(%g %c) 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/knot leaf+(trip a)))
|- ^- {dir/? paf/path}
(turn paf |=(a=knot leaf+(trip a)))
|- ^- [dir=? paf=path]
=+ arf=.^(arch (cat 3 vane %y) (weld pax paf))
?^ fil.arf
[| paf]
?~ dir.arf
[& paf] :: !!
?. ?=({^ ~ ~} dir.arf)
?. ?=([^ ~ ~] dir.arf)
[& paf]
$(paf (welp paf /[p.n.dir.arf]))

View File

@ -8,17 +8,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)
==
::
::::
@ -31,43 +31,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)
::
@ -79,25 +79,25 @@
:: =(+> (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]]
!!
@ -110,8 +110,8 @@
[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)
@ -120,20 +120,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
--

View File

@ -39,17 +39,17 @@
=, enjs:format
?+ -.sef
~|(unsupported-effect+-.sef !!)
$mor [%a (turn p.sef |=(a/sole-effect ^$(sef a)))]
$err (frond %hop (numb p.sef))
$txt (frond %txt (tape p.sef))
$tan (frond %tan (tape (wush 160 p.sef)))
$det (frond %det json:~(grow mar-sole-change +.sef))
%mor [%a (turn p.sef |=(a=sole-effect ^$(sef a)))]
%err (frond %hop (numb p.sef))
%txt (frond %txt (tape p.sef))
%tan (frond %tan (tape (wush 160 p.sef)))
%det (frond %det json:~(grow mar-sole-change +.sef))
::
$pro
%pro
%+ frond %pro
(pairs vis+b+vis.sef tag+s+tag.sef cad+(tape (purge cad.sef)) ~)
::
$tab
%tab
:- %a
%+ turn p.sef
|= [=cord =^tank]
@ -59,7 +59,7 @@
info+(tape ~(ram re tank))
==
::
?($bel $clr $nex)
?(%bel %clr %nex)
(frond %act %s -.sef)
==
++ mar-sole-change
@ -72,11 +72,11 @@
=,(cha (pairs ted+(edi ted) ler+a+~[(numb own.ler) (numb his.ler)] ~))
|= det=sole-edit
?- -.det
$nop [%s 'nop']
$mor [%a (turn p.det ..$)]
$del (frond %del (numb p.det))
$set (frond %set (tape (tufa p.det)))
$ins (frond %ins (pairs at+(numb p.det) cha+s+(tuft q.det) ~))
%nop [%s 'nop']
%mor [%a (turn p.det ..$)]
%del (frond %del (numb p.det))
%set (frond %set (tape (tufa p.det)))
%ins (frond %ins (pairs at+(numb p.det) cha+s+(tuft q.det) ~))
==
--
--

View File

@ -424,7 +424,7 @@
=/ m (strand ,vase)
^- form:m
;< =riot:clay bind:m
(warp ship desk ~ %sing %a case (flop spur))
(warp ship desk ~ %sing %a case spur)
?~ riot
(strand-fail %build-file >arg< ~)
?> =(%vase p.r.u.riot)
@ -468,7 +468,7 @@
|= [[=ship =desk =case:clay] =spur]
=* arg +<
=/ m (strand ,cage)
;< =riot:clay bind:m (warp ship desk ~ %sing %x case (flop spur))
;< =riot:clay bind:m (warp ship desk ~ %sing %x case spur)
?~ riot
(strand-fail %read-file >arg< ~)
(pure:m r.u.riot)
@ -476,14 +476,14 @@
++ check-for-file
|= [[=ship =desk =case:clay] =spur]
=/ m (strand ,?)
;< =riot:clay bind:m (warp ship desk ~ %sing %x case (flop spur))
;< =riot:clay bind:m (warp ship desk ~ %sing %x case spur)
(pure:m ?=(^ riot))
::
++ list-tree
|= [[=ship =desk =case:clay] =spur]
=* arg +<
=/ m (strand ,(list path))
;< =riot:clay bind:m (warp ship desk ~ %sing %t case (flop spur))
;< =riot:clay bind:m (warp ship desk ~ %sing %t case spur)
?~ riot
(strand-fail %list-tree >arg< ~)
(pure:m !<((list path) q.r.u.riot))

View File

@ -31,7 +31,7 @@
`tang`[[%leaf (weld "FAILED " name)] ~]
::TODO indent
:: %+ turn p:run
:: |= {i/tape}
:: |= [i=tape]
:: ^- tank
:: [%leaf (weld " " i)]
p.run

View File

@ -6,5 +6,5 @@
::
:::: ~fyr
::
|= a/time ^- tape
|= a=time ^- tape
['c' (s-co:co f:(yell a))]

View File

@ -5,9 +5,9 @@
::
|%
++ 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 ..$))
::
@ -17,16 +17,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))

View File

@ -2,9 +2,9 @@
:::: /hoon/urb-split/lib
::
/? 310
|= {dep/@uvH urb/manx} ^- {hed/{@uvh marl} bod/{@uvH marl}}
|= [dep=@uvH urb=manx] ^- [hed=[@uvh marl] bod=[@uvH marl]]
~| [%malformed-urb urb] :: XX types
?> ?=({{$html ~} {{$head ~} *} {{$body ~} *} ~} urb)
=+ `{{$html ~} {{$head ~} hed/marl} {{$body ~} bod/marl} ~}`urb
?> ?=([[%html ~] [[%head ~] *] [[%body ~] *] ~] urb)
=+ `[[%html ~] [[%head ~] hed=marl] [[%body ~] bod=marl] ~]`urb
:- [dep hed] :: Assume all dependencies are hard
[0v0 bod]

View File

@ -1,3 +1,4 @@
/- *plum, *xray
::
:: # Type Analysis
::
@ -355,8 +356,8 @@
=^ params=(list xkey) st
|- ^- [(list xkey) xtable]
?~ u.q.note [~ st]
=/ tsld [%tsld [%limb %$] [%wing i.u.q.note]]
=/ part (~(play ut subject-of-note) tsld)
=/ tsgl [%tsgl [%limb %$] [%wing i.u.q.note]]
=/ part (~(play ut subject-of-note) tsgl)
=^ this st (main st part)
=^ more st $(u.q.note t.u.q.note)
[[this more] st]
@ -1318,7 +1319,7 @@
::
=^ i=xkey st
^- [xkey xtable]
%+ (fold {xkey xtable} xkey)
%+ (fold ,[xkey xtable] xkey)
[[void st] ~(tap in fork)]
|= [[k=xkey tbl=xtable] branch=xkey]
^- [xkey xtable]
@ -1416,8 +1417,8 @@
:: coherent `xrole` (where possible, otherwise a %misjunction).
::
:: This often needs to restructure things. For example, if we are
:: combining `{{~ ~} {%a ~}}` and `{{~ ~} {%b ~}}`, we should produce
:: `{{~ ~} ?%({%a ~} {%b ~})}`.
:: combining `[[~ ~] [%a ~]]` and `[[~ ~] [%b ~]]`, we should produce
:: `[[~ ~] ?%([%a ~] [%b ~])]`.
::
:: This is a massive switch on the xroles of the two arguments. This
:: is *very* easy to get wrong, so I structured things this in a
@ -1774,34 +1775,34 @@
=/ tl `spec`$(i tail.d)
=/ both-basic &(=([%base %noun] hd) =([%base %noun] tl))
?: both-basic [%base %cell]
?: ?=(%bscl -.tl) [%bscl hd +.tl]
[%bscl hd tl ~]
?: ?=(%bccl -.tl) [%bccl hd +.tl]
[%bccl hd tl ~]
%core =/ payld $(i xray.d)
=/ batt ^- (map term spec)
%- ~(run by (flatten-battery batt.d))
|= =xkey ^$(i xkey)
?- r.garb.d
%lead [%bszp payld batt]
%gold [%bsdt payld batt]
%zinc [%bstc payld batt]
%iron [%bsnt payld batt]
%lead [%bczp payld batt]
%gold [%bcdt payld batt]
%zinc [%bctc payld batt]
%iron [%bcfs payld batt]
==
%pntr !!
%face =/ =spec $(i xray.d)
?^(face.d spec [%bsts face.d spec])
?^(face.d spec [%bcts face.d spec])
%fork =/ =xrole (need xrole.x)
|^ ?+ xrole
~& [%unexpected-fork-xrole xkey.x d xrole choices]
[%bswt choices]
[%bcwt choices]
%noun [%base %noun]
%void [%base %void]
[%option *] [%bswt choices]
[%union *] [%bscn choices]
[%misjunction *] [%bswt choices]
[%junction *] :+ %bsvt
[%option *] [%bcwt choices]
[%union *] [%bccn choices]
[%misjunction *] [%bcwt choices]
[%junction *] :+ %bcpt
^$(i flat.xrole)
^$(i deep.xrole)
[%conjunction *] :+ %bskt
[%conjunction *] :+ %bckt
^$(i wide.xrole)
^$(i tall.xrole)
==
@ -1821,7 +1822,7 @@
^- spec
?. (need loop.xr) sp
=/ nm (synthetic xkey.xr)
[%bsbs [%loop nm] [[nm sp] ~ ~]]
[%bcbc [%loop nm] [[nm sp] ~ ~]]
::
:: If we have a `recipe`, we can generate much nicer output.
::
@ -1843,7 +1844,7 @@
++ synthetic
|= number=@ud
^- @tas
=/ alf/(list term)
=/ alf=(list term)
^~ :~ %alf %bet %gim %dal %hej %vav %zay %het
%tet %yod %kaf %lam %mem %nun %sam %ayn
%pej %sad %qof %res %sin %tav
@ -1864,4 +1865,77 @@
(~(uni by q.q.i.chapters) $(chapters t.chapters))
::
--
::
:: Left-fold over a list.
::
:: This is `roll`, but with explicit type parameters.
::
++ fold
|* [state=mold elem=mold]
|= [[st=state xs=(list elem)] f=$-([state elem] state)]
^- state
|-
?~ xs st
$(xs t.xs, st (f st i.xs))
::
:: This is basically a `mapM` over a list using the State monad.
::
:: Another way to think about this is that it is the same as `turn`,
:: except that a state variable `st` is threaded through the
:: execution. The list is processed from left to right.
::
:: This is `spin`, but with explicit type parameters.
::
++ traverse
|* [state=mold in=mold out=mold]
|= [[st=state xs=(list in)] f=$-([state in] [out state])]
^- [(list out) state]
?~ xs [~ st]
=^ r st (f st i.xs)
=^ rs st $(xs t.xs, st st)
[[r rs] st]
::
:: `traverse` over a set.
::
++ traverse-set
|* [state=mold input=mold out=mold]
|= [[st=state xs=(set input)] f=$-([state input] [out state])]
^- [(set out) state]
::
=^ elems st ((traverse state input out) [st ~(tap in xs)] f)
:_ st (~(gas in *(set out)) elems)
::
:: `traverse` over a map, also passing the key to the folding function.
::
++ traverse-map
|* [state=mold key=mold in=mold out=mold]
|= [[st=state dict=(map key in)] f=$-([state key in] [out state])]
^- [(map key out) state]
::
=^ pairs=(list (pair key out)) st
%+ (traverse state (pair key in) (pair key out))
[st ~(tap by dict)]
|= [st=state k=key x=in]
^- [(pair key out) state]
=^ v st (f st k x)
[[k v] st]
::
:_ st
(~(gas by *(map key out)) pairs)
::
:: Given a map, return its inverse: For each value, what are the set
:: of associated keys?
::
++ reverse-map
|* [key=mold val=mold]
|= tbl=(map key val)
=/ init *(map val (set key))
^- _init
%+ (fold _init (pair key val))
[init ~(tap by tbl)]
|= [acc=_init k=key v=val]
^- _init
=/ mb-keys (~(get by acc) v)
=/ keys=(set key) ?~(mb-keys ~ u.mb-keys)
(~(put by acc) v (~(put in keys) k))
--

View File

@ -6,7 +6,7 @@
:::: A minimal atom mark
::
=, mimes:html
|_ ato/@
|_ ato=@
++ grab |%
++ noun @
++ mime |=([* p=octs] q.p)

View File

@ -4,7 +4,7 @@
/? 310
=, eyre
=, mimes:html
|_ mud/@t
|_ mud=@t
++ grow :: convert to
|% ++ mime [/text/css (as-octs mud)] :: convert to %mime
++ elem ;style :: convert to %hymn

Some files were not shown because too many files have changed in this diff Show More