This commit is contained in:
johncburnham 2014-08-05 14:03:16 -07:00
commit 897855c76b
35 changed files with 263 additions and 52 deletions

View File

@ -19,30 +19,30 @@
== :: == ::
++ hood :: assembly plan ++ hood :: assembly plan
$: zus=@ud :: zuse kelvin $: zus=@ud :: zuse kelvin
sur=(list hook) :: structures sur=(list hoot) :: structures
lib=(list hoof) :: libraries lib=(list hoof) :: libraries
fan=(list horn) :: resources fan=(list horn) :: resources
src=(list hoop) :: program src=(list hoop) :: program
== :: == ::
++ hoof (pair term (unit (pair case ship))) :: resource reference ++ hoof (pair term (unit (pair case ship))) :: resource reference
++ hook (pair bean hoof) :: structure gate/core ++ hoot (pair bean hoof) :: structure gate/core
++ hoop :: source in hood ++ hoop :: source in hood
$% [%& p=twig] :: direct twig $% [%& p=twig] :: direct twig
[%| p=beam] :: resource location [%| p=beam] :: resource location
== :: == ::
++ horn :: resource tree ++ horn :: resource tree
$% [%and p=twig] :: /& twig by hand $% [%ape p=twig] :: /& twig by hand
[%arg p=twig] :: /$ argument [%arg p=twig] :: /$ argument
[%day p=horn] :: /| @dr map by @dr [%day p=horn] :: /| list by @dr
[%dub p=term q=horn] :: /= apply face [%dub p=term q=horn] :: /= apply face
[%fan p=(list horn)] :: /: list [%fan p=(list horn)] :: /. list
[%for p=path q=horn] :: /, descend [%for p=path q=horn] :: /, descend
[%hub p=horn] :: /@ map by @ud [%hub p=horn] :: /@ list by @ud
[%man p=(map term horn)] :: /* map by hand [%man p=(map span horn)] :: /* hetero map
[%nap p=horn] :: /% map by @tas [%nap p=horn] :: /% homo map
[%now p=horn] :: /& map by @da [%now p=horn] :: /& list by @da
[%saw p=twig q=horn] :: /; operate on [%saw p=twig q=horn] :: /; operate on
[%see p=beam q=horn] :: /. relative to [%see p=beam q=horn] :: /: relative to
[%sic p=tile q=horn] :: /^ cast [%sic p=tile q=horn] :: /^ cast
[%toy p=mark] :: /mark/ static [%toy p=mark] :: /mark/ static
== :: == ::
@ -409,7 +409,7 @@
++ fang :: protocol door ++ fang :: protocol door
|= [cof=cafe for=mark bek=beak] |= [cof=cafe for=mark bek=beak]
^- (bolt vase) ^- (bolt vase)
=+ pax=/door/[for]/mac =+ pax=/door/[for]/mar
=+ ^= bem ^- beam =+ ^= bem ^- beam
:_ pax :_ pax
?: =(p.bek our) bek ?: =(p.bek our) bek
@ -443,7 +443,7 @@
== ==
:: ::
;~ pose ;~ pose
(ifix [;~(plug fas hep gap) gap] (most ;~(plug com gaw) hook)) (ifix [;~(plug fas hep gap) gap] (most ;~(plug com gaw) hoot))
(easy ~) (easy ~)
== ==
:: ::
@ -467,7 +467,7 @@
== ==
== ==
:: ::
++ hook ++ hoot
;~ pose ;~ pose
(stag %| ;~(pfix tar hoof)) (stag %| ;~(pfix tar hoof))
(stag %& hoof) (stag %& hoof)
@ -488,8 +488,8 @@
;~ pfix fas ;~ pfix fas
;~ pose ;~ pose
(stag %toy ;~(sfix sym fas)) (stag %toy ;~(sfix sym fas))
(stag %and ;~(pfix and:sign and:read)) (stag %ape ;~(pfix ape:sign ape:read))
(stag %arg ;~(pfix arg:sign and:read)) (stag %arg ;~(pfix arg:sign ape:read))
(stag %day ;~(pfix day:sign day:read)) (stag %day ;~(pfix day:sign day:read))
(stag %dub ;~(pfix dub:sign dub:read)) (stag %dub ;~(pfix dub:sign dub:read))
(stag %fan ;~(pfix fan:sign fan:read)) (stag %fan ;~(pfix fan:sign fan:read))
@ -498,6 +498,7 @@
(stag %man ;~(pfix man:sign man:read)) (stag %man ;~(pfix man:sign man:read))
(stag %nap ;~(pfix nap:sign day:read)) (stag %nap ;~(pfix nap:sign day:read))
(stag %now ;~(pfix now:sign day:read)) (stag %now ;~(pfix now:sign day:read))
(stag %saw ;~(pfix saw:sign saw:read))
(stag %see ;~(pfix see:sign see:read)) (stag %see ;~(pfix see:sign see:read))
(stag %sic ;~(pfix sic:sign sic:read)) (stag %sic ;~(pfix sic:sign sic:read))
== ==
@ -509,7 +510,7 @@
;~(pose wid tal) ;~(pose wid tal)
:: ::
++ read ++ read
|% ++ and |% ++ ape
%+ rail %+ rail
(ifix [sel ser] (stag %cltr (most ace wide:vez))) (ifix [sel ser] (stag %cltr (most ace wide:vez)))
;~(pfix gap tall:vez) ;~(pfix gap tall:vez)
@ -546,28 +547,33 @@
:: ::
++ see ++ see
%+ rail %+ rail
;~(plug (ifix [sel ser] have) apex(tol |)) ;~(plug ;~(sfix have col) apex(tol |))
;~(pfix gap ;~(plug have ;~(pfix gap apex))) ;~(pfix gap ;~(plug have ;~(pfix gap apex)))
::
++ saw
%+ rail
;~(plug ;~(sfix wide:vez sem) apex(tol |))
;~(pfix gap ;~(plug tall:vez ;~(pfix gap apex)))
:: ::
++ sic ++ sic
%+ rail %+ rail
;~(plug (ifix [sel ser] toil:vez) apex(tol |)) ;~(plug ;~(sfix toil:vez ket) apex(tol |))
;~(pfix gap ;~(plug howl:vez ;~(pfix gap apex))) ;~(pfix gap ;~(plug howl:vez ;~(pfix gap apex)))
-- --
:: ::
++ sign ++ sign
|% ++ and ;~(pose pam (jest %and)) |% ++ ape ;~(pose sig (jest %ape))
++ arg ;~(pose buc (jest %arg)) ++ arg ;~(pose buc (jest %arg))
++ day ;~(pose bar (jest %day)) ++ day ;~(pose bar (jest %day))
++ dub ;~(pose tis (jest %dub)) ++ dub ;~(pose tis (jest %dub))
++ fan ;~(pose col (jest %fan)) ++ fan ;~(pose dot (jest %fan))
++ for ;~(pose com (jest %for)) ++ for ;~(pose com (jest %for))
++ hub ;~(pose pat (jest %hub)) ++ hub ;~(pose pat (jest %hub))
++ man ;~(pose tar (jest %man)) ++ man ;~(pose tar (jest %man))
++ nap ;~(pose cen (jest %nap)) ++ nap ;~(pose cen (jest %nap))
++ now ;~(pose fas (jest %now)) ++ now ;~(pose fas (jest %now))
++ saw ;~(pose sem (jest %saw)) ++ saw ;~(pose sem (jest %saw))
++ see ;~(pose dot (jest %see)) ++ see ;~(pose col (jest %see))
++ sic ;~(pose ket (jest %sic)) ++ sic ;~(pose ket (jest %sic))
-- --
-- --
@ -963,40 +969,62 @@
|= [cof=cafe sel=_..body] |= [cof=cafe sel=_..body]
^$(cof cof, src t.src, ..body sel) ^$(cof cof, src t.src, ..body sel)
:: ::
++ chai :: atomic map ++ chad :: atomic list
|= [cof=cafe bax=vase doe=term hon=horn] |= [cof=cafe bax=vase doe=term hon=horn]
^- (bolt vase) ^- (bolt vase)
%+ cope ((lash (slat doe)) cof how) %+ cope ((lash (slat doe)) cof how)
|= [cof=cafe yep=(map ,@ span)] |= [cof=cafe yep=(map ,@ span)]
=+ ^= poy ^- (list (pair ,@ span))
%+ sort (~(tap by yep) ~)
|=([a=[@ *] b=[@ *]] (lth -.a -.b))
%+ cope
|- ^- (bolt (list (pair ,@ vase)))
?~ poy (fine cof ~)
%+ cope $(poy t.poy)
|= [cof=cafe nex=(list (pair ,@ vase))]
%+ cope (chap(s.how [q.i.poy s.how]) cof bax hon)
|= [cof=cafe elt=vase]
(fine cof [[p.i.poy elt] nex])
|= [cof=cafe yal=(list (pair ,@ vase))]
%+ fine cof
|- ^- vase
?~ yal [[%cube 0 [%atom %n]] 0]
(slop (slop [[%atom doe] p.i.yal] q.i.yal) $(yal t.yal))
::
++ chai :: atomic map
|= [cof=cafe bax=vase hon=horn]
^- (bolt vase)
%+ cope (lend cof how)
|= [cof=cafe arc=arch]
%+ cope %+ cope
|- ^- (bolt (map ,@ vase)) |- ^- (bolt (map ,@ vase))
?~ yep (fine cof ~) ?~ r.arc (fine cof ~)
%+ cope $(yep l.yep) %+ cope $(r.arc l.r.arc)
|= [cof=cafe lef=(map ,@ vase)] |= [cof=cafe lef=(map ,@ vase)]
%+ cope `(bolt (map ,@ vase))`^$(cof cof, yep r.yep) %+ cope `(bolt (map ,@ vase))`^$(cof cof, r.arc r.r.arc)
|= [cof=cafe rig=(map ,@ vase)] |= [cof=cafe rig=(map ,@ vase)]
%+ cope (chap(s.how [q.n.yep s.how]) cof bax hon) %+ cope (chap(s.how [p.n.r.arc s.how]) cof bax hon)
|= [cof=cafe nod=vase] |= [cof=cafe nod=vase]
(fine cof [[p.n.yep nod] lef rig]) (fine cof [[p.n.r.arc nod] lef rig])
|= [cof=cafe doy=(map ,@ vase)] |= [cof=cafe doy=(map ,@ vase)]
%+ fine cof %+ fine cof
|- ^- vase |- ^- vase
?~ doy [[%cube 0 [%atom %n]] 0] ?~ doy [[%cube 0 [%atom %n]] 0]
%+ slop %+ slop
(slop [[%atom doe] p.n.doy] q.n.doy) (slop [[%atom %a] p.n.doy] q.n.doy)
(slop $(doy l.doy) $(doy r.doy)) (slop $(doy l.doy) $(doy r.doy))
:: ::
++ chap :: produce resources ++ chap :: produce resources
|= [cof=cafe bax=vase hon=horn] |= [cof=cafe bax=vase hon=horn]
^- (bolt vase) ^- (bolt vase)
?- -.hon ?- -.hon
%and (maim cof bax p.hon) %ape (maim cof bax p.hon)
%arg %arg
%+ cope (maim cof bax p.hon) %+ cope (maim cof bax p.hon)
|= [cof=cafe gat=vase] |= [cof=cafe gat=vase]
(maul cof gat !>([how arg])) (maul cof gat !>([how arg]))
:: ::
%day (chai cof bax %dr p.hon) %day (chad cof bax %dr p.hon)
%dub %dub
%+ cope $(hon q.hon) %+ cope $(hon q.hon)
|= [cof=cafe vax=vase] |= [cof=cafe vax=vase]
@ -1018,7 +1046,7 @@
(slop i.tev $(tev t.tev)) (slop i.tev $(tev t.tev))
:: ::
%for $(hon q.hon, s.how (weld (flop p.hon) s.how)) %for $(hon q.hon, s.how (weld (flop p.hon) s.how))
%hub (chai cof bax %ud p.hon) %hub (chad cof bax %ud p.hon)
%man %man
|- ^- (bolt vase) |- ^- (bolt vase)
?~ p.hon (fine cof [[%cube 0 [%atom %n]] 0]) ?~ p.hon (fine cof [[%cube 0 [%atom %n]] 0])
@ -1033,9 +1061,8 @@
(slop [[%atom %tas] p.n.p.hon] vax) (slop [[%atom %tas] p.n.p.hon] vax)
(slop lef rig) (slop lef rig)
:: ::
%now (chai cof bax %da p.hon) %now (chad cof bax %da p.hon)
%nap (chai cof bax %tas p.hon) %nap (chai cof bax p.hon)
::
%see $(hon q.hon, how p.hon) %see $(hon q.hon, how p.hon)
%saw %saw
%+ cope $(hon q.hon) %+ cope $(hon q.hon)
@ -1051,13 +1078,13 @@
|= [cof=cafe tug=vase] |= [cof=cafe tug=vase]
?. (~(nest ut p.tug) | p.vax) ?. (~(nest ut p.tug) | p.vax)
(flaw cof [%leaf "type error: {<p.hon>} {<q.hon>}"]~) (flaw cof [%leaf "type error: {<p.hon>} {<q.hon>}"]~)
(fine cof vax) (fine cof [p.tug q.vax])
:: ::
%toy (cope (make cof %bake p.hon how ~) feel) %toy (cope (make cof %bake p.hon how ~) feel)
== ==
:: ::
++ head :: consume structures ++ head :: consume structures
|= [cof=cafe bir=(list hook)] |= [cof=cafe bir=(list hoot)]
|- ^- (bolt ,_..head) |- ^- (bolt ,_..head)
?~ bir ?~ bir
(fine cof ..head) (fine cof ..head)

View File

@ -0,0 +1,5 @@
|%
++ fib |=(x=@ ~+(?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2))))))
--

View File

@ -1,16 +0,0 @@
::
:::: /hoon/core/html/pro
::
/? 314
::
:::: compute
::
|_ htm=@t
::
++ grow :: convert to
|%
++ mime :: convert to %mime
[/text/html (met 3 htm) htm]
--
--

16
main/mar/html/door.hook Normal file
View File

@ -0,0 +1,16 @@
::
:::: /hoon/core/html/pro
::
/? 314
::
:::: compute
::
|_ htm=@t
::
++ grow :: convert to
|% ::
++ mime [/text/html (met 3 htm) htm] :: to %mime
++ hymn (rash htm apex:xmlp) :: to %hymn
-- ::
--

View File

@ -0,0 +1,12 @@
/= ctx /$ |=([p=beam q=path] +<)
::
;html
;head
;title: Fun Experiment Five
==
;body
;p: This page was built at {<(tope p.ctx)>}.
;br;
;p: The remainder path was {<q.ctx>}.
==
==

View File

@ -0,0 +1,19 @@
/= gas /$ fuel
::
=+ arg=(biff (~(get by qix.gas) %number) (slat %ud))
=+ fib=|=(x=@ ~+(?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2))))))
::
;html
;head
;title: Fun Experiment Four
==
;body
;p: Welcome, {<cip.ced.gas>}!
;+ ?~ arg
;p: Usage: ?number=x
;p ; This is an ;{i "HTML file"} which
; computes the Fibonacci number
; of {<u.arg>}: {<(fib u.arg)>}.
==
==
==

1
main/pub/fab/fun/one.md Normal file
View File

@ -0,0 +1 @@
This is a *fun experiment* in markdown.

View File

@ -0,0 +1,11 @@
=+ fib=|=(x=@ ?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2)))))
;html
;head ;title: Fun Experiment Three
==
;body
;p ; This is an ;{i "HTML file"} which
; computes the Fibonacci number
; of 12: {<(fib 12)>}.
==
==
==

View File

@ -0,0 +1,5 @@
:~ :- %par
:~ tex/"This is a "
emp/bent/~[tex/"fun experiment "]
tex/"in markdown; 2 + 2 is {<(add 2 2)>}."
== ==

View File

@ -0,0 +1,9 @@
/- down
^- down
:~ :- %par
:~ tex/"This is a "
emp/bent/~[tex/"fun experiment "]
tex/"in markdown; 2 + 2 is {<(add 2 2)>}."
== ==

View File

@ -0,0 +1,21 @@
:: This fourth experiment is profoundly biblical.
::
:::: /hoon/four/mad/fab/pub
::
/= bible /: /======/res/bible
/; |= a=(list (pair ,@ manx))
(turn a |=([* b=manx] b))
/@
/hymn/
::
:::: ~tasfyn-partyv
::
!:
;html
;head
;title: Mad Experiment Four
==
;body
;* bible
==
==

View File

@ -0,0 +1,25 @@
:: Our first experiment with major hood runes.
::
:::: /hoon/one/mad/src/pub
::
/= gas /$ fuel
// /===/pub/src/mad/fib
::
:::: ~tasfyn-partyv
::
=+ arg=(biff (~(get by qix.gas) %number) (slat %ud))
::
;html
;head
;title: Mad Experiment One
==
;body
;+ ?~ arg
;p: Usage: ?number=x
;p ; This is an ;{i "HTML file"} which
; computes the Fibonacci number
; of {<u.arg>}: {<(fib u.arg)>}.
==
==
==

View File

@ -0,0 +1 @@
<p>The earth was without form, and void.</p>

View File

@ -0,0 +1 @@
<p>Then Cain slew Abel.</p>

View File

@ -0,0 +1 @@
<p>I bring not peace, but a sword.</p>

View File

@ -0,0 +1 @@
<p>And I saw a pale horse, and upon him a pale rider.</p>

View File

@ -0,0 +1 @@
;p: Hello, world.

View File

@ -0,0 +1,23 @@
:: Our sixth experiment with major hood runes.
::
:::: /hoon/six/mad/fab/pub
::
/+ example
/= gas /$ fuel
::
:::: ~tasfyn-partyv
::
=+ arg=(biff (~(get by qix.gas) %number) (slat %ud))
;html
;head
;title: Mad Experiment Two
==
;body
;+ ?~ arg
;p: Usage: ?number=x
;p ; This is an ;{i "HTML file"} which
; computes the Fibonacci number
; of {<u.arg>}: {<(fib u.arg)>}.
==
==
==

View File

@ -0,0 +1,17 @@
:: This third experiment wears the horns.
::
:::: /hoon/three/mad/fab/pub
::
/= hello /^ manx /:/======/res/hello:/hymn/
::
:::: ~tasfyn-partyv
::
;html
;head
;title: Mad Experiment Three
==
;body
;+ hello
==
==

View File

@ -0,0 +1,25 @@
:: Our second experiment with major hood runes.
::
:::: /hoon/two/mad/src/pub
::
/= gas /$ fuel
// /===/pub/src/mad/tools
::
:::: ~tasfyn-partyv
::
=+ arg=(biff (~(get by qix.gas) %number) (slat %ud))
::
;html
;head
;title: Mad Experiment Two
==
;body
;+ ?~ arg
;p: Usage: ?number=x
;p ; This is an ;{i "HTML file"} which
; computes the Fibonacci number
; of {<u.arg>}: {<(fib u.arg)>}.
==
==
==

View File

@ -0,0 +1,3 @@
|%
++ fib |=(x=@ ~+(?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2))))))
--

View File

@ -0,0 +1 @@
|=(x=@ ~+(?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2))))))

View File

@ -4,3 +4,4 @@
/? 314 /? 314
/- *markdown /- *markdown
down down

View File

@ -19,3 +19,4 @@
[%tex p=tape] :: text [%tex p=tape] :: text
== :: == ::
-- --