This commit is contained in:
Galen Wolfe-Pauly 2014-11-19 17:25:06 -08:00
parent e6870ede1a
commit 48b38fe86f
92 changed files with 0 additions and 4427 deletions

View File

@ -1,41 +0,0 @@
:: %clay browser
::
:::: /hook/hymn/dirs/fab/pub
::
/= gas /$ fuel
/= rut /$ |= [a=beam path] ^- [p=path q=path]
[(tope a(s ~)) (flop (slag 1 s.a))]
!:
:::: ~pittyp-pittyp
::
=+ pax=`path`(flop but.gas)
=+ cot=(trip ;;(,@ (fall (file (welp p.rut pax)) '')))
=+ js="""
window.location = "/gen/main{<q.rut>}/" + pax.value
"""
;html
;head:title:"{<pax>}"
;body
;input#pax(onchange js, value (slag 1 <pax>));
;+ =+ ups="%"
|-
?: =(~ pax) ;div:a/"/gen/main{<q.rut>}":"/==="
=: ups "%{ups}"
pax (scag (dec (lent pax)) pax)
==
=+ sul=;;(arch .^(%cy (welp p.rut pax)))
?: (gte 2 ~(wyt by r.sul)) $
;div:a/"/gen/main{<q.rut>}{<pax>}":"{ups}"
::
;* =+ sub=;;(arch .^(%cy (welp p.rut pax)))
=| don=tape
%+ turn (~(tap by r.sub)) |= [a=span ~]
=: don "{don}/{(trip a)}"
pax (welp pax /[a])
==
=+ sus=;;(arch .^(%cy (welp p.rut pax)))
?: =(2 ~(wyt by r.sus)) $(a p.n.-.r.sus)
;div:a/"/gen/main{<q.rut>}{<pax>}":"{(slag 1 don)}"
;pre:"{cot}"
==
==

View File

@ -1,12 +0,0 @@
/= 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

@ -1,19 +0,0 @@
/= 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)>}.
==
==
==

View File

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

View File

@ -1,11 +0,0 @@
=+ 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

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

View File

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

View File

@ -1,21 +0,0 @@
:: 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

@ -1,25 +0,0 @@
:: 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

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,23 +0,0 @@
:: 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

@ -1,17 +0,0 @@
:: 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

@ -1,25 +0,0 @@
:: 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

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

View File

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

View File

@ -1,19 +0,0 @@
!:
:: /=try=/bin/aesde/hoon
::
:: AES decryption toy. Don't use this for anything real.
:: It will threaten non-termination and send your private key to
:: General Alexander via singing telegram.
::
=> %= .
+
=> +
^/===/lib/cryo
==
|= *
|= [k=@I c=@ ~]
^- bowl
=+ m=(de:aes k c)
:_ ~ :_ ~
:- %$
!> m

View File

@ -1,19 +0,0 @@
!:
:: /=try=/bin/aesen/hoon
::
:: AES encryption toy. Don't use this for anything real.
:: It will threaten non-termination and send your private key to
:: General Alexander via singing telegram.
::
=> %= .
+
=> +
^/===/lib/cryo
==
|= *
|= [k=@I m=@ ~]
^- bowl
=+ c=(en:aes k m)
:_ ~ :_ ~
:- %$
!> c

View File

@ -1,21 +0,0 @@
::
:: /=try=/bin/aestest/hoon
::
|= [est=time eny=@uw]
|= ~
:_ ~ :_ ~
=+ i=0
:- %$
!>
|- ^- @
?: =(1.000.000 i) 0
=+ k=(con (lsh 3 16 (en:aesc eny i)) (en:aesc +(eny) i))
=+ m=(en:aesc (add 2 eny) i)
=+ suc==(m (de:aesc k (en:aesc k m)))
?. suc
~| [%fail `@ux`k `@ux`m]
!!
?: &(!=(0 i) =(0 (mod i 10.000)))
~& [i `@ux`k `@ux`m]
$(i +(i))
$(i +(i))

View File

@ -1,28 +0,0 @@
!:
:: /=main=/bin/app/hoon
::
=> %= .
+
=> +
|%
++ word %hello
--
==
|= *
|= ~
^- bowl
:_ ~ :_ ~
:- %$
!> :_ %- turn :_ trip %- lore %- crip
"""
This quote don't need no extra ws
But further indents are preserved
and {<%inter %polation>} is possible
Yay.
"""
%- lore
'''
Ph'nglui mglw'nafh \ ::no comments etc.
Heredoc R'lyeh wgah'nahgl fhtagn
'''

View File

@ -1,103 +0,0 @@
!:
:: /=main=/bin/app/hoon
::
=> %= .
+
=> +
=> ^/===/bin/pque
|%
:: efficient priority queue
:: possibly empty
++ pque |* [a=_,* b=_,*]
(unit (rque a b))
:: internal - nonempty pque
++ rque |* [a=_,* b=_,*]
$: k=a
n=b
q=(bque a (rque a b))
==
:: maximally optimal priority queue
:: O(1) insert, meld, peek
:: O(log n) pop
::
:: lte -> min priority queue
:: gte -> max priority queue
::
:: bootstrapped off of ++pr
::
:: to create, use something like
:: ~zod/try=> ((qu ,@ ,@) lte)
::
:: example operations
::
:: =+ pri=((qu ,@ ,@) lte)
:: =+ q=~
:: =. q (insert.pri q 3 2)
:: =^ r q (pop.pri q)
++ qu !:
|* [key=$+(* *) val=$+(* *)]
|= cmp=$+([key key] ?)
=+ bt=((pr key (rque key val)) cmp)
|%
++ insert
|= [q=(pque key val) k=key n=val]
^- (pque key val)
(meld [~ [k=k n=n q=~]] q)
++ meld
|= [q=(pque key val) p=(pque key val)]
^- (pque key val)
?~ p q
?~ q p
?: (cmp k.u.p k.u.q)
[~ [k=k.u.p n=n.u.p q=(insert.bt q.u.p [k=k.u.q n=[k.u.q n=n.u.q q=q.u.q]])]]
[~ [k=k.u.q n=n.u.q q=(insert.bt q.u.q [k=k.u.p n=[k=k.u.p n=n.u.p q=q.u.p]])]]
:: errors on empty pque, sigcheck first
++ peek
|= q=(pque key val)
^- [k=key n=val]
?~ q ~|(%empty-pque-peek !!)
[k=k.u.q n=n.u.q]
:: errors on empty pque, sigcheck first
++ pop
|= q=(pque key val)
^- [r=[k=key n=val] q=(pque key val)]
?~ q ~|(%empty-pque-pop !!)
?~ q.u.q
[r=(peek q) q=~] :: queue is now empty
=+ s=(pop.bt q.u.q) :: [r=[k=key n=rque] q=bque]
~! s
[r=(peek q) q=[~ [k=k.r.s n=n.n.r.s q=(meld.bt q.n.r.s q.s)]]]
--
--
==
|= *
|= ~
^- bowl
:_ ~ :_ ~
:- %$
!>
=+ pri=((qu ,@ ,@) lte)
=+ pq=(insert.pri ~ 6 302)
=. pq (insert.pri pq 5 3.897)
=. pq (insert.pri pq 2 1)
=+ pq2=(insert.pri ~ 508 542)
=. pq2 (insert.pri pq2 42 89)
=. pq2 (insert.pri pq2 325 325)
=. pq2 (insert.pri pq2 41 37)
=. pq (meld.pri pq pq2)
~& pq
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
pq

View File

@ -1,58 +0,0 @@
!: :: /=try=/bin/http/hoon
!? 164
::::
|= *
|= [folder=[mih=span dez=span caz=span sup=path] urls=(list tape)]
^- bowl
::::
=+ ^= requests
%- ~(gas by *(map path ,[p=tape q=purl]))
|- ^- (list ,[p=path q=tape r=purl])
%+ turn urls
|= [a=tape]
:+ `path`[(scot %t (rap 3 a)) ~]
a
(scan a auri:epur)
=< apex
|%
++ apex `bowl`[gifts stuff]
++ gifts
^- (list gift)
%+ turn (~(tap by requests) *(list ,[p=path q=tape r=purl]))
|= [a=path b=tape c=purl]
[%tq a [c [%get ~ ~]]]
::
++ stuff
?: =(~ requests) ~
:- ~
:_ work
^- (list slip)
=+ unresolved=(~(tap by requests) ~)
%+ turn unresolved
|= [a=path b=tape c=purl]
[a [%hp ~]]
::
++ work
|= [now=@da pax=path not=note]
^- bowl
?> ?=([%hp *] not)
=+ request=(need (~(get by requests) pax))
=+ more=apex(requests (~(del by requests) pax))
=- more(p (weld actions p.more))
^= actions ^- (list gift)
:* [%la %leaf "{p.request}: {(scow %ud p.p.not)}"]
?~ r.p.not ~
:_ ~
:+ %ok
dez.folder
:+ %&
~
:- *cart
=+ tol=:(weld sup.folder pax `path`/http)
:~ :- tol
%+ feel
(weld `path`[mih.folder dez.folder caz.folder ~] tol)
q.u.r.p.not
==
==
--

View File

@ -1,34 +0,0 @@
::
:: /=main=/bin/curve/hoon
::
=> %= .
+
=> +
^/===/lib/cryo
==
|= [est=time eny=@uw]
|= ~
^- bowl
:_ ~ :_ ~
:- %$
!>
=+ pk=48.084.050.389.777.770.101.701.157.326.923.977.117.
307.187.144.965.043.058.462.938.058.489.685.090.437
=+ sk=(cla:curv 19.076.158.533.740.022.697.853.188.432.810.
029.468.508.100.820.210.985.396.154.491.514.718.125.885.303)
=+ ska=(gen:curv eny)
=+ sky=(gen:curv (shax eny))
:*
%public-test
:+
[%reference-public pk]
[%calculate-public (curve:curv sk 9)]
[%equals =((curve:curv sk 9) pk)]
%diffie-hellman
[%alice-secret ska]
[%bob-secret sky]
[%alice-calcs (curve:curv sky (curve:curv ska 9))]
[%bobp-calcs (curve:curv ska (curve:curv sky 9))]
%equals
=((curve:curv sky (curve:curv ska 9)) (curve:curv ska (curve:curv sky 9)))
==

View File

@ -1,39 +0,0 @@
!:
:: Define ::
=> |%
++ isin |= [a=tape b=tape]
?. (gte (lent a) (lent b)) |
?: =(b (scag (lent b) a)) &
$(a +.a)
::
++ range |= [[a=tape b=tape] c=wain]
^- wain
?~ c ~
?. (isin (trip i.c) a) $(c t.c)
:- i.c => .(c t.c)
|- ^- wain
?~ c ~
?: (isin (trip i.c) b) ~
[i.c $(c t.c)]
::
++ vanes
%- turn :_ |=([a=@t ~] a)
(~(tap by r:;;(arch .^(cy//=arvo=))))
--
|= ^
|= [a=@tas ~]
=- ~[te/-]~
%- zing
%+ turn vanes |= b=@t
=- ?~ - ~
[(cat 3 '%' b) -]
%+ range ["++ {(trip a)}" "++"]
=- (lore ;;(,@ .^(cx//=arvo=/[b]/hoon)))
'''
++ by
my
stuff
++ron
as
'''

View File

@ -1,20 +0,0 @@
!:
:: /=try=/bin/edpk/hoon
::
:: ed25519 public key toy.
::
:: Needless to say, don't use this for anything real. Not only will it be
:: embarrassingly slow, but it'll probably mail your private key to the NSA.
::
=> %= .
+
=> +
^/===/lib/cryo
==
|= [est=time eny=@uw]
|= [sk=@ ~]
^- bowl
=+ pk=(puck:ed sk)
:_ ~ :_ ~
:- %$
!> `@ux`pk

View File

@ -1,20 +0,0 @@
!:
:: /=try=/bin/edsi/hoon
::
:: ed25519 signature toy.
::
:: Needless to say, don't use this for anything real. Not only will it be
:: embarrassingly slow, but it'll probably mail your private key to the NSA.
::
=> %= .
+
=> +
^/===/lib/cryo
==
|= [est=time eny=@uw]
|= [sk=@ pk=@ m=@ ~]
^- bowl
=+ si=(sign:ed m sk pk)
:_ ~ :_ ~
:- %$
!> `@ux`si

View File

@ -1,52 +0,0 @@
!:
:: /=try=/bin/edtest/hoon
::
=> %= .
+
=> +
|%
++ swab |=(a=@ (rep 3 (flop (rip 3 a))))
++ tase ,[sk=@ux pk=@ux m=@ux sm=@ux] :: test-case
++ read
|.
=+ fil=((hard ,@) .^(%cx /===/doc/ed/test))
(rash fil pars)
++ line
%+ knee *tase |. ~+
;~ plug
;~(sfix (bass 16 (star hit)) col)
;~(sfix (bass 16 (star hit)) col)
;~(sfix (bass 16 (star hit)) col)
;~(sfix (bass 16 (star hit)) col (just `@`10))
==
++ pars
%+ knee *(list tase) |. ~+
(star line)
++ chek
|= a=tase
~| a
=+ gsk=`@ux`(cut 3 [0 32] (swab sk.a)) :: endian hell
=+ cpk=`@ux`(puck:ed gsk)
=+ ypk=`@ux`(swab pk.a)
~| [%pk cpk ypk]
?> =(cpk ypk)
=+ sig=`@ux`(sign:ed (swab m.a) gsk)
=+ tsg=`@ux`(cut 3 [0 64] (swab sm.a))
~| [%sg sig tsg]
?> =(sig tsg)
?> (veri:ed tsg (swab m.a) ypk)
~& [%a-ok a]
&
++ test
|= a=(list tase)
^- (list ,*)
?~ a
~
[(chek i.a) $(a t.a)]
--
==
|= [est=time eny=@uw]
|= ~
^- bowl
~& (test (read))
[~ ~]

View File

@ -1,18 +0,0 @@
!:
:: /=try=/bin/edpk/hoon
::
:: ed25519 signature verification toy.
::
=> %= .
+
=> +
^/===/lib/cryo
==
|= [est=time eny=@uw]
|= [pk=@ s=@ m=@ ~]
^- bowl
:_ ~ :_ ~
:- %$
!> ?: (veri:ed s m pk)
'valid sig'
'invalid sig'

View File

@ -1,9 +0,0 @@
!:
:: /=try=/bin/fib/hoon
::
|= *
|= [num=@ud ~]
:_ ~ :_ ~
:+ %la %leaf
(scow %ud %.(num |=(x=@ ?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2)))))))

View File

@ -1,38 +0,0 @@
!:
:: /=main=/bin/app/hoon
::
=> %= .
+
=> +
|%
++ sii !:
=| *
|%
+- $
?~ +<
+<
$(+< +<+)
--
++ flopp
=| *
=| *
|%
+- $
?~ +<
?~ +>- ~
+>-
?~ +>-
$(+< +<+, +>- [+<- +<+(. ~)])
$(+< +<+, +>- [+<- +<+(. +>-)])
--
--
==
|= *
|= ~
^- bowl
:_ ~ :_ ~
:- %$
!>
=+ x=[i=1 t=[i=2 t=[i=3 t=[i=4 t=~]]]]
=+ y=(limo [1 2 3 4 ~])
(flopp x)

View File

@ -1,27 +0,0 @@
::
:: /=try=/bin/aestest/hoon
::
|= [est=time eny=@uw]
|= ~
:_ ~ :_ ~
=+ i=0
:- %$
!>
|- ^- @
?: =(1.000.000 i) 0
=+ n=`@rd`(end 6 1 (en:aesc eny i))
=+ m=`@rd`(rsh 6 1 (en:aesc +(eny) i))
:: ~& [%try `@ux`n `@ux`m]
~| $(i +(i))
=+ a=(add:rd n m)
=+ b=(sub:rd n m)
=+ c=(mul:rd n m)
=+ d=(div:rd n m)
=+ suc=%.y
?. suc
~| [%fail i `@ux`n `@ux`m]
!!
?: &(!=(0 i) =(0 (mod i 2)))
~& [%try i `@ux`n `@ux`m]
$(i +(i))
$(i +(i))

View File

@ -1,41 +0,0 @@
!:
:: /=try=/bin/game/hoon
::
=> .(- `[who=@p how=path]`-)
=> .(+ =>(+ ^/=main=/lib/hume))
|= [est=time eny=@uw]
|= [neighbor=tape ~]
^- bowl
=+ messages=*(list ,@t)
%- lunt
:* who
%none
:- :~ :* :~ [%& /localhost]
[%| .127.0.0.1]
==
/game
(shas %game eny)
/try
==
==
^- vase
!> |%
++ give
|= [now=@da fig=weev]
^- [p=(list gift) q=(unit ,[p=(list slip) q=_+>.$])]
?+ -.fig
[~[la/leaf/"give other {<fig>}"] ~]
::
%form
=+ msg=(~(get by q.fig) %msg)
?~ msg
[~[la/leaf/"give odd form {<q.fig>}"] ~]
[~ [~ ~ +>.$(messages [u.msg messages])]]
==
::
++ miss
|= [pac=pact ced=cred]
^- (unit purl)
~
--
==

View File

@ -1,11 +0,0 @@
!:
:: /=try=/bin/gen/hoon
::
:: produce 256 bits of entropy.
::
|= [est=time eny=@uw]
|= ~
^- bowl
:_ ~ :_ ~
:- %$
!> `@ux`(shax eny)

View File

@ -1,4 +0,0 @@
|= *
|= [planet=tape ~]
^- bowl :_ ~ :_ ~ :- %$ !>
"hasta la vista, {planet}."

View File

@ -1,7 +0,0 @@
|= * :: To see what Hoon compiles into
|= [a=* ~] ::
:_ ~ :_ ~ :: Preserve this mysterious boilerplate square
:- %$ ::
!> != ::
::::::::::::::::: Replace this with your code
|=(b=@ |=(c=@ [b c]))

View File

@ -1,6 +0,0 @@
|= *
|= *
=+ a=1
|- ^- bowl
?: =(0 a) [~ ~]
$(a +(a))

View File

@ -1,272 +0,0 @@
!:
:: /=main=/bin/app/hoon
::
=> %= .
+
=> +
|%
++ blob $% [%delta q=blob r=udon]
[%direct q=* r=umph]
[%indirect q=* r=udon]
==
++ yaki ,[p=(list yaki) q=(map path blob) r=@ t=@ud] :: later t=@da
::
:: database helpers
::
++ hash-blob ::
|= p=*
^- blob
[%direct p %c]
::
++ hash-yaki :: zoal
|= [p=(list yaki) q=(map path blob) t=@ud] :: later t=@da
^- yaki
[p q (mug [(roll (turn p |=(p=yaki r.p)) add) q t]) t] :: later quicksort?
::
++ grab :: -> zaul
|= p=blob
?- -.p
%delta (lump r.p $(p q.p))
%direct q.p
%indirect q.p
==
::
++ prep :: -> zump
|= p=blob
^- umph
?- -.p
%delta p.r.p
%direct r.p
%indirect p.r.p
==
::
:: utils
::
++ lath
|= [p=(map path ,*) s=(set path)]
^- (set path)
%+ roll (~(tap by p) ~)
|= [[p=path *] q=_s]
%. p %~ put in q
::
++ luth
|= [p=(map path ,*) q=(map path ,*)]
^- (list path)
%. ~
%~ tap in
%+ lath p
%+ lath q
_(set path)
::
:: graph logic
::
++ zule :: reachable
|= p=yaki :: pretty much a |=
^- (set yaki)
=+ t=(~(put in _(set yaki)) p)
%+ roll p.p
|= [q=yaki s=_t]
?: (~(has in s) q) :: already done
s :: hence skip
(~(uni by s) ^$(p q)) :: otherwise traverse
::
++ zeal :: merge points
|= [p=yaki q=yaki]
=+ r=(zule p)
|- ^- (set yaki)
?: (~(has in r) q) (~(put in _(set yaki)) q) :: done
%+ roll p.q
|= [t=yaki s=(set yaki)]
?: (~(has in r) t)
(~(put in s) t) :: found
(~(uni in s) ^$(q t)) :: traverse
::
:: diff logic
::
++ zerg
|= [p=yaki q=yaki]
^- (map path miso)
%+ roll (luth q.p q.q)
|= [pat=path yeb=(map path miso)]
=+ leb=(~(get by q.p) pat)
=+ lob=(~(get by q.q) pat)
?~ leb (~(put by yeb) pat [%ins (grab (need lob))])
?~ lob (~(put by yeb) pat [%del (grab (need leb))])
=+ zeq=(grab u.leb)
=+ zoq=(grab u.lob)
?: =(zeq zoq)
yeb
%+ ~(put by yeb) pat
:- %mut
((diff (prep u.leb)) zeq zoq)
::
:: merge logic
::
++ qael :: clean
|= wig=(urge)
^- (urge)
?~ wig ~
?~ t.wig wig
?: ?=(%& -.i.wig)
?: ?=(%& -.i.t.wig)
$(wig [[%& (add p.i.wig p.i.t.wig)] t.t.wig])
[i.wig $(wig t.wig)]
[i.wig $(wig t.wig)]
::
++ qaul :: check no delete
|= wig=(urge)
^- ?
?~ wig %.y
?- -.i.wig
%& %.n
%| ?: =(p.i.wig 0)
$(wig t.wig)
%.n
==
::
++ qeal :: merge p,q
|= [p=miso q=miso]
^- miso
~| %qeal-fail
?> ?=(%mut -.p)
?> ?=(%mut -.q)
?> ?=(%c -.q.p.p)
?> ?=(%c -.q.p.q)
=+ s=(qael p.q.p.p)
=+ t=(qael p.q.p.q)
:- %mut
:- %c :: todo is this p.p.p?
:- %c
|- ^- (urge)
::?~ s ?: (qual t) t
:: ~| %qail-conflict !!
::?~ t ?: (qual s) s
:: ~| %qail-conflict !!
?~ s t
?~ t s
?- -.i.s
%&
?- -.i.t
%&
?: =(p.i.s p.i.t)
[i.s $(s t.s, t t.t)]
?: (gth p.i.s p.i.t)
[i.t $(t t.t, p.i.s (sub p.i.s p.i.t))]
[i.s $(s t.s, p.i.t (sub p.i.t p.i.s))]
%|
?: =(i.s (lent p.i.t))
[i.t $(s t.s, t t.t)]
?: (gth p.i.s (lent p.i.t))
[i.t $(t t.t, p.i.s (sub p.i.s (lent p.i.t)))]
~| %quil-conflict !!
==
%|
?> ?=(%& -.i.t)
?: =(i.t (lent p.i.s))
[i.s $(s t.s, t t.t)]
?: (gth p.i.t (lent p.i.s))
[i.s $(s t.s, p.i.t (sub p.i.t (lent p.i.s)))]
~| %quil-conflict !!
==
++ quil :: merge p,q
|= [p=(unit miso) q=(unit miso)]
^- (unit miso)
?~ p q :: trivial
?~ q p :: trivial
?. ?=(%mut -.u.p)
~| %quil-conflict !!
?. ?=(%mut -.u.q)
~| %quil-conflict !!
%- some
%+ qeal u.p :: merge p,q'
u.q
::
++ meld :: merge p,q from r
|= [p=yaki q=yaki r=yaki]
^- (map path blob)
=+ s=(zerg r p)
=+ t=(zerg r q)
~& [%diff-s s]
~& [%diff-t t]
%+ roll (luth s t)
|= [pat=path res=(map path blob)]
=+ ^= v
%- need
%+ quil
(~(get by s) pat)
(~(get by t) pat)
?- -.v
%del res :: no longer exists
%ins :: new file
%+ ~(put by res) pat
%- hash-blob
p.v
%mut :: patch from r
~& [%patch p.v [%orig (~(get by q.r) pat)]]
%+ ~(put by res) pat
%- hash-blob
%+ lump p.v
%- grab
%- need
%- ~(get by q.r) pat
==
::
:: merge types
::
++ mate :: merge p,q
|= [p=yaki q=yaki] :: %mate/%meld
^- (map path blob)
=+ r=(~(tap in (zeal p q)) ~)
?~ r
~|(%mate-no-ancestor !!)
?: =(1 (lent r))
(meld p q i.r)
~|(%mate-criss-cross !!)
::
++ keep :: %this
|= [p=yaki q=yaki]
^- (map path blob)
q.p
++ drop :: %that
|= [p=yaki q=yaki]
^- (map path blob)
q.q
++ forge :: %forge
|= [p=yaki q=yaki]
^- (map path blob)
=+ r=(~(tap in (zeal p q)) ~)
?~ r
~|(%forge-no-ancestor !!)
%^ meld p q
%+ roll t.r :: fake ancestor
|= [par=yaki for=_i.r]
(hash-yaki [par for ~] (forge par for) 0) :: fake yaki
::
:: actual merge
::
++ merge
|= [p=yaki q=yaki r=@ud s=$+([yaki yaki] (map path blob))]
^- yaki
(hash-yaki [p q ~] (s p q) r)
::
--
==
|= *
|= ~
^- bowl
:_ ~ :_ ~
:- %$
!>
=| b=(map path blob)
=+ n1=(hash-yaki ~ (~(put by b) ~['test'] (hash-blob 'hi\0ahello\0a')) 1)
=+ n2=(hash-yaki [n1 ~] (~(put by b) ~['test'] (hash-blob 'hi\0ahello\0abye\0a')) 2)
=+ n3=(hash-yaki [n1 ~] (~(put by b) ~['test'] (hash-blob 'help\0ahi\0ahello\0a')) 3)
=+ n4=(hash-yaki [n1 ~] b 4)
=+ n5=(hash-yaki [n3 n4 ~] b 5) :: merge n3/n4
=+ n6=(hash-yaki [n5 ~] b 6)
=+ n7=(hash-yaki [n3 ~] b 7)
::(zeal n6 n7)
::(zerg n1 n2)
::(mate n2 n3)
:- [%result ((hard ,@t) (grab (need (~(get by q:(merge n3 n2 8 mate)) ~['test'])))) (merge n2 n3 9 forge)]
[%result ((hard ,@t) (grab (need (~(get by q:(merge n3 n2 8 mate)) ~['test'])))) (merge n3 n2 9 forge)]

View File

@ -1,344 +0,0 @@
!:
:: /=main=/bin/app/hoon
::
=> %= .
+
=> +
|%
:::: markdown parser
::
++ down (list bloc) :: markdown model
++ bloc :: block elements
$% [%head p=@ud q=(list span) r=(unit tape)]
[%para p=(list span)]
[%lise p=down]
[%list p=? q=down]
[%quot p=down]
[%horz ~]
[%code p=wall]
[%html p=manx]
==
::
++ span :: span elements
$% [%text p=tape]
[%emph p=term q=(list span)]
[%stri p=(list span)]
[%brek ~]
[%link p=(list span) q=tape r=(unit tape)]
[%cods p=tape]
==
::
++ apex :: markdown parser
|= tub=nail
^- (like down)
=+ sep=(sepa tub)
?~ q.sep [p.sep ~]
[p.sep (some [(turn p.u.q.sep |=(a=tape (scan a blos))) [p.sep ~]])]
::
++ base (stag %para ;~(plug (stag %text (plus ;~(pose prn eol))) (easy ~)))
++ blos :: block element
(knee *bloc |.(~+(;~(pose head quot lasd horz code codf html para base))))
::
++ brek (stag %brek (cold ~ ;~(plug fas fas))) :: line break
++ chrd ;~(pose escp prn (cold ' ' eol)) :: span character data
++ code :: code block
%+ stag %code
%- full
%- plus
;~ pfix (stun [4 4] ace)
;~(pose (cook welp ;~(plug (plus prn) (cold "\0a" eol))) (full (plus prn)))
==
::
++ codf :: fenced code block
%+ stag %code
%- full
%+ ifix [;~(plug tec tec tec eol) ;~(plug tec tec tec)]
%- plus
;~ pose
(cook welp ;~(plug (plus prn) (cold "\0a" eol)))
(full (plus ;~(less ;~(plug tec tec tec) prn)))
==
::
++ cods :: code span
%+ stag %cods
=+ chx=;~(pose (cold ' ' eol) prn)
;~ pose
%+ ifix [(jest '```') (jest '```')] (plus ;~(less (jest '```') chx))
%+ ifix [(jest '``') (jest '``')] (plus ;~(less (jest '``') chx))
%+ ifix [tec tec] (plus ;~(less tec chx))
==
::
++ dont ;~(pose tar tec cab ;~(plug sig sig) ;~(plug fas fas) sel)
++ spas :: all span elements
|* res=_rule
(plus ;~(pose emph stri link brek cods (text res)))
::
++ eol (just `@`10) :: newline
++ emph :: emphasis
%+ knee *span |. ~+
%+ stag %emph
=+ inn=(plus ;~(pose cods stri link (text fail)))
;~ pose
(ifix [(jest '***') (jest '***')] (stag %both inn))
(ifix [(jest '**_') (jest '_**')] (stag %both inn))
(ifix [(jest '*__') (jest '__*')] (stag %both inn))
(ifix [(jest '_**') (jest '**_')] (stag %both inn))
(ifix [(jest '__*') (jest '*__')] (stag %both inn))
(ifix [(jest '___') (jest '___')] (stag %both inn))
(ifix [(jest '**') (jest '**')] (stag %bold inn))
(ifix [(jest '__') (jest '__')] (stag %bold inn))
(ifix [tar tar] (stag %ital inn))
(ifix [cab cab] (stag %ital inn))
==
::
++ escp :: escapable chars
;~ pose
(cold '`' (jest '\\`'))
(cold '*' (jest '\\*'))
(cold '#' (jest '\\#'))
(cold '-' (jest '\\-'))
(cold '.' (jest '\\.'))
(cold '{' (jest '\\{'))
(cold '}' (jest '\\}'))
(cold '[' (jest '\\['))
(cold ']' (jest '\\]'))
(cold '\\' (jest '\\\\'))
==
::
++ head :: header
%+ stag %head
=+ ^= hed
;~ pose
;~ plug
;~(pfix wits (spas hax))
(cook some (ifix [;~(plug (star hax) sel hax) ser] (plus alp)))
==
(ifix [wits (star hax)] ;~(plug (spas hax) (easy ~)))
==
=+ ^= sed
;~ pose
;~ plug
(spas ;~(pose eol sel))
(cook some (ifix [;~(plug sel hax) ser] (plus alp)))
==
;~(plug (spas eol) (easy ~))
==
%- full
;~ pose
;~ pfix (jest '######') (stag 6 hed) ==
;~ pfix (jest '#####') (stag 5 hed) ==
;~ pfix (jest '####') (stag 4 hed) ==
;~ pfix (jest '###') (stag 3 hed) ==
;~ pfix (jest '##') (stag 2 hed) ==
;~ pfix (jest '#') (stag 1 hed) ==
(stag 1 (ifix [wits ;~(plug eol (plus tis))] sed))
(stag 2 (ifix [wits ;~(plug eol (plus hep))] sed))
==
::
++ horz :: horizontal rule
%+ stag %horz
%+ cold ~
%- full
;~ pose
;~(plug (stun [0 3] ace) hep wits hep wits hep (star ;~(pose hep wite)))
;~(plug (stun [0 3] ace) tar wits tar wits tar (star ;~(pose tar wite)))
;~(plug (stun [0 3] ace) cab wits cab wits cab (star ;~(pose cab wite)))
==
::
++ html (stag %html apex:poxa) :: html bloc
++ lasd :: top level list
%+ stag %list
%- full
;~ pose
(stag & (lisd ;~(plug (star nud) dot)))
(stag | (lisd hep))
(stag | (lisd tar))
(stag | (lisd lus))
==
::
++ lisd :: list funk
|* bus=_rule
|= tub=nail
^- (like down)
=+ chx=;~(plug (plus prn) (cold "\0a" eol))
=- ?~ q.pre
pre
:- p.pre
(some (turn `wall`p.u.q.pre |=(a=tape [%lise (scan a apex)])) [p.pre ~])
^= pre %. tub
%+ most ;~(pose ;~(plug wits eol) (easy ~))
%+ cook |=(a=wall `tape`(zing a)) ::XX core dumps w/o cast
;~ plug
%+ cook zing
;~ pose
(full ;~(pfix bus ace ;~(plug (plus prn) (easy ~))))
;~(pfix bus ace ;~(plug (plus prn) (cold "\0a" eol) (easy ~)))
==
%- star
;~ pose
;~(plug ;~(sfix eol ace ace) (cook welp chx))
;~(pfix ace ace (cook welp chx))
(full ;~(pfix ace ace (plus prn)))
==
==
::
++ link :: link element
%+ knee *span |. ~+
%+ stag %link
;~ plug
(ifix [sel ser] (plus ;~(pose emph stri cods (text ser))))
;~ pose
%+ ifix [pel per]
;~ plug
;~(sfix (cook zing (most eol (plus ;~(less ace prn)))) ace)
(cook some (ifix [doq doq] (plus ;~(less doq ;~(pose prn eol)))))
==
%+ ifix [pel per]
;~(plug (cook zing (most eol (plus ;~(less per prn)))) (easy ~))
==
==
::
++ para (stag %para (full (spas fail))) :: paragraph
++ quot :: blockquotes
%+ stag %quot
%- full
|= tub=nail
^- (like down)
=- ?~ q.pre
[p.pre ~]
(apex [[1 1] (welp p.u.q.pre q.q.u.q.pre)])
^= pre %. tub
%+ cook |=(a=wall `tape`(zing a))
%- plus
;~ pfix ;~(pose ;~(plug gar ace) gar)
;~(pose (cook welp ;~(plug (star prn) (cold "\0a" eol))) (full (star prn)))
==
::
++ sepa :: separate blocs
%+ knee *wall |. ~+
=+ lin=;~(plug eol wits eol)
%+ ifix [(star whit) (star whit)]
%+ more ;~(plug eol wits (more wits eol))
;~ pose
(sepl (cold "-" hep))
(sepl (cold "*" tar))
(sepl (cold "+" lus))
(sepl (cook welp ;~(plug (star nud) (cold "." dot))))
(plus ;~(less lin ;~(pose prn ;~(simu ;~(plug eol prn) eol))))
==
::
++ sepl :: separate list
|* bus=_rule
%+ cook zing
%+ most ;~(pose ;~(plug wits eol) (easy ~))
%+ cook |=(a=wall `tape`(zing a))
;~ plug
%+ cook |=(a=wall `tape`(zing a))
;~ pose
;~(plug bus (cold " " ace) (plus prn) (cold "\0a" eol) (easy ~))
(full ;~(plug bus (cold " " ace) (plus prn) (easy ~)))
==
%- star
;~ pose
;~ pfix wits
;~(plug eol ace ace (cook welp ;~(plug (plus prn) (cold "\0a" eol))))
==
;~(plug ace ace (cook welp ;~(plug (plus prn) (cold "\0a" eol))))
(full ;~(plug ace ace (plus prn)))
==
==
::
++ stri :: strikethrough text
%+ stag %stri
(ifix [(jest '~~') (jest '~~')] (plus ;~(pose emph cods link (text fail))))
::
++ text |*(res=_rule (stag %text (plus ;~(less ;~(pose res dont) chrd))))
++ whit (mask ~[`@`0x20 `@`0x9 `@`0xa]) :: whitespace w/nl
++ wite (mask ~[`@`0x20 `@`0x9]) :: whitespace
++ wits (star wite)
::
:::::: down to manx
++ dank
|%
++ apex
|= don=down
^- marl
(turn don |=(bol=bloc (blok bol)))
++ blok
|= bol=bloc
^- manx
?- bol
[%head *]
:_ (turn q.bol sank)
[(cat 3 'h' (scot %ud p.bol)) ?~(r.bol ~ [[%id u.r.bol] ~])]
[%para *] [[%p ~] (turn p.bol sank)]
[%horz *] [[%hr ~] ~]
[%code *] [[%pre ~] ~[[[%$ [[%$ (zing p.bol)] ~]] ~]]]
[%quot *] [[%blockquote ~] (apex p.bol)]
[%lise *] [[%li ~] (apex p.bol)]
[%list *] ?: =(& p.bol) [[%ol ~] (apex q.bol)]
[[%ul ~] (apex q.bol)]
[%html *] p.bol
==
++ sank
|= san=span
^- manx
?- san
[%text *] [[%$ [[%$ p.san] ~]] ~]
[%brek *] [[%br ~] ~]
[%stri *] [[%del ~] (turn p.san ..$)]
[%cods *] [[%code ~] ~[[[%$ [[%$ p.san] ~]] ~]]]
[%emph *]
?: =(%ital p.san) [[%em ~] (turn q.san ..$)]
?: =(%bold p.san) [[%strong ~] (turn q.san ..$)]
[[%em ~] ~[[[%strong ~] (turn q.san ..$)]]]
[%link *]
?~ r.san [[%a ~[[%href q.san]]] (turn p.san ..$)]
[[%a ~[[%href q.san] [%title u.r.san]]] (turn p.san ..$)]
==
--
::
++ samp
"""
An h1 header
============
Paragraphs are separated by a blank line.
2nd paragraph. *Italic*, **bold**, ***both*** and `monospace`.
Hard line//break
Links: [link](foo.com "title")
Strikethrough text: ~~foo~~
> Block quotes are
> written like so.
>
> They can span multiple paragraphs,
> if you like.
Itemized lists
look like:
* this one
* that one
* the other one
---
"""
--
==
|= *
|= ~
^- bowl
:_ ~ :_ ~
:- %$
!>
(many:poxo (apex:dank (scan samp apex)) ~)

View File

@ -1,7 +0,0 @@
|= *
|= *
=+ a=1
=| b=(list)
|- ^- bowl
?: =(0 a) [~ ~]
$(a +(a), b [(bex (bex 13)) b])

View File

@ -1,37 +0,0 @@
!:
:: /=try=/bin/merge/hoon
:: Call with two desks and an optional germ as a merge option
::
=> .(-< `who=@p`-<)
=> .(+ =>(+ ^/=/main/=/lib/pony))
|= [est=time eny=@uw]
|= $: pes=[ses=span des=span cas=span ~]
pen=[sen=span den=span can=span ~]
gem=$|([germ ~] ~)
==
=+ vsr=((hard dome) .^(%cv pes))
=+ ves=((hard dome) .^(%cv pen))
%- (posh (add ~s1 est))
|= tim=@da
^- bowl
:_ ~
^- (list gift)
:_ ~
=+ ran=((hard rang) .^(%cu /(scot %p who)/main/(scot %da tim)))
=+ ^= sab ^- saba :*
(need (slaw 'p' ses.pes))
des.pes
[0 let.vsr]
vsr
==
=+ ^= lum
%- ~(construct-merge ze est ves ran)
[?~(gem %fine -.gem) (need (slaw 'p' sen.pen)) den.pen sab est]
?~ lum
^- gift
:* %la %leaf
"{(trip des.pes)} failed to apply, please rerun with a merge option"
==
?~ u.lum
`gift`[%la %leaf "{(trip den.pen)} is up to date"]
`gift`[%og den.pen u.u.lum]

View File

@ -1,10 +0,0 @@
!: :: To write Nock as an Arvo application in Hoon
|= * ::
|= [a=* ~] :: For educational purposes only
:_ ~ :_ ~ ::
:- %la :: Preserve this mysterious boilerplate square
%+ sell %noun::
.* a :: Replace the formula with your own
:::::::::::::::::
:: Formula: increment
[1 0]

View File

@ -1,7 +0,0 @@
|= * :: To use :honk code, pasted back
|= [a=* ~] ::
:_ ~ :_ ~ :: Preserve this mysterious boilerplate square
:+ %$ %noun ::
.* . ::
::::::::::::::::: Replace this with your Nock
[8 [1 0] [1 8 [1 0 0] [1 [[[1 24.940] 8 [9 97.964 0 4.095] 9 2 [0 4] [7 [0 3] [1 1.853.189.998] 2 [0 12] 1 1 0] 0 11] 1 0] 1 0] 0 1] 0 1]

View File

@ -1,7 +0,0 @@
!:
|= *
|= *
=+ a=1
|- ^- bowl
?: =(0 a) [~ ~]
$(a +(a))

View File

@ -1,45 +0,0 @@
!:
=> |%
++ norm
|* (pole ,_:/(*$&(_rule tape)))
?~ +< ~
=> .(+< [i=+<- t=+<+])
:_ t=$(+< t)
=+ rul=->->.i
^= i
?~ rul [%| p=rul]
?~ +.rul [%| p=rul]
?@ &2.rul [%| p=;;(tape rul)]
[%& p=rul]
++ parz
|* (list (each ,_rule tape))
?~ +< (easy ~)
?: ?=(| -.i) ;~(pfix (jest (crip p.i)) $(+< t))
%+ cook |*([* *] [i t]=+<)
;~(plug p.i $(+< t))
++ scanf
|* [tape (pole ,_:/(*$&(_rule tape)))]
=> .(+< [a b]=+<)
~! (scan "" (parz (norm ;"number {dim:ag}\-{dim:ag}")))
~! (norm ;"qwert{y/o/p/~}as{rule}d")
::=+ aaaa
%. (scan a (parz (norm b)))
|* (list)
?~ +< ~
?~ t i
[i $(+< t)]
--
|= ^
|= ~ :: [tape (pole ,_:/(*$&($+(nail edge) tape))) ~] ::$|(~ [p=gate ~])]
::=> .(+< [a=&1.+< b=&2.+<]) :: c=|2.+<])
=- ~[$/!>(res)]~
^= res
:::- (scanf a b)
:: (p.c ^+(+<.p.c (scanf a b)))
=+ n=;~(pfix (star (just '0')) (cook |=(@ud +<) dim:ag))
:- ^- @da %- year
=- `date`dat(- [%& -.dat], |6 ~[(div (mul |6.dat (bex 16)) 1.000)])
dat=(scanf "2014-08-12T02:11:57.030Z" ;"{n}\-{n}\-{n}T{n}:{n}:{n}.{n}Z")
=+ (scanf "It is 12:54, offset 2" ;"It is {n}:{n}, offset {n}")
~! -
`[p=@ q=@ r=@]`-

View File

@ -1,3 +0,0 @@
|= ^
|= [a=manx ~]
=- ~[te/[(crip (poxo a))]~]~

View File

@ -1,147 +0,0 @@
!:
:: /=main=/bin/app/hoon
::
=> %= .
+
=> +
!:
|%
++ bqno |* [a=_,* b=_,*] :: binary skew queno
$: r=@u :: rank/depth
k=a :: priority
n=b :: value
c=(bque a b) :: children
== ::
++ bque |* [a=_,* b=_,*] :: binary skew que
(list (bqno a b)) ::
++ pr !: :: priority queue
|* [key=$+(* *) val=$+(* *)]
|= cmp=$+([key key] ?) :: lte=min, gte=max
|%
++ link
|= [p=(bqno key val) q=(bqno key val)] :: link eq rank
^- (bqno key val)
?> =(r.p r.q)
?: (cmp k.p k.q)
[r=+(r.p) k=k.p n=n.p c=[i=q t=c.p]]
[r=+(r.q) k=k.q n=n.q c=[i=p t=c.q]]
++ slink :: skew link
|= [p=(bqno key val) q=(bqno key val) r=(bqno key val)]
^- (bqno key val)
~! p
~! q
~! r
?: &((cmp k.q k.p) (cmp k.q k.r))
[r=+(r.q) k=k.q n=n.q c=[i=p t=[i=r t=c.q]]]
?: &((cmp k.r k.p) (cmp k.r k.q))
[r=+(r.r) k=k.r n=n.r c=[i=p t=[i=q t=c.r]]]
[r=+(r.q) k=k.p n=n.p c=[i=q t=[i=r t=~]]]
++ ins :: internal ins op
|= [p=(bqno key val) q=(bque key val)]
^- (bque key val)
?~ q [p ~]
?> (lte r.p r.i.q)
?: (lth r.p r.i.q)
[i=p t=q]
$(p (link p i.q), q t.q)
++ uniq :: remove init dup
|= q=(bque key val)
?~ q ~
(ins i.q t.q)
++ meuq :: unique meld
|= [p=(bque key val) q=(bque key val)]
^- (bque key val)
?~ p q
?~ q p
?: (lth r.i.p r.i.q)
[i.p $(p t.p)]
?: (lth r.i.q r.i.p)
[i.q $(q t.q)]
(ins (link i.p i.q) $(p t.p, q t.q))
++ gmi :: getmin
|= q=(bque key val)
^- [i=(bqno key val) t=(bque key val)]
?~ q ~|(%fatal-gmi-empty !!)
?~ t.q [i=i.q t=~]
=+ r=$(q t.q)
?: (cmp k.i.q k.i.r)
[i=i.q t=t.q]
[i=i.r t=[i.q t.r]]
++ spli :: split
::|* p=(bque) q=(list ,[k=,_+<-.cmp n=*]) r=(bque)
|= [p=(bque key val) q=(list ,[k=key n=val]) r=(bque key val)]
^- [t=(bque key val) x=(list ,[k=key n=val])]
?~ r
[t=p x=q]
?: =(0 r.i.r)
$(q [[k=k.i.r n=n.i.r] q], r t.r)
$(p [i.r p], r t.r)
++ insl :: insert list
::|* [p=(list, [k=,_+<-.cmp n=*]) q=(bque)]
|= [p=(list ,[k=key n=val]) q=(bque key val)]
^- (bque key val)
?~ p q
$(p t.p, q (insert q i.p))
::
:: :: public interface
::
++ insert :: real ins
|= [q=(bque key val) k=key n=val]
^- (bque key val)
?~ q [i=[r=0 k=k n=n c=~] t=~]
?~ t.q [i=[r=0 k=k n=n c=~] t=q]
?: =(r.i.q r.i.t.q)
[i=(slink [r=0 k=k n=n c=~] i.q i.t.q) t=t.t.q]
[i=[r=0 k=k n=n c=~] t=q]
++ meld :: concat
|= [p=(bque key val) q=(bque key val)]
^- (bque key val)
(meuq (uniq p) (uniq q))
++ peek :: find min/max
|= q=(bque key val)
^- [k=key n=val]
?~ q ~|(%empty-bque-peek !!)
?~ t.q [k=k.i.q n=n.i.q]
=+ m=$(q t.q)
?: (cmp k.i.q k.m) [k=k.i.q n=n.i.q] m
++ pop :: delete min/max
|= q=(bque key val)
^- [r=[k=key n=val] q=(bque key val)]
::^- [q=(bque key val) r=[k=key n=val]]
?~ q ~|(%empty-bque-pop !!)
=+ m=(gmi q)
=+ s=(spli ~ ~ c.i.m)
[q=[k=k.i.m n=n.i.m] r=(insl x.s (meld t.m t.s))]
::[q=(insl x.s (meld t.m t.s)) r=[k=k.i.m n=n.i.m]]
--
--
==
|= *
|= ~
^- bowl
:_ ~ :_ ~
:- %$
!>
!:
=+ pri=((pr ,@ ,@) lte)
=+ pq=(insert.pri ~ 6 3)
=. pq (insert.pri pq 5 2)
=. pq (insert.pri pq 2 5)
=+ pq2=(insert.pri ~ 508 1.084)
=. pq2 (insert.pri pq2 42 75)
=. pq2 (insert.pri pq2 325 562)
=. pq2 (insert.pri pq2 41 822)
=. pq (meld.pri pq pq2)
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
=^ r pq (pop.pri pq)
~& r
pq

View File

@ -1,84 +0,0 @@
|%
++ doss
$: sap=,@ud :: sample count
hit=(map term ,@ud) :: hit points
cut=(map span hump) :: cut points
==
::
++ hump
$: sap=,@ud :: sample count
inn=(map span ,@ud) :: calls into
out=(map span ,@ud) :: calls out of
==
::
++ pi
|_ day=doss
++ heck :: report event
|= [nam=@tas day=doss]
^- day
=+ lam=(~(get by hit.day) nam)
day(hit (~(put by hit.day) ?~(lam 1 +(u.lam))))
::
++ noon :: sample trace
|= pax=path
=| lax=(unit span)
|- ^- day
?~ pax day(sap +(sap.day))
%= $
pax t.pax
lax `i.pax
cut.day
%+ ~(put by cut.day) i.pax
^- hump
=+ nax=`(unit span)`?~(t.pax ~ `i.t.pax)
=+ hup=`hump`=+(hup=(~(get by cut) i.pax) ?^(hup u.hup [0 ~ ~]))
:+ +(sap.hup)
?~ lax inn.hup
=+(hag=(~(get by inn.hup) u.lax) ?~(hag 1 +(u.hag)))
?~ nax out.hup
=+(hag=(~(get by out.hup) u.nax) ?~(hag 1 +(u.hag)))
==
::
++ tell :: produce dump
^- (list tape)
;: welp
^- (list tape)
[(welp "events: " (scow %ud sap.day)) ~]
::
^- (list tape)
%+ turn
(~(tap by hit.day) ~)
|= [nam=term num=@ud]
:(welp (trip nam) ": " (scow %ud num))
["" ~]
::
^- (list tape)
%- welp
%+ turn
(~(tap by cut.day) ~)
|= [nam=term hup=hump]
^- (list tape)
;: welp
[(welp "sector: " (trip nam)) ~]
::
[(welp "weight: " (div (mul 1.000 sap.hup) sap.day)) ~]
::
["inn:" ~]
::
%+ turn
(~(tap by inn.hup) ~)
|= [nam=term num=@ud]
^- tape
:(welp " " (trip nam) ": " (scow %ud num))
::
["out:" ~]
::
%+ turn
(~(tap by out.hup) ~)
|= [nam=term num=@ud]
^- tape
:(welp " " (trip nam) ": " (scow %ud num))
==
==
--
--

View File

@ -1,26 +0,0 @@
!:
:: /=try=/bin/reverse/hoon
::
|= *
|= ~
:- ~ :- ~
:- ^- (list slip)
:~ [~ %$ %atom %t]
==
|= [now=@da pax=path nut=note]
^- bowl
?+ -.nut !!
%$
?~ p.nut
[~ ~]
=+ liz=((hard (list ,@t)) q.u.p.nut)
:- ^- (list gift)
:~ :+ %mu [%atom %t]
(turn liz |=(a=@t (rap 3 (flop (trip a)))))
==
:- ~
:- ^- (list slip)
:~ [~ %$ %atom %t]
==
..$
==

View File

@ -1,54 +0,0 @@
!:
:: /=try=/bin/revert/hoon
:: Call with desk & change to revert
::
=> .(-< `who=@p`-<)
=> .(+ =>(+ ^/=/main/=/lib/pony))
|= [est=time eny=@uw]
|= $: des=span
cas=@ud
~
==
=+ dom=((hard dome) .^(%cv /=/[des]/=))
::%- (posh (add ~s1 est))
::|= tim=@da
=+ tim=est
^- bowl
:_ ~
^- (list gift)
:_ ~
=+ ran=((hard rang) .^(%cu /(scot %p who)/main/(scot %da tim)))
=+ hed=(~(got by hut.ran) (~(got by hit.dom) let.dom))
=+ rev=(~(got by hut.ran) (~(got by hit.dom) cas))
?~ p.rev !!
=+ nex=(~(got by hut.ran) i.p.rev)
=+ ^= vex
%- %~ zoal ze
:+ est dom ran
:- [r.rev ~]
:- q.nex
est
=+ run=ran(hut (~(put by hut.ran) r.vex vex)) :: hack
=+ ^= gar
%- %- %~ merge ze
:+ est dom ran
:- [who des]
[who des]
:- vex
:- hed
:- tim
%- %~ strat ze
:+ est dom run
%meld
=+ ^= yak
%- %~ zoal ze
:+ est dom ran
:- [r.hed ~]
:- q.-.gar
est
=+ hek=+.gar
=+ lat=-:(~(aqel ze est dom ran) hek ~)
=+ hut=(~(put by _(map tako yaki)) r.yak yak)
=+ let=+(let.dom)
=+ hit=(~(put by _(map ,@ud tako)) let r.yak)
`gift`[%og des [let hit hut lat]]

View File

@ -1,75 +0,0 @@
!:
:: /=try=/bin/revert/hoon
:: Call with desk & change to revert
::
=> .(-< `who=@p`-<)
=> .(+ =>(+ ^/=/main/=/lib/pony))
|= [est=time eny=@uw]
|= $: des=span
fas=(list ,@ud)
==
=+ dom=((hard dome) .^(%cv /=/[des]/=)) :: should be instant
=+ cas=?~(fas let.dom i.fas) :: default to head
::%- (posh (add ~s1 est))
::|= tim=@da
=+ tim=est
^- bowl
:_ ~
^- (list gift)
=+ ran=((hard rang) .^(%cu /(scot %p who)/main/(scot %da tim)))
=+ hed=(~(got by hut.ran) (~(got by hit.dom) cas))
=+ ^= par
?~ fas ?~ p.hed !! (~(got by hut.ran) i.p.hed)
?~ t.fas ?~ p.hed !! (~(got by hut.ran) i.p.hed)
(~(got by hut.ran) (~(got by hit.dom) i.t.fas)) :: explicit
=+ ^= dif
%- %~ zerg ze
:+ est dom ran
?~ fas [par hed]
?~ t.fas [par hed]
[hed par]
=+ ^= sla
|= pat=path
%+ roll %+ turn pat |= t=@t (cat 3 '/' t)
|= [t=@t a=@t]
(cat 3 a t)
%- |= lin=(list ,@t)
:- [%la %leaf (trip (cat 3 '%show ' (scot %u cas)))]
%+ turn lin
|= lan=@t ^- gift
[%la %leaf (trip lan)]
%+ roll (~(tap by dif) ~)
|= [[pat=path mis=miso] lin=(list ,@t)]
?- -.mis
%del [(cat 3 '%del ' (sla pat)) lin]
%ins [(cat 3 '%ins ' (sla pat)) lin]
%mut ?> ?=(%c -.q.p.mis)
=+ ^= con
%- lore
%- (hard ,@)
%- %~ zaul ze
:+ est dom ran
(~(got by q.par) pat)
%+ welp lin
%+ welp [(cat 3 '%mut ' (sla pat)) ~]
^- (list ,@t)
=< q
%+ roll ((hard (urge ,@t)) p.q.p.mis)
|= [p=(unce ,@t) [q=(list ,@t) r=@ud]]
?- -.p
%& [q (add r p.p)]
%| =+ old=((hard (list ,@t)) p.p)
=+ new=((hard (list ,@t)) q.p)
=+ ^= pre
?: =(r 0) ~
(slag (dec r) con)
:_ (add r (lent p.p))
^- (list ,@t)
%+ welp q
%+ welp :_ ~ (cat 3 '%chunk ' (scot %u r))
%+ welp ?~ pre ~ :_ ~ (cat 3 '|| ' i.pre)
%+ welp %- flop %+ turn old |= t=@t (cat 3 '-< ' t)
%- flop %+ turn new |= t=@t (cat 3 '+> ' t)
==
==
::`gift`[%og des [let hit hut lat]]

View File

@ -1,11 +0,0 @@
!:
=> .(+ =>(+ ^/=main=/lib/pony))
|= [est=@da *]
|= [sle=@dr ~]
^- bowl
%+ pomp "sleeping for {(scow %dr sle)}..."
%- (posh (add est sle))
|= now=@da
:_ ~
:~ [%la %leaf "slept."]
==

View File

@ -1,31 +0,0 @@
!:
:: /=try=/toy/diff/hoon
::
|= [who=seat est=time eny=@uw was=path]
|= ~
:_ ~
=< main
|%
++ main
^- (list gift)
=+ pod=test
|- ^- (list gift)
?~ pod ~
=+ dis=(loss p.i.pod q.i.pod)
?> =((lurk p.i.pod (lusk p.i.pod q.i.pod dis)) q.i.pod)
:- [%la %leaf "{p.i.pod} to {q.i.pod}: loss {dis}"]
$(pod t.pod)
::
++ fake
=+ ram=(shax eny)
=+ inx=0
|- ^- tape
?: =(inx 128) ~
[[(add 'a' (end 0 2 ram))] $(inx +(inx), ram (rsh 0 2 ram))]
::
++ test
=+ inx=0
|- ^- (list ,[p=tape q=tape])
?: =(inx 32) ~
[[fake(eny (add 1 eny)) fake(eny (add 2 eny))] $(inx +(inx), eny (add 3 eny))]
--

View File

@ -1,12 +0,0 @@
!:
:: /=try=/bin/till/hoon
::
=> .(- `[who=@p how=path]`-)
|= [est=time eny=@uw]
|= [pax=path ~]
^- bowl
=+ gen=(reck pax)
=+ ken=q:(~(mint ut %noun) %noun gen)
=+ pac=(jam ken)
:_ ~ :_ ~
[%xx %save [%test %pill ~] pac]

View File

@ -1,9 +0,0 @@
!: :: To write a trivial Hoon program
|= * ::
|= [x=@ ~] :: For educational purposes only
:_ ~ :_ ~ ::
:- %$ :: Preserve this mysterious boilerplate square
!> ::
::::::::::::::::: Produce a value below
~& %foo
(add 2 x)

View File

@ -1,116 +0,0 @@
!: :: /=try=/bin/http/hoon
!? 164
::::
::
=> %= .
+
=> +
|%
::
++ sifo
|= tig=@
^- tape
=+ poc=(mod (sub 3 (mod (met 3 tig) 3)) 3)
=+ pad=(lsh 3 poc (swap 3 tig))
=+ ^= ska
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
=+ ^= sif
%- flop
|- ^- tape
?~ pad
~
=+ d=(end 0 6 pad)
[(snag d ska) $(pad (rsh 0 6 pad))]
(weld (scag (sub (lent sif) poc) sif) (trip (fil 3 poc '=')))
::
++ cuss :: upper
|= vib=tape
^- @t
%+ rap 3
(turn vib |=(a=@ ?.(&((gte a 'a') (lte a 'z')) a (sub a 32))))
::
++ hmac
|= [key=@ mes=@]
=+ ip=(fil 3 64 0x36)
=+ op=(fil 3 64 0x5c)
=+ ^= kex
?: (gth (met 3 key) 64)
(lsh 3 44 (shan (swap 3 key)))
(lsh 3 (sub 64 (met 3 key)) (swap 3 key))
=+ inn=(shan (swap 3 (cat 3 (swap 3 mes) (mix ip kex))))
(shan (swap 3 (cat 3 inn (mix op kex))))
::
++ unt |=(a=@ (div (sub a ~1970.1.1) (bex 64)))
::
++ curl
|= [met=meth req=[p=path q=tape r=purl] head=math body=(unit octs)]
=+ ^= work
|= [now=@da pax=path not=note]
^- bowl
?> ?=([%hp *] not)
?~ r.p.not
!!
:_ ~
^- (list gift)
[[%$ !>((trip q.u.r.p.not))] ~]
=+ gifts=`(list gift)`[[%tq p.req [r.req [met head body]]] ~]
=+ stuff=[~ `(list slip)`[[p.req [%hp ~]] ~] work]
^- bowl
[gifts stuff]
++ req
|= a=tape
^- [p=path q=tape r=purl]
[`path`[(scot %t (rap 3 a)) ~] a (scan a auri:epur)]
::
++ app
|% ++ cok 'hDDOTPfGHGlsOUbhpy6qc6XbW'
++ cos 'olCkea6wm3XG4pnVCHuPIozUF2ggH1sHjnBtuT4Ai6rCOeQGzO'
++ aok '2485712317-R77Lpdu5rAJadRVxTXPpnxvcwS0IfNG7QEzLPty'
++ aos 'a41d83XId0P7QQbodkPYv3zxoEL0Cq9EsN2eXZBZAwAWA'
--
::
++ oath
|_ [met=meth lur=tape et=@ en=@]
++ non (turn (rip 2 (shaw et 128 en)) |=(a=@ ~(x ne a)))
++ tim (slag 2 (scow %ui (unt et)))
::
++ bas ^- tape
;: weld (trip (cuss (trip `@t`met))) "&" (urle lur) "&"
%- urle
;: weld
"oauth_consumer_key=" (trip cok:app) "&"
"oauth_nonce=" non "&"
"oauth_signature_method=HMAC-SHA1&"
"oauth_timestamp=" tim "&"
"oauth_token=" (trip aok:app) "&"
"oauth_version=1.0"
==
==
++ sky ^- @t
(crip :(weld (urle (trip cos:app)) "&" (urle (trip aos:app))))
++ sig ^- tape
(sifo (swap 3 (hmac (swap 3 sky) (crip bas))))
++ hed
%- crip
;: weld "OAuth "
"oauth_consumer_key=" "\"" (trip cok:app) "\", "
"oauth_nonce=" "\"" non "\", "
"oauth_signature=" "\"" (urle sig) "\", "
"oauth_signature_method=\"HMAC-SHA1\", "
"oauth_timestamp=" "\"" tim "\", "
"oauth_token=" "\"" (trip aok:app) "\", "
"oauth_version=1.0"
==
--
--
==
|= [est=time eny=@uw]
|= ~
^- bowl
::::
=+ a="https://api.twitter.com/1.1/help/privacy.json"
=+ token=~(hed oath %get a est eny)
=+ ^= head
%- ~(gas by *math)
[['Authorization' [token ~]] ~]
(curl %get (req a) head ~)

View File

@ -1,43 +0,0 @@
!: :: /=try=/bin/env/hoon
!? 164
::::
=> .(- `[who=@p how=path]`-)
=> .(- [woh=(scot %p who) -])
=> .(+ =>(+ ^/=main=/lib/pony))
::::
|= [est=time eny=@]
|= [loc=[mih=span dez=span caz=span sup=path] ~]
::::
?. =(woh mih.loc)
~|("you are not {(trip mih.loc)}!" !!)
=+ yaz=(zu ((hard ankh) .^(%cz mih.loc dez.loc caz.loc ~)))
%+ pomp "appending to {(dart:ut loc)}..."
=< work
|%
++ pend
|= den=@t
^- [(list gift) _+>]
=+ nyp=`soba`[*cart (turn (plan den) |=(p=miso [sup.loc p]))]
:- [[%ok dez.loc `nori`[%& ~ nyp]] ~]
=. yaz (durn:yaz nyp)
+>.$
::
++ plan
|= den=@t
^- (list miso)
=+ cur=q:ank:(deny:yaz sup.loc)
?~ cur
[[%ins den] ~]
?^ q.u.cur
[[%del q.u.cur] [%ins den] ~]
[[%mut ((diff %c) q.u.cur (cat 3 q.u.cur den))] ~]
::
++ work
|- ^- bowl
%+ (polo %text "> " ~ ~)
(plus alp)
|= [now=@da txt=tape]
^- bowl
=^ giv +.^$ (pend (rap 3 (weld txt `tape`[`@`10 ~])))
(pome giv ^$)
--

View File

@ -1,10 +0,0 @@
!:
|= *
|= ~
^- bowl
:_ ~
=+ inx=0
|- ^- (list gift)
?: =(inx 256) ~
:_ $(inx +(inx))
[%la %leaf "0 :: {(scow %ud inx)}, {(scow %p inx)}"]

View File

@ -1,37 +0,0 @@
Some obscure `:-` irregular forms.
==================================
Moveme: irregular form doc
###Infix `^`
```
~zod/main=/app> 1^2^3
[1 2 3]
```
`a^b` is equivalent to `:- a b`
###Infix `/`
```
~zod/main=/app> a/1
[%a 1]
~zod/main=/app> a/'twig'
[%a 'twig']
```
Like `^`, but first item must be a term, and is cubed. Used to construct paths
and fronds.
###Prefix `` ` ``, postfix `~`
```
~zod/main=/app> ````20
[~ ~ ~ ~ 20]
~zod/main=/app> [42 30]~
[[42 30] ~]
```
Complimenting each other, these construct pairs with nil in the head and tail
respectively. Multiple postfix `~` do not work for unknown reasons.

View File

@ -1,5 +0,0 @@
!:
:: /=try=/nub/diff/hoon
::
|%
--

View File

@ -1,75 +0,0 @@
::
:: Markdown in Hoon.
::
=<
|%
++ markdown :: block elements
$& [p=markdown q=markdown]
$% [%$ p=markline] :: plain text
[%cobl p=(list ,@t)] :: code block
[%head p=head-level q=markline] :: heading
[%html p=manx] :: inline html
[%list p=(unit list-order) q=(list markdown)] :: un/ordered list
[%quot p=markdown] :: block quote
==
++ markline :: inline elements
$& [p=markline q=markline]
$% [%$ p=@t] :: plain text
[%bold p=markline-bold] :: strong emphasis
[%coli p=@t] :: inline code
[%emph p=markline-emph] :: emphasis
[%link p=purl q=markline-link r=(unit ,@t)] :: anchor
==
--
|%
++ head-level
|= a=*
?@ a
?:(|((lth a 1) (gth a 6)) 1 a)
1
++ list-order ,[p=?(%a %aa %1) q=@] :: list type/start
++ markline-bold
$& [p=markline-bold q=markline-bold]
$% [%$ p=@t]
[%coli p=@t]
[%emph p=markline-bold-emph]
[%link p=purl q=markline-bold-link r=(unit ,@t)]
==
++ markline-emph
$& [p=markline-emph q=markline-emph]
$% [%$ p=@t]
[%bold p=markline-bold-emph]
[%coli p=@t]
[%link p=purl q=markline-emph-link r=(unit ,@t)]
==
++ markline-link
$& [p=markline-link q=markline-link]
$% [%$ p=@t]
[%bold p=markline-bold-link]
[%coli p=@t]
[%emph p=markline-emph-link]
==
++ markline-bold-emph
$& [p=markline-bold-emph q=markline-bold-emph]
$% [%$ p=@t]
[%coli p=@t]
[%link p=purl q=markline-bold-emph-link r=(unit ,@t)]
==
++ markline-bold-link
$& [p=markline-bold-link q=markline-bold-link]
$% [%$ p=@t]
[%coli p=@t]
[%emph p=markline-bold-emph-link]
==
++ markline-emph-link
$& [p=markline-emph-link q=markline-emph-link]
$% [%$ p=@t]
[%bold p=markline-bold-emph-link]
[%coli p=@t]
==
++ markline-bold-emph-link
$& [p=markline-bold-emph-link q=markline-bold-emph-link]
$% [%$ p=@t]
[%coli p=@t]
==
--

View File

@ -1,4 +0,0 @@
!:
|= [for=@tas pre=path mid=path but=path]
%- crip
"<html><body>Goodbye, Galen {<[for pre mid but]>} (from Hoon)!</body></html>"

View File

@ -1,382 +0,0 @@
This chapter covers....
##++bex
++ bex :::::: binary exponent
~/ %bex :: jet
|= a=@ :: gate, atom sample
^- @ :: cast result as atom
?: =(0 a) :: if a is 0
1 :: then, produce 1
(mul 2 $(a (dec a))) :: mul 2*2 n times
`++bex` takes an atom `a` and produces `2^a`.
###Summary
`++bex` is a [jetted arm]().
`++bex` creates a dry `%gold` gate using [|=](), which accepts an atomic sample `a`, [axil @](), with [=, the irregular form of ^=]().
The result of `++bex` is then cast to an atom with [^-]().
If `a` is equal to 0, `++bex` produces 1.
Otheriwse, `++bex` returns the product of 2 and `++bex` with the value of `a` replaced by [dec a]().
###Examples
~ronrem-lonsem/try=> (bex 3)
8
~ronrem-lonsem/try=> (bex 1)
2
~ronrem-lonsem/try=> (bex 42)
4.398.046.511.104
~ronrem-lonsem/try=> (bex 0)
1
##++can
++ can :: assemble
~/ %can :: jet
|= [a=bloq b=(list ,[p=@ q=@])] :: gate, sample: bloq, list
^- @ :: cast result to atom
?~ b :: if b is ~
0 :: then, return 0
(mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b))) :: else,
++can accepts a bloq `a` and a list of cells `b`. ++can assembles bloqs of size `a` pulled from the list of atoms `b` and produces an atom.
###Summary
++can is a [jetted arm]() that takes a [bloq]() and [list](), labeled 'a' and 'b' respectively using [=, the irregular form of ^=](). Using [^-](), ++can casts its result to an atom. ++can then uses [?~]() to determine whether the value of 'b' is null, and thus the end of the list. If yes, then ++can returns 0. Otherwise, ++can calls ++mix with two arguments: 1. ++end with [bloq]() size 'a', used 'p' number of times (p.i.b means the 'p' value of the head of list b, so here 'p' is the first 'p' of list 'b'), applied to the first 'q' of list 'b'; and, 2. ++lsh with [bloq]() size 'a',the 'p' of the head of [list]() 'b', and the result of recursively calling ++can with the value of [list]() 'b' now set to its tail.
##Examples
~ronrem-lonsem/try=> `@ub`(can 3 ~[[1 1]])
0b1
~ronrem-lonsem/try=> `@ub`(can 0 ~[[1 255]])
0b1
~ronrem-lonsem/try=> `@ub`(can 1 ~[[1 2]])
0b10
~ronrem-lonsem/try=> `@ub`(can 1 ~[[1 3]])
0b11
~ronrem-lonsem/try=> `@ub`(can 1 ~[[1 4]])
0b0
~ronrem-lonsem/try=> `@ub`(can 1 ~[[2 4]])
0b100
##++cat
++ cat :: concatenate
~/ %cat :: jet
|= [a=bloq b=@ c=@] :: gate, bloq, 2 @ sample
(add (lsh a (met a b) c) b) :: add b to c lshifted by # of bloqs in b
++cat accepts a bloq a and two atoms b and c. ++cat produces b and c concatenated obeying the bloq size a.
###Summary
++cat is a [jetted arm]() that takes a [bloq]() 'a', and two atoms of [axil @]() labeled 'b' and 'c' with [=, the irregular form of ^=](). ++cat then uses [++met]() to measure the number of [bloqs]() of size 'a' that comprise 'b'. 'c' is then left-shifted by the same number of [bloqs]() of size 'a', and then added ([++add]()) to 'b'.
###Examples
~ronrem-lonsem/try=> `@ub`(cat 1 1 0)
0b1
~ronrem-lonsem/try=> `@ub`(cat 2 1 0)
0b1
~ronrem-lonsem/try=> `@ub`(cat 4 1 0)
0b1
~ronrem-lonsem/try=> `@ub`(cat 0 1 1)
0b11
~ronrem-lonsem/try=> `@ub`(cat 0 2 1)
0b110
~ronrem-lonsem/try=> `@ub`(cat 2 1 1)
0b1.0001
~ronrem-lonsem/try=> `@ub`256
0b1.0000.0000
~ronrem-lonsem/try=> `@ub`255
0b1111.1111
~ronrem-lonsem/try=> `@ub`(cat 3 256 255)
0b1111.1111.0000.0001.0000.0000
~ronrem-lonsem/try=> `@ub`(cat 2 256 255)
0b1111.1111.0001.0000.0000
~ronrem-lonsem/try=> (cat 3 256 255)
16.711.936
##++cut
++ cut :: slice
~/ %cut :: jet
|= [a=bloq [b=@ c=@] d=@] :: gate, sample: bloq, cell of @, @
(end a c (rsh a b d))
++cut accepts a bloq a, a cell of atoms b and c and an atom d.
++cut takes the [++tail]() of d right-shifted ([++rsh()) by a bloq of size a, b number of times
?? this sentence should be different, but i'm a bit unclear on what exactly this does. perhaps the examples should be cast as @ub?
###Summary
++cut is a [jetted arm]() that creates a dry %gold gate using [|=](), whose sample takes a [bloq](), a cell of two atoms of[axil @](), labeled 'b' and 'c' respectively, and an atom of [axil @](), labeled 'd'. All of these lables are produced by [=, the irregular form of ^=](). ++cut then [right-shifts (++rsh)]() 'd' by 'b' number of bloqs of size 'a'. ++cut then calls the arm [++end]() to return the tail of the result of [right-shifting]() 'd'. The size of the tail is determined by the number of bloqs 'c' of size 'a'.
###Examples
~ronrem-lonsem/try=> (cut 0 [1 1] 2)
1
~ronrem-lonsem/try=> (cut 0 [2 1] 4)
1
~ronrem-lonsem/try=> (cut 3 [1 1] 256)
1
~ronrem-lonsem/try=> (cut 2 [1 1] 255)
15
~ronrem-lonsem/try=> (cut 1 [1 1] 255)
3
~ronrem-lonsem/try=> (cut 1 [1 2] 255)
15
##++end
++ end :: tail
~/ %end :: jet
|= [a=bloq b=@ c=@] :: gate, bloq, 2 @ sample
(mod c (bex (mul (bex a) b))) :: c % 2^(2^a * b)
++end takes a bloq a, and atoms c and d. ++end returns the tail of c, whose length is determined by the number of bloqs b, of size a
###Summary
++end is a [jetted arm]() which creates a dry %gold gate using [|=](), whose sample takes a [bloq]() and two atoms of [axil @](), labeled 'b' and 'c' with [=, the irregular form of ^=](). ++end returns the remainder of dividing c by the result of [++bex]() of [++bex]() multiplied by b.
###Examples
~ronrem-lonsem/try=> `@ub`12
0b1100
~ronrem-lonsem/try=> `@ub`(end 0 3 12)
0b100
~ronrem-lonsem/try=> (end 0 3 12)
4
~ronrem-lonsem/try=> `@ub`(end 1 3 12)
0b1100
~ronrem-lonsem/try=> (end 1 3 12)
12
~ronrem-lonsem/try=> (end 3 1 256)
0
~ronrem-lonsem/try=> (end 3 1 255)
255
##++lsh
++ lsh :: left-shift
~/ %lsh :: jet
|= [a=bloq b=@ c=@] :: gate, bloq, 2 @ sample
(mul (bex (mul (bex a) b)) c) :: c * (2^(2^a * b))
++lsh takes a bloq a and atoms b and c. ++lsh produces c shifted 'b' bloqs of size 'a' to the left.
###Summary
++lsh is a [jetted arm]() which creates a dry %gold gate using [|=](), whose sample takes a [bloq]() and two atoms of [axil @](), labeled 'b' and 'c' with [=, the irregular form of ^=](). ++lsh multiplies 'c' by the result of [++bex]() of the product of [++bex]() of 'a' multiplied by 'b'.
###Examples
~ronrem-lonsem/try=> `@ub`1
0b1
~ronrem-lonsem/try=> `@ub`(lsh 0 1 1)
0b10
~ronrem-lonsem/try=> (lsh 0 1 1)
2
~ronrem-lonsem/try=> `@ub`255
0b1111.1111
~ronrem-lonsem/try=> `@ub`(lsh 3 1 255)
0b1111.1111.0000.0000
~ronrem-lonsem/try=> (lsh 3 1 255)
65.280
##++met
++ met :: measure
~/ %met :: jet
|= [a=bloq b=@] :: gate, bloq, @ sample
^- @ :: cast res to @
=+ c=0 :: c=0 to sample
|- :: trap
?: =(0 b) :: if b is 0
c :: then return c
$(b (rsh a 1 b), c +(c)) :: sub values, recurse
++met accepts a bloq a and an atom b. ++met produces a count of bloqs of size 'a' in atom 'b'.
###Summary
++met is a [jetted arm]() which creates a dry %gold gate using [|=](), whose sample takes a [bloq]() and an atom of [axil @](), labeled 'b' with [=, the irregular form of ^=](). ++met uses [^-]() to cast its result to an atom of [axil @](), and uses [=+]() to push a variable 'c' onto the sample with a value of 0. Then ++met declares a [trap]() to enable recursion. If 'b' is equal to 0, then 'c' is returned. Otherwise, ++met recurses, this time with the value of 'b' set to the result of right-shifting ([++rsh]()) 'b' by one bloq of size 'a' to the right, with with the value of c set to +(c) [.+](). When the value of 'b' reaches 0, ++met returns the value of 'c', which will represent the number of bloqs of size 'a' b initially posessed.
###Examples
~ronrem-lonsem/try=> (met 0 1)
1
~ronrem-lonsem/try=> (met 0 2)
2
~ronrem-lonsem/try=> (met 3 255)
1
~ronrem-lonsem/try=> (met 3 256)
2
++ rap :: assemble nonzero
~/ %rap :: jet
|= [a=bloq b=(list ,@)] :: gate, bloq, list in sample
^- @ :: cast result to @
?@ b :: if b is an @
0 :: then, return 0
(cat a i.b $(b t.b)) :: else ++cat
++ rep :: assemble single
~/ %rep
|= [a=bloq b=(list ,@)]
^- @
=+ c=0
|-
?@ b
0
(con (lsh a c (end a 1 i.b)) $(c +(c), b t.b))
++rep is a [jetted arm]() that takes a [bloq]() and [list](), labeled 'a' and 'b' respectively using [=, the irregular form of ^=](). ++rep casts its result to an atom using [^-]() and then, using [=+](), it pushes a variable 'c' onto the sample and sets its value equal to 0. In order to loop, ++rep then declares a [trap]() using [|-](). The trap uses [?@]() to test whether 'b' is an atom or not. If yes, ++rep returns 0. Otherwise, ++rep returns ++con, which it passes two arguments: 1. ++lsh with [bloq]() size 'a', number of times 'c', and the [tail] of the head of 'b'; and, 2.
++ rip :: disassemble
~/ %rip
|= [a=bloq b=@]
^- (list ,@)
?: =(0 b)
~
[(end a 1 b) $(b (rsh a 1 b))]
::
##++rsh
++ rsh :: right-shift
~/ %rsh :: jet
|= [a=bloq b=@ c=@] :: gate, bloq, 2 @ sample
(div c (bex (mul (bex a) b))) :: c / 2^(2^a * b)
++lsh takes a bloq a and atoms b and c. ++lsh produces c shifted 'b' bloqs of size 'a' to the right.
###Summary
++rsh [jetted arm]() which creates a dry %gold gate using [|=](), whose sample takes a [bloq]() and two atoms, [axil @](), labeled 'b' and 'c' with [=, the irregular form of ^=](). ++rsh divides 'c' by the result of [++bex]() of the product of [++bex]() of 'a' multiplied by 'b'.
###Examples
~ronrem-lonsem/try=> `@ub`145
0b1001.0001
~ronrem-lonsem/try=> `@ub`(rsh 1 1 145)
0b10.0100
~ronrem-lonsem/try=> (rsh 1 1 145)
36
~ronrem-lonsem/try=> `@ub`(rsh 2 1 145)
0b1001
~ronrem-lonsem/try=> (rsh 2 1 145)
9
~ronrem-lonsem/try=> `@ub`10
0b1010
~ronrem-lonsem/try=> `@ub`(rsh 0 1 10)
0b101
~ronrem-lonsem/try=> (rsh 0 1 10)
5
~ronrem-lonsem/try=> `@ub`1
0b1
~ronrem-lonsem/try=> (rsh 0 1 1)
0
~ronrem-lonsem/try=> (rsh 0 1 1)
0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2cB, bit logic ::
::
++ con :: binary or
~/ %con :: jet
|= [a=@ b=@] :: gate, 2 @ sample
=+ [c=0 d=0] :: c=0, d=0 on sample
|- ^- @ :: trap that returns @
?: ?&(=(0 a) =(0 b)) :: if both a, b are 0
d :: then, return d
%= $ :: else, loop with:
a (rsh 0 1 a) :: a r-shifted 1 bit
b (rsh 0 1 b) :: b r-shifted 1 bit
c +(c) :: c incremented
d (add d (lsh 0 c ?&(=(0 (end 0 1 a)) =(0 (end 0 1 b))))) Tall form?
++con accepts two atoms a and b and performs an inclusive binary OR.
###Summary
++con is a [jetted arm]() which creates a dry %gold gate using [|=](), whose sample takes two atoms, labeled 'a' and 'b' using [=, the irregular form of ^=](). ++con then pushes two atomic variables onto the subject, labeled 'a' and 'b' again by using [=](). With [^-](), ++con ensures its result is cast to an atom. Subsequently, ++con declares a [trap](), thus allowing it to loop. Using [?:]() and [?&](), ++con checks if both 'a' and 'b' are equal to 0. If yes, then ++con returns 'd'. Else, ++con uses the trap to loop, this time with the values of 'a' and 'b' both [right-shifted]() by one bit, and the value of 'c' now incremented using [+, the irregular form of .+](). The value of 'd'can also change: if either the last bit of 'a' (found using [++end]()) and the last bit of 'b' are equal ([.=]())to 0, then the value of 'd' becomes the sum of d and the result of left-shifting 1 by 'c' number of bits. Otherwise, d remains the same.
###Examples
?
##++dis
++ dis :: binary and
~/ %dis :: jet
|= [a=@ b=@] :: gate, 2 @ sample
=| [c=@ d=@] :: bunt; c & d = 0
|- ^- @ :: trap; cast to @
?: ?|(=(0 a) =(0 b)) :: if a or b are 0
d :: then, return d
%= $ :: else, loop with:
a (rsh 0 1 a) :: a r-shifted 1 bit
b (rsh 0 1 b) :: b r-shifted 1 bit
c +(c) :: c incremented
d (add d (lsh 0 c ?|(=(0 (end 0 1 a)) =(0 (end 0 1 b))))) :: Tall form?
++dis accepts two atoms a and b and performs a binary AND.
###Summary
++dis is a [jetted arm]() which creates a dry %gold gate using [|=](), whose sample takes two atoms, labeled 'a' and 'b' using [=, the irregular form of ^=](). Then, using [=|](), two tiles, labeled 'c' and 'd', are [bunted]() onto the subject. In order to loop, ++dis then calls a trap with [|-](), whose result is cast to an atom with [^-](). The trap then uses an if statement by using [?:]():it uses [=, the irregular form of .= to check if either 'a' or 'b' is equal to 0 (the inclusive OR statement is called with [?|]()). If either statement returns true, then ++dis produces d. Otherwise, the trap loops, this time with the values of 'a' and 'b' both [right-shifted]() by one bit, and the value of 'c' now incremented with [+, the irregular form of .+](). The value of 'd'can also change: if neither the last bit of 'a' nor the last bit of 'b' are equal ([.=]())to 0, then the value of 'd' becomes the sum of d and the result ofleft-shifting 1 by 'c' number of bits. Otherwise, d remains the same.
###Examples
~ronrem-lonsem/try=> `@ub`9
0b1001
~ronrem-lonsem/try=> `@ub`5
0b101
~ronrem-lonsem/try=> `@ub`(dis 9 5)
0b1
~ronrem-lonsem/try=> (dis 9 5)
1
~ronrem-lonsem/try=> `@ub`534
0b10.0001.0110
~ronrem-lonsem/try=> `@ub`987
0b11.1101.1011
~ronrem-lonsem/try=> `@ub`(dis 534 987)
0b10.0001.0010
~ronrem-lonsem/try=> (dis 534 987)
530
##++mix
++ mix :: binary xor
~/ %mix :: jet
|= [a=@ b=@] :: gate, 2 atom sample
^- @ :: cast result to atom
=+ [c=0 d=0] :: c=0, d=0 to sample
|- :: trap
?: ?&(=(0 a) =(0 b)) :: If 'a' & 'b' are 0
d :: Then, return 0, (d)
%= $ :: Recall ++ mix with:
a (rsh 0 1 a) :: a r-shifted 1 bit
b (rsh 0 1 b) :: b r-shifted 1 bit
c +(c) :: c incremented
d (add d (lsh 0 c =((end 0 1 a) (end 0 1 b)))) :: Tall form?
++mix accepts two atoms a and b and performs an exclusive binary OR.
##Summary
++mix is a [jetted arm]() which creates a dry %gold gate using [|=](), whose sample takes two atoms, labeled 'a' and 'b' using [=, the irregular form of ^=](). ++mix then uses [^-]() to cast its result to an atom. ++mix then pushes two atomic variables onto the subject, labeled 'a' and 'b' again by using [^-](). Subsequently, ++mix declares a [trap](), thus allowing it to loop. Using [?:]() and [?&](), ++mix checks if both 'a' and 'b' are equal to 0. If yes, then ++mix returns 'd'. Else, ++mix uses the trap to loop, this time with the values of 'a' and 'b' both [right-shifted]() by one bit, and the value of 'c' now incremented using [+, the irregular form of .+](). The value of 'd' is also replaced with the sum of 'd' and the result of [=(), the irregular form of .=]() then [left-shifted]() by 1 bit 'c' number of times.
###Examples:
~ronrem-lonsem/try=> `@ub`2
0b10
~ronrem-lonsem/try=> `@ub`3
0b11
~ronrem-lonsem/try=> `@ub`(mix 2 3)
0b1
~ronrem-lonsem/try=> (mix 2 3)
1
~ronrem-lonsem/try=> `@ub`(mix 2 2)
0b0
~ronrem-lonsem/try=> (mix 2 2)
0

View File

@ -1,36 +0,0 @@
!:
%- give
|= [quy=quay own=@p ced=cred pos=pred suf=path but=path for=@tas nep=@tas]
^- manx
:~ %html
:~ %body
[%h3 -"{:/(scow %p own)} is generally a happy camper."]
[%p -"a paragraph with {i/-"italics"} is nice."]
[%p -"we can go crazy by embedding {:/(scow %p own)}."]
+"Hi, neighbor!{?:(=(~ quy) "" " You ask: {<quy>}?")}"
%br
+"You addressed the {?:(p.hut.ced "" "in")}secure,"
+"{?:(q.hut.ced "" "un")}bound "
+"{?:(-.s.hut.ced "DNS host {<p.s.hut.ced>}" "IPv4 host {<p.s.hut.ced>}")}"
?~(r.hut.ced +"" +" at port {<u.r.hut.ced>}.")
%br
+"Your CSRF token is '{<orx.ced>}'."
%br
?: ?=(~ acl.ced)
+"You sent no accept-language."
+"Your language is {<u.acl.ced>}."
%br
?- -.cip.ced
& +"You came from the IPv4 address {<p.cip.ced>}."
| +"You came from the IPv6 address {<p.cip.ced>}."
==
%br
?: =(~ aut.ced)
+"You have no authenticated identities."
+"Authenticated identities: {<aut.ced>}."
%br
+"This {<for>} page was produced from {<`path`pos>}, under {<suf>}"
+", as {<nep>}"
+"{?:(=(~ but) "." ", in {<but>}.")}"
==
==

View File

@ -1,57 +0,0 @@
<link rel="stylesheet" href="/mirdyr-nislux/gen/try/syn/web/public/css/poole.css">
<link rel="stylesheet" href="/mirdyr-nislux/gen/try/syn/web/public/css/syntax.css">
<link rel="stylesheet" href="/mirdyr-nislux/gen/try/syn/web/public/css/hyde.css">
##Regular Weekly Urbit Chat:
Wednesdays at 6pm pacific time. On Urbit `:chat,` where else?
##Nock Interpreters, by language
###`Python`
+ [~rammul-sigfet](https://github.com/eykd/nock)
+ [~dolsun-hoptes](https://github.com/jtauber/pynock/)
+ [~parsym-dortex](https://github.com/calcu16/urbit/blob/master/extras/simulator.py)
###`Ruby`
+ [~lopdev-dirlut](https://github.com/tjic/nock)
+ [https://github.com/davidbalbert/nock.rb](https://github.com/davidbalbert/nock.rb)
###`JavaScript`
+ [~nimtep-dibteb](https://github.com/famousj/nock.js)
+ [~rampyx-mirpec](http://jsfiddle.net/anoxic/TXT5V/8/embedded/result/)
###`Haskell`
+ [https://github.com/mmakowski/hock](https://github.com/mmakowski/hock)
+ [https://github.com/mbrubeck/mynock](https://github.com/mbrubeck/mynock)
+ [~hobmed-hinrym](https://github.com/mrdomino/hsnock)
###`Lisp`
+ [~dilnem-nodfun](https://github.com/cmm/nock)
###`C`
+ [https://github.com/zass30/Nock5KCSharp](https://github.com/zass30/Nock5KCSharp)
###`Clojure`
+ [~lapled-rammyn](https://github.com/jordanlewis/nock-clj)
###`F#`
+ [~portem-ravdet](https://github.com/martindevans/NockFSharp)
###`Racket`
+ [~wictuc-folrex](https://github.com/philipcmonk/racketnock)
###`Scala`
+ [https://github.com/swaldman/nnnock](https://github.com/swaldman/nnnock)
We try to be smart about what you mean so you can say things like
maybe 4 < 5, but still inline html, also things like &copy;, written
like `&copy;` but still have & written `&amp;`

View File

@ -1,4 +0,0 @@
!:
|= [for=@tas pre=path mid=path but=path]
%- crip
"<html><body>Goodbye, Galen {<[for pre mid but]>} (from Hoon)!</body></html>"

View File

@ -1,5 +0,0 @@
<html>
<body>
Hello, world (simply).
</body>
</html>

View File

@ -1,2 +0,0 @@
|= *
'<html><body>Hello, world (from Hoon)!</body></html>'

View File

@ -1,106 +0,0 @@
Main Header
=====
Sub Header
----
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
# Both Headers
====
testing
paragraphs
Testing a
second paragraph
> Quoted one
now, we require no > on hand wrapped lines.
some code
stuff
And interprets characters literally, producing &gt for >, etc as needed.
# Such as headers
> And what would be quotes.
blockquotes can contain other forms such as
> # Headers
> Code
> blocks
> And multiline paragraphs
> work as you'd expect.
>
> We also can
> > Nest blockquotes
> > So really it's just like email
> Awesome right?
# [Header link](www.google.com "Google")
[Header link 2](www.google.com)
-----
We also have hrules
-----
*****
_ _ _
As well as `inline code &<>` stuff.
*emph*
**strong**
***both***
+ unordered
+ list
+ of
+ things
1. list
8. of
3. [ordered](http://en.wikipedia.org/wiki/ordered)
6. Things
### Quoted Lists:
> + unordered
> + list
> 2. ordered
> 4. list
2.
list containing
a paragraph
A second paragraph in the list
4.
Some code
In a list
+ list containing
+
+ another list
+ with stuff
+
1. and a different
2. list
3. cool stuff eh?
Block Html:
<table>
<tr>
<td>Foo</td>
</tr>
</table>
<pre><code>&lt;div class="footer"&gt;
&amp;copy; 2004 Foo Corporation
&lt;/div&gt;
</code></pre>
And of course we have *emph*, more _emph_, **strong**, and more __strong__

View File

@ -1 +0,0 @@
It will prefer this.

View File

@ -1 +0,0 @@
Hi Jaan! This is just text

View File

@ -1,6 +0,0 @@
!:
%- epic
|= [quy=quay own=@p *]
%- crip
"Hi Jaan! Serving query {<quy>} from {<own>}"

View File

@ -1,10 +0,0 @@
!:
%- give
|= [quy=quay own=@p *]
^- manx
:~ %html
:~ %body
~[%h3 +"{(scow %p own)} hails you from afar"]
+"Hi, neighbor!{?:(=(~ quy) "" " You ask: {<quy>}")}?"
==
==

View File

@ -1,85 +0,0 @@
!:
:: Some uses of template syntax
::
=> |% :: no longer in %zuse
++ fest :: web synthesizer
|= [hom=path raw=path]
|* yax=$+(epic *)
(yax (fuel (fain hom raw)))
::
++ gist :: convenient html
|= [hom=path raw=path]
|= yax=$+(epic marl)
%- (fest hom raw)
|= piq=epic
^- manx
=+ ^= sip :: skip blanks
|= mal=marl
?~(mal ~ ?.(|(=(:/(~) i.mal) =(:/([10 ~]) i.mal)) mal $(mal t.mal)))
=+ zay=`marl`(yax piq)
=. zay (sip zay)
=+ ^= twa
|- ^- [p=marl q=marl]
?~ zay [~ ~]
?: ?=([[[%head *] *] *] zay)
[c.i.zay ?:(?=([[[%body *] *] ~] t.zay) c.i.t.zay t.zay)]
?: ?=([[[%title *] *] *] zay)
[[i.zay ~] t.zay]
[~ zay]
[/html [/head (sip p.twa)] [/body (sip q.twa)] ~]
::
--
%- gist
|= epic
^- marl
=+ lim=;li:"second ;{a/funky."http://www.urbit.org" "link"} item"
=+ lum=;li:"third [owner: {(scow %p own)}] item"
=+ lom=;li:"fourth (;{i "italics"}) item"
=+ bar=;br;
=+ foo=`manx`i/;"foobarz"
=+ lam=`(list manx)`[lim lum lom ~]
;=
;title: Hi Galen!
;
;p: Hello, world. Goodbye! Hello! Typing... more typing...
;p:"Hello: pos is {<pos>}"
;- "Goodbye"
;+ ;p:"Hello again"
;* ~[;p:"One" ;p:"Two" ;p:"Three"]
;br;
;p: Let's add some more stuff and just type
;p: of text! It could definitely be snappier, jowever!
;p: Behold a <p>aragraph with an embedded {"string"}.
;p: Or an embedded ;{i "tag"}.
;p: Or even a *{;i:"list" ;i:" of" ;i:" tags" ~},
;p: Sometimes %{|*(a=* [;i:"functionally " ;i:"applied" a])}.
;p: It's nice to just be able to use "quotes." Maybe it works!
; Now, some flow at the same level or above
; I'm going to write some more text
; as the paragraph tag
; it is fun to flow along,
;a."http://www.urbit.org": with
;
; ;{a."http://www.urbit.org" "and more fun links,"}
; or without,
; but not accepting any kind of trailing whitespace
;p
; We are also very good at random odd foo lists:
;ul
;li: first item
;* lam
;li: last item
==
==
;p
; And we can also do
;pre
; preformatted text?
; in lines?
; with linebreaks!
==
==
:: ;script
:: ; alert("I am not an alert box!");
:: ==
==

View File

@ -1,3 +0,0 @@
|= rem=spur
~& [%html rem]
,@

View File

@ -1,2 +0,0 @@
|= *
,@

View File

@ -1,3 +0,0 @@
|= *
|= htm=@
[/text/html (met 3 htm) htm]

View File

@ -1 +0,0 @@
|=(* ,@)

View File

@ -1,342 +0,0 @@
!:
|= *
=> %= .
+
=> +
=>
|%
++ down
$& [p=down q=down]
$% [%$ p=tape]
[%code p=tape]
[%inco p=tape]
[%head p=haxe q=down]
[%link p=tape q=tape r=(unit tape)]
[%lord p=(list down)]
[%lund p=(list down)]
[%parg p=down]
[%quot p=down]
[%rong p=down]
[%emph p=down]
[%hrul ~]
[%html p=tape]
==
++ haxe
|= a=*
?@ a
?:(&(!=(0 a) (lth a 6)) a 6)
6
--
|%
++ cott
;~ pose
(shim 0 8)
(shim 11 37)
(shim 39 59)
(just `@`61)
(shim 63 95)
(shim 97 255)
==
++ copt
;~ pose
(shim 0 9)
(shim 11 37)
(shim 39 39)
(shim 43 59)
(just `@`61)
(shim 63 90)
(shim 94 94)
(shim 97 255)
==
++ urlc ;~(pose (shim 0 9) (shim 11 31) (shim 33 39) (shim 42 255))
++ uctt ;~(pose (shim 0 9) (shim 11 91) (shim 94 255))
++ uctc ;~(pose (shim 0 9) (shim 11 33) (shim 35 39) (shim 42 255))
++ htmc ;~(pose (shim 0 9) (shim 11 255))
++ escp (mask "\\`*_\{}[]()#+-.!")
++ escd ;~(pfix bas escp)
++ whit (mask (tape 9 32 ~))
++ dent ;~(pose (jest ' ') (just `@`9))
++ blan (cold ~ ;~(plug (star whit) (just `@`10)))
++ mcat (bend |=([a=tape b=tape] (some (weld a b))))
++ wcat |*(a=_rule (cook |=([a=tape b=tape] (weld a b)) a))
++ codt
%+ knee *tape |. ~+
;~ pose
(wcat ;~(plug (plus cott) codt))
(cook |=(a=tape (weld "&lt;" a)) ;~(pfix gal ;~(pose codt (easy ~))))
(cook |=(a=tape (weld "&gt;" a)) ;~(pfix gar ;~(pose codt (easy ~))))
(cook |=(a=tape (weld "&amp;" a)) ;~(pfix pam ;~(pose codt (easy ~))))
(plus cott)
==
++ inlt
%+ knee *tape |. ~+
;~ pose
;~(mcat (plus copt) inlt)
;~(mcat (plus escd) inlt)
;~ mcat
%- wcat
;~ plug
;~(plug gal (cook trip inle))
;~(sfix (wcat ;~(plug (star copt) (easy ">"))) gar)
==
inlt
==
;~ mcat
%- wcat
;~ plug
;~(plug gal fas (cook trip inle))
;~(sfix (wcat ;~(plug (star copt) (easy ">"))) gar)
==
inlt
==
;~ mcat
(wcat ;~(plug ;~(plug pam hax ;~(sfix (plus nud) sem)) (easy ";")))
inlt
==
;~ mcat
(wcat ;~(plug ;~(plug pam ;~(sfix (plus alf) sem)) (easy ";")))
inlt
==
(cook |=(a=tape (weld "&lt;" a)) ;~(pfix gal ;~(pose inlt (easy ~))))
(cook |=(a=tape (weld "&gt;" a)) ;~(pfix gar ;~(pose inlt (easy ~))))
(cook |=(a=tape (weld "&amp;" a)) ;~(pfix pam ;~(pose inlt (easy ~))))
==
++ kite
|= bud=(list ,@t)
|= tub=nail
|- ^- (like ,@t)
?@ bud
(fail tub)
=+ foo=((jest i.bud) tub)
?~ q.foo
$(bud t.bud)
foo
++ bloc
%+ knee *@t |. ~+
%- kite
:~ '<address>' '<article>' '<aside>' '<audio>' '<blockquote>'
'<canvas>' '<dd>' '<div>' '<dl>' '<fieldset>' '<figcaption>'
'<figure>' '<footer>' '<form>' '<h1>' '<h2>' '<h3>' '<h4>'
'<h5>' '<h6>' '<header>' '<hgroup>' '<hr>' '<noscript>'
'<ol>' '<output>' '<p>' '<pre>' '<section>' '<table>'
'<tfoot>' '<ul>' '<video>' '<style>'
==
++ inle
%+ knee *@t |. ~+
%- kite
:~ 'b' 'big' 'i' 'small' 'tt' 'abbr' 'acronym'
'cite' 'code' 'dfn' 'em' 'kbd' 'strong' 'samp'
'var' 'a' 'bdo' 'br' 'img' 'map' 'object' 'q'
'script' 'span' 'sub' 'sup' 'button' 'input'
'label' 'select' 'textarea' 'link'
==
++ htmb
%+ knee *tape |. ~+
%+ cook |=(a=(list tape) (reel a |=([p=tape q=tape] (weld p q))))
(plus (cook |=(a=tape (weld a "\0a")) ;~(sfix (plus htmc) (just '\0a'))))
++ blok
%+ knee *tape |. ~+
%+ cook |=(a=[tape tape] (weld a))
;~(plug (cook trip bloc) ;~(plug (just '\0a') htmb))
++ intt
%+ knee *down |. ~+
;~ pose
(ifix [(jest '**') (jest '**')] (stag %rong intt))
(ifix [(jest '__') (jest '__')] (stag %rong intt))
(ifix [tar tar] (stag %emph intt))
(ifix [cab cab] (stag %emph intt))
(ifix [tec tec] (stag %inco codt))
(stag %$ inlt)
link
(stag %$ ;~(plug tar (easy ~)))
(stag %$ ;~(plug cab (easy ~)))
(stag %$ ;~(plug pel (easy ~)))
(stag %$ ;~(plug per (easy ~)))
(stag %$ ;~(plug sel (easy ~)))
(stag %$ ;~(plug ser (easy ~)))
==
++ inli
|= tub=nail
^- (like down)
?~ q.tub
(fail tub)
?: |(=(i.q.tub 10) =(i.q.tub '>'))
(fail tub)
=+ ^= foo
;~ pose
dent
;~(plug (mask "+*-") (plus whit))
;~(plug dim:ag dot (plus whit))
==
=+ bar=(foo tub)
?~ q.bar
%-
%+ cook |=(a=(list down) (reel a |=([p=down q=down] [p q])))
;~(sfix (plus intt) (just `@`10))
tub
(fail tub)
++ parg
|= [a=@ b=@]
%+ knee *down |. ~+
;~ plug
inli
%+ cook |=(a=(list down) (reel a |=([p=down q=down] [p q])))
(plus ;~(plug (easy [%$ "\0a"]) (colk a b inli)))
==
++ link
%+ knee *down |. ~+
%+ stag %link
;~ plug
(ifix [sel ser] (plus ;~(pose uctt escd)))
;~(pfix pel (star ;~(pose urlc escd)))
;~ pose
%+ cook |=(a=tape (some a))
(ifix [ace per] (ifix [doq doq] (plus ;~(pose uctc escd))))
(cold ~ per)
==
==
++ barg
|= a=@
%+ knee *haxe |. ~+
;~ pfix (stun [a a] (jest '> '))
;~ pose
(cold 1 ;~(plug (plus tis) (star whit) (just `@`10)))
(cold 2 ;~(plug (plus hep) (star whit) (just `@`10)))
==
==
++ neck
%+ knee *[haxe down] |. ~+
;~ pose
;~(pfix (jest '######') (stag 6 ;~(pfix (star whit) inli)))
;~(pfix (jest '#####') (stag 5 ;~(pfix (star whit) inli)))
;~(pfix (jest '####') (stag 4 ;~(pfix (star whit) inli)))
;~(pfix (jest '###') (stag 3 ;~(pfix (star whit) inli)))
;~(pfix (jest '##') (stag 2 ;~(pfix (star whit) inli)))
;~(pfix (jest '#') (stag 1 ;~(pfix (star whit) inli)))
==
++ mark
|= p=tape
(scan p park)
++ hrul
%+ knee *down |. ~+
%+ sear
|=(a=(list tape) ?:((gte (lent (zing a)) 3) (some [%hrul ~]) ~))
;~ sfix
(more (star whit) ;~(pose (plus cab) (plus tar) (plus hep)))
(just `@`10)
==
++ colk
|* [a=@ b=@ fel=_rule]
;~(pfix (stun [a a] (jest '> ')) (stun [b b] dent) fel)
++ code
|= [a=@ b=@]
%+ knee *tape |. ~+
%+ cook weld
;~ plug
(ifix [dent (just '\0a')] codt)
%+ cook |=(a=(list tape) (reel a |=([p=tape q=tape] (weld p q))))
%- star
;~(plug (easy '\0a') (colk a b (ifix [dent (just '\0a')] codt)))
==
++ lelm
|= [a=@ b=@]
%+ knee *down |. ~+
;~ pose
inli
hrul
;~(pfix (just `@`10) (lmel a b))
==
++ lmel
|= [a=@ b=@]
%+ knee *down |. ~+
;~ pose
;~((bend) (stag %lund (plus (lulm a b))) (lmel a b))
;~((bend) (stag %lord (plus (lolm a b))) (lmel a b))
;~((bend) (stag %code (colk a b (code a b))) (lmel a b))
;~((bend) (stag %head (colk a b neck)) (lmel a b))
;~((bend) (stag %parg (colk a b (parg a b))) (lmel a b))
(colk a b inli)
(colk a b hrul)
;~(pfix (plus (colk a b blan)) (lmel a b))
==
++ lulm
|= [a=@ b=@]
%+ knee *down |. ~+
(colk a b ;~(pfix (mask "+*-") (plus whit) (lelm a +(b))))
++ lolm
|= [a=@ b=@]
%+ knee *down |. ~+
(colk a b ;~(pfix dim:ag dot (plus whit) (lelm a +(b))))
++ bark
|= a=@
%+ knee *down |. ~+
;~ pose
(stag %html blok)
(stag %lund (plus (lulm a 0)))
(stag %lord (plus (lolm a 0)))
(stag %code (colk a 0 (code a 0)))
(stag %head (colk a 0 neck))
%+ cook |=([a=down b=haxe] [%head b a])
(colk a 0 ;~(plug inli (barg a)))
(colk a 0 hrul)
(stag %parg (colk a 0 (parg a 0)))
(colk a 0 inli)
(cold [%$ ""] (colk a 0 (plus blan)))
==
++ dark
|= a=@
%+ knee *down |. ~+
|= tub=nail
^- (like down)
=+ vex=((cook lent (star (jest '> '))) tub)
?~ q.vex
vex
?: (lth p.u.q.vex a)
(fail tub)
?: (gth p.u.q.vex a)
(;~((bend) (stag %quot (dark +(a))) (dark a)) tub)
(;~((bend) (bark a) (dark a)) tub)
++ park
%+ knee *down |. ~+
%+ cook |=(a=(list down) (reel a |=([p=down q=down] [p q])))
;~(sfix (plus (dark 0)) (star blan))
++ appd
|= [p=@ q=@]
^- @
(cat 3 p q)
++ wtag
|= [a=@ b=@]
^- @
:(appd '<' a '>' b '</' a '>')
++ sett
|= [a=@ b=tape]
^- @
:(appd a '="' (rap 3 b) '"')
++ hark
|= a=down
^- @
?- a
[%$ *] (rap 3 p.a)
[%code *] (wtag 'pre' (wtag 'code' (rap 3 p.a)))
[%inco *] (wtag 'code' (rap 3 p.a))
[%head *] (wtag (cat 3 'h' (add '0' p.a)) (hark q.a))
[%link *]
?~ r.a
:(appd '<a ' (sett 'href' q.a) '>' (rap 3 p.a) '</a>')
:(appd '<a ' (sett 'href' q.a) ' ' (sett 'title' u.r.a) '>' (rap 3 p.a) '</a>')
[%lord *] (wtag 'ol' (reel (turn p.a |=(a=down (wtag 'li' (hark a)))) appd))
[%lund *] (wtag 'ul' (reel (turn p.a |=(a=down (wtag 'li' (hark a)))) appd))
[%parg *] (wtag 'p' (hark p.a))
[%quot *] (wtag 'blockquote' (hark p.a))
[%rong *] (wtag 'strong' (hark p.a))
[%emph *] (wtag 'em' (hark p.a))
[%hrul *] '<hr>'
[%html *] (rap 3 p.a)
^ (cat 3 (hark p.a) (hark q.a))
==
--
==
|= txt=@
=+ tpt=(trip txt)
=+ mdp=(mark tpt)
:(appd '<html><body>' (hark mdp) '</body></html>')

View File

@ -1,3 +0,0 @@
|= *
|= htm=@
[/text/html (met 3 htm) htm]

View File

@ -1,2 +0,0 @@
|= css=@
[/text/css (met 3 css) css]

View File

@ -1,2 +0,0 @@
|= htm=@
[/text/html (met 3 htm) htm]

View File

@ -1,3 +0,0 @@
!:
|= mex=manx
(crip (poxo mex))

View File

@ -1,353 +0,0 @@
!:
=> %= .
+
=> +
=>
|%
++ down
$& [p=down q=down]
$% [%$ p=tape]
[%code p=tape]
[%inco p=tape]
[%head p=haxe q=down]
[%link p=tape q=tape r=(unit tape)]
[%lord p=(list down)]
[%lund p=(list down)]
[%parg p=down]
[%quot p=down]
[%rong p=down]
[%emph p=down]
[%hrul ~]
[%html p=tape]
==
++ haxe
|= a=*
?@ a
?:(&(!=(0 a) (lth a 6)) a 6)
6
--
|%
++ cott
;~ pose
(shim 0 8)
(shim 11 37)
(shim 39 59)
(just `@`61)
(shim 63 95)
(shim 97 255)
==
++ copt
;~ pose
(shim 0 9)
(shim 11 37)
(shim 39 39)
(shim 43 59)
(just `@`61)
(shim 63 90)
(shim 94 94)
(shim 97 255)
==
++ urlc ;~(pose (shim 0 9) (shim 11 31) (shim 33 39) (shim 42 255))
++ uctt ;~(pose (shim 0 9) (shim 11 91) (shim 94 255))
++ uctc ;~(pose (shim 0 9) (shim 11 33) (shim 35 39) (shim 42 255))
++ htmc ;~(pose (shim 0 9) (shim 11 255))
++ escp (mask "\\`*_\{}[]()#+-.!")
++ escd ;~(pfix bas escp)
++ whit (mask (tape 9 32 ~))
++ dent ;~(pose (jest ' ') (just `@`9))
++ blan (cold ~ ;~(plug (star whit) (just `@`10)))
++ mcat (bend |=([a=tape b=tape] (some (weld a b))))
++ wcat |*(a=_rule (cook |=([a=tape b=tape] (weld a b)) a))
++ codt
%+ knee *tape |. ~+
;~ pose
(wcat ;~(plug (plus cott) codt))
(cook |=(a=tape (weld "&lt;" a)) ;~(pfix gal ;~(pose codt (easy ~))))
(cook |=(a=tape (weld "&gt;" a)) ;~(pfix gar ;~(pose codt (easy ~))))
(cook |=(a=tape (weld "&amp;" a)) ;~(pfix pam ;~(pose codt (easy ~))))
(plus cott)
==
++ inlt
%+ knee *tape |. ~+
;~ pose
;~(mcat (plus copt) inlt)
;~(mcat (plus escd) inlt)
;~ mcat
%- wcat
;~ plug
;~(plug gal (cook trip inle))
;~(sfix (wcat ;~(plug (star copt) (easy ">"))) gar)
==
inlt
==
;~ mcat
%- wcat
;~ plug
;~(plug gal fas (cook trip inle))
;~(sfix (wcat ;~(plug (star copt) (easy ">"))) gar)
==
inlt
==
;~ mcat
(wcat ;~(plug ;~(plug pam hax ;~(sfix (plus nud) sem)) (easy ";")))
inlt
==
;~ mcat
%- wcat
;~ plug
;~ plug
pam hax
;~(pose (just 'x') (just 'X'))
;~(sfix (plus ;~(pose nud low hig)) sem)
==
(easy ";")
==
inlt
==
;~ mcat
(wcat ;~(plug ;~(plug pam ;~(sfix (plus alf) sem)) (easy ";")))
inlt
==
(cook |=(a=tape (weld "&lt;" a)) ;~(pfix gal ;~(pose inlt (easy ~))))
(cook |=(a=tape (weld "&gt;" a)) ;~(pfix gar ;~(pose inlt (easy ~))))
(cook |=(a=tape (weld "&amp;" a)) ;~(pfix pam ;~(pose inlt (easy ~))))
==
++ kite
|= bud=(list ,@t)
|= tub=nail
|- ^- (like ,@t)
?@ bud
(fail tub)
=+ foo=((jest i.bud) tub)
?~ q.foo
$(bud t.bud)
foo
++ bloc
%+ knee *@t |. ~+
%- kite
:~ '<address>' '<article>' '<aside>' '<audio>' '<blockquote>'
'<canvas>' '<dd>' '<div>' '<dl>' '<fieldset>' '<figcaption>'
'<figure>' '<footer>' '<form>' '<h1>' '<h2>' '<h3>' '<h4>'
'<h5>' '<h6>' '<header>' '<hgroup>' '<hr>' '<noscript>'
'<ol>' '<output>' '<p>' '<pre>' '<section>' '<table>'
'<tfoot>' '<ul>' '<video>' '<style>'
==
++ inle
%+ knee *@t |. ~+
%- kite
:~ 'b' 'big' 'i' 'small' 'tt' 'abbr' 'acronym'
'cite' 'code' 'dfn' 'em' 'kbd' 'strong' 'samp'
'var' 'a' 'bdo' 'br' 'img' 'map' 'object' 'q'
'script' 'span' 'sub' 'sup' 'button' 'input'
'label' 'select' 'textarea' 'link'
==
++ htmb
%+ knee *tape |. ~+
%+ cook |=(a=(list tape) (reel a |=([p=tape q=tape] (weld p q))))
(plus (cook |=(a=tape (weld a "\0a")) ;~(sfix (plus htmc) (just '\0a'))))
++ blok
%+ knee *tape |. ~+
%+ cook |=(a=[tape tape] (weld a))
;~(plug (cook trip bloc) ;~(plug (just '\0a') htmb))
++ intt
%+ knee *down |. ~+
;~ pose
(ifix [(jest '**') (jest '**')] (stag %rong intt))
(ifix [(jest '__') (jest '__')] (stag %rong intt))
(ifix [tar tar] (stag %emph intt))
(ifix [cab cab] (stag %emph intt))
(ifix [tec tec] (stag %inco codt))
(stag %$ inlt)
link
(stag %$ ;~(plug tar (easy ~)))
(stag %$ ;~(plug cab (easy ~)))
(stag %$ ;~(plug pel (easy ~)))
(stag %$ ;~(plug per (easy ~)))
(stag %$ ;~(plug sel (easy ~)))
(stag %$ ;~(plug ser (easy ~)))
==
++ inli
|= tub=nail
^- (like down)
?~ q.tub
(fail tub)
?: |(=(i.q.tub 10) =(i.q.tub '>'))
(fail tub)
=+ ^= foo
;~ pose
dent
;~(plug (mask "+*-") (plus whit))
;~(plug dim:ag dot (plus whit))
==
=+ bar=(foo tub)
?~ q.bar
%-
%+ cook |=(a=(list down) (reel a |=([p=down q=down] [p q])))
;~(sfix (plus intt) (just `@`10))
tub
(fail tub)
++ parg
|= [a=@ b=@]
%+ knee *down |. ~+
;~ plug
inli
%+ cook |=(a=(list down) (reel a |=([p=down q=down] [p q])))
(plus ;~(plug (easy [%$ "\0a"]) (colk a b inli)))
==
++ link
%+ knee *down |. ~+
%+ stag %link
;~ plug
(ifix [sel ser] (plus ;~(pose uctt escd)))
;~(pfix pel (star ;~(pose urlc escd)))
;~ pose
%+ cook |=(a=tape (some a))
(ifix [ace per] (ifix [doq doq] (plus ;~(pose uctc escd))))
(cold ~ per)
==
==
++ barg
|= a=@
%+ knee *haxe |. ~+
;~ pfix (stun [a a] (jest '> '))
;~ pose
(cold 1 ;~(plug (plus tis) (star whit) (just `@`10)))
(cold 2 ;~(plug (plus hep) (star whit) (just `@`10)))
==
==
++ neck
%+ knee *[haxe down] |. ~+
;~ pose
;~(pfix (jest '######') (stag 6 ;~(pfix (star whit) inli)))
;~(pfix (jest '#####') (stag 5 ;~(pfix (star whit) inli)))
;~(pfix (jest '####') (stag 4 ;~(pfix (star whit) inli)))
;~(pfix (jest '###') (stag 3 ;~(pfix (star whit) inli)))
;~(pfix (jest '##') (stag 2 ;~(pfix (star whit) inli)))
;~(pfix (jest '#') (stag 1 ;~(pfix (star whit) inli)))
==
++ mark
|= p=tape
(scan p park)
++ hrul
%+ knee *down |. ~+
%+ sear
|=(a=(list tape) ?:((gte (lent (zing a)) 3) (some [%hrul ~]) ~))
;~ sfix
(more (star whit) ;~(pose (plus cab) (plus tar) (plus hep)))
(just `@`10)
==
++ colk
|* [a=@ b=@ fel=_rule]
;~(pfix (stun [a a] (jest '> ')) (stun [b b] dent) fel)
++ code
|= [a=@ b=@]
%+ knee *tape |. ~+
%+ cook weld
;~ plug
(ifix [dent (just '\0a')] codt)
%+ cook |=(a=(list tape) (reel a |=([p=tape q=tape] (weld p q))))
%- star
;~(plug (easy '\0a') (colk a b (ifix [dent (just '\0a')] codt)))
==
++ lelm
|= [a=@ b=@]
%+ knee *down |. ~+
;~ pose
inli
hrul
;~(pfix (just `@`10) (lmel a b))
==
++ lmel
|= [a=@ b=@]
%+ knee *down |. ~+
;~ pose
;~((bend) (stag %lund (plus (lulm a b))) (lmel a b))
;~((bend) (stag %lord (plus (lolm a b))) (lmel a b))
;~((bend) (stag %code (colk a b (code a b))) (lmel a b))
;~((bend) (stag %head (colk a b neck)) (lmel a b))
;~((bend) (stag %parg (colk a b (parg a b))) (lmel a b))
(colk a b inli)
(colk a b hrul)
;~(pfix (plus (colk a b blan)) (lmel a b))
==
++ lulm
|= [a=@ b=@]
%+ knee *down |. ~+
(colk a b ;~(pfix (mask "+*-") (plus whit) (lelm a +(b))))
++ lolm
|= [a=@ b=@]
%+ knee *down |. ~+
(colk a b ;~(pfix dim:ag dot (plus whit) (lelm a +(b))))
++ bark
|= a=@
%+ knee *down |. ~+
;~ pose
(stag %html blok)
(stag %lund (plus (lulm a 0)))
(stag %lord (plus (lolm a 0)))
(stag %code (colk a 0 (code a 0)))
(stag %head (colk a 0 neck))
%+ cook |=([a=down b=haxe] [%head b a])
(colk a 0 ;~(plug inli (barg a)))
(colk a 0 hrul)
(stag %parg (colk a 0 (parg a 0)))
(colk a 0 inli)
(cold [%$ ""] (colk a 0 (plus blan)))
==
++ dark
|= a=@
%+ knee *down |. ~+
|= tub=nail
^- (like down)
=+ vex=((cook lent (star (jest '> '))) tub)
?~ q.vex
vex
?: (lth p.u.q.vex a)
(fail tub)
?: (gth p.u.q.vex a)
(;~((bend) (stag %quot (dark +(a))) (dark a)) tub)
(;~((bend) (bark a) (dark a)) tub)
++ park
%+ knee *down |. ~+
%+ cook |=(a=(list down) (reel a |=([p=down q=down] [p q])))
;~(sfix (plus (dark 0)) (star blan))
++ appd
|= [p=@ q=@]
^- @
(cat 3 p q)
++ wtag
|= [a=@ b=@]
^- @
:(appd '<' a '>' b '</' a '>')
++ sett
|= [a=@ b=tape]
^- @
:(appd a '="' (rap 3 b) '"')
++ hark
|= a=down
^- @
?- a
[%$ *] (rap 3 p.a)
[%code *] (wtag 'pre' (wtag 'code' (rap 3 p.a)))
[%inco *] (wtag 'code' (rap 3 p.a))
[%head *] (wtag (cat 3 'h' (add '0' p.a)) (hark q.a))
[%link *]
?~ r.a
:(appd '<a ' (sett 'href' q.a) '>' (rap 3 p.a) '</a>')
:(appd '<a ' (sett 'href' q.a) ' ' (sett 'title' u.r.a) '>' (rap 3 p.a) '</a>')
[%lord *] (wtag 'ol' (reel (turn p.a |=(a=down (wtag 'li' (hark a)))) appd))
[%lund *] (wtag 'ul' (reel (turn p.a |=(a=down (wtag 'li' (hark a)))) appd))
[%parg *] (wtag 'p' (hark p.a))
[%quot *] (wtag 'blockquote' (hark p.a))
[%rong *] (wtag 'strong' (hark p.a))
[%emph *] (wtag 'em' (hark p.a))
[%hrul *] '<hr>'
[%html *] (rap 3 p.a)
^ (cat 3 (hark p.a) (hark q.a))
==
--
==
|= txt=@
=+ tpt=(trip txt)
=+ mdp=(mark tpt)
:(appd '<html><body>' (hark mdp) '</body></html>')

View File

@ -1,3 +0,0 @@
!:
|= txt=@
(cat 3 '<html><body>' (cat 3 txt '</html></body>'))

View File

@ -1,22 +0,0 @@
!:
|= mad=[who=@p now=@da eny=@uw ced=cred]
|= zab=[sud=scud quy=quay]
^- love
:- %ham
:~ %html
:~ %body
+"urbit: {neighbor} ready at {<now.mad>}."
::
:- %ul
|- ^- marl
?~ messages ~
:_ $(messages t.messages)
~[%li +"someone said: {(trip i.messages)}"]
::
:~ ~[%form action/"fun" method/"post"]
-"message: {%[%input type/"text" name/"msg"]}"
-"message: {~[%i "foo"]}
{I could have 8347r63874r887*&$^*&^$%*&^#* in here}
==
==
==

View File

@ -1,251 +0,0 @@
/*
* __ __
* /\ \ /\ \
* \ \ \___ __ __ \_\ \ __
* \ \ _ `\/\ \/\ \ /'_` \ /'__`\
* \ \ \ \ \ \ \_\ \/\ \_\ \/\ __/
* \ \_\ \_\/`____ \ \___,_\ \____\
* \/_/\/_/`/___/> \/__,_ /\/____/
* /\___/
* \/__/
*
* Designed, built, and released under MIT license by @mdo. Learn more at
* https://github.com/poole/hyde.
*/
/*
* Contents
*
* Global resets
* Sidebar
* Container
* Reverse layout
* Themes
*/
/*
* Global resets
*
* Update the foundational and global aspects of the page.
*/
html {
font-family: "PT Sans", Helvetica, Arial, sans-serif;
}
@media (min-width: 48rem) {
html {
font-size: 16px;
}
}
/*@media (min-width: 58rem) {
html {
font-size: 20px;
}
}*/
/*
* Sidebar
*
* Flexible banner for housing site name, intro, and "footer" content. Starts
* out above content in mobile and later moves to the side with wider viewports.
*/
.sidebar {
text-align: center;
padding: 2rem 1rem;
color: rgba(255,255,255,.5);
background-color: #202020;
}
@media (min-width: 48rem) {
.sidebar {
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: 18.5rem;
text-align: left;
}
}
/* Sidebar links */
.sidebar a {
color: #fff;
}
/* About section */
.sidebar-about h1 {
color: #fff;
margin-top: 0;
font-family: "Helvetica";
font-size: 3.25rem;
font-weight: 300
}
/* Sidebar nav */
.sidebar-nav {
padding-left: 0;
list-style: none;
}
.sidebar-nav-item {
display: block;
}
a.sidebar-nav-item:hover,
a.sidebar-nav-item:focus {
text-decoration: underline;
}
.sidebar-nav-item.active {
font-weight: bold;
}
/* Sticky sidebar
*
* Add the `sidebar-sticky` class to the sidebar's container to affix it the
* contents to the bottom of the sidebar in tablets and up.
*/
@media (min-width: 48rem) {
.sidebar-sticky {
position: absolute;
right: 1rem;
bottom: 1rem;
left: 1rem;
}
}
/* Container
*
* Align the contents of the site above the proper threshold with some margin-fu
* with a 25%-wide `.sidebar`.
*/
.content {
padding-top: 4rem;
padding-bottom: 4rem;
}
@media (min-width: 48rem) {
.content {
max-width: 38rem;
margin-left: 20rem;
margin-right: 2rem;
}
}
@media (min-width: 64rem) {
.content {
margin-left: 22rem;
margin-right: 4rem;
}
}
/*
* Reverse layout
*
* Flip the orientation of the page by placing the `.sidebar` on the right.
*/
@media (min-width: 48rem) {
.layout-reverse .sidebar {
left: auto;
right: 0;
}
.layout-reverse .content {
margin-left: 2rem;
margin-right: 20rem;
}
}
@media (min-width: 64rem) {
.layout-reverse .content {
margin-left: 4rem;
margin-right: 22rem;
}
}
/*
* Themes
*
* As of v1.1, Hyde includes optional themes to color the sidebar and links
* within blog posts. To use, add the class of your choosing to the `body`.
*/
/* Base16 (http://chriskempson.github.io/base16/#default) */
/* Red */
.theme-base-08 .sidebar {
background-color: #ac4142;
}
.theme-base-08 .content a,
.theme-base-08 .related-posts li a:hover {
color: #ac4142;
}
/* Orange */
.theme-base-09 .sidebar {
background-color: #d28445;
}
.theme-base-09 .content a,
.theme-base-09 .related-posts li a:hover {
color: #d28445;
}
/* Yellow */
.theme-base-0a .sidebar {
background-color: #f4bf75;
}
.theme-base-0a .content a,
.theme-base-0a .related-posts li a:hover {
color: #f4bf75;
}
/* Green */
.theme-base-0b .sidebar {
background-color: #90a959;
}
.theme-base-0b .content a,
.theme-base-0b .related-posts li a:hover {
color: #90a959;
}
/* Cyan */
.theme-base-0c .sidebar {
background-color: #75b5aa;
}
.theme-base-0c .content a,
.theme-base-0c .related-posts li a:hover {
color: #75b5aa;
}
/* Blue */
.theme-base-0d .sidebar {
background-color: #6a9fb5;
}
.theme-base-0d .content a,
.theme-base-0d .related-posts li a:hover {
color: #6a9fb5;
}
/* Magenta */
.theme-base-0e .sidebar {
background-color: #aa759f;
}
.theme-base-0e .content a,
.theme-base-0e .related-posts li a:hover {
color: #aa759f;
}
/* Brown */
.theme-base-0f .sidebar {
background-color: #8f5536;
}
.theme-base-0f .content a,
.theme-base-0f .related-posts li a:hover {
color: #8f5536;
}

View File

@ -1,405 +0,0 @@
/*
* ___
* /\_ \
* _____ ___ ___\//\ \ __
* /\ '__`\ / __`\ / __`\\ \ \ /'__`\
* \ \ \_\ \/\ \_\ \/\ \_\ \\_\ \_/\ __/
* \ \ ,__/\ \____/\ \____//\____\ \____\
* \ \ \/ \/___/ \/___/ \/____/\/____/
* \ \_\
* \/_/
*
* Designed, built, and released under MIT license by @mdo. Learn more at
* https://github.com/poole/poole.
*/
/*
* Contents
*
* Body resets
* Custom type
* Messages
* Container
* Masthead
* Posts and pages
* Pagination
* Reverse layout
* Themes
*/
/*
* Body resets
*
* Update the foundational and global aspects of the page.
*/
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
}
html {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
}
@media (min-width: 38rem) {
html {
font-size: 20px;
}
}
body {
color: #515151;
background-color: #fff;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
/* No `:visited` state is required by default (browsers will use `a`) */
a {
color: #268bd2;
text-decoration: none;
}
/* `:focus` is linked to `:hover` for basic accessibility */
a:hover,
a:focus {
text-decoration: underline;
}
/* Headings */
h1, h2, h3, h4, h5, h6 {
margin-bottom: .5rem;
font-weight: bold;
line-height: 1.25;
color: #313131;
text-rendering: optimizeLegibility;
}
h1 {
font-size: 2rem;
}
h2 {
margin-top: 1rem;
font-size: 1.5rem;
}
h3 {
margin-top: 1.5rem;
font-size: 1.25rem;
}
h4, h5, h6 {
margin-top: 1rem;
font-size: 1rem;
}
/* Body text */
p {
margin-top: 0;
margin-bottom: 1rem;
}
strong {
color: #303030;
}
/* Lists */
ul, ol, dl {
margin-top: 0;
margin-bottom: 1rem;
}
dt {
font-weight: bold;
}
dd {
margin-bottom: .5rem;
}
/* Misc */
hr {
position: relative;
margin: 1.5rem 0;
border: 0;
border-top: 1px solid #eee;
border-bottom: 1px solid #fff;
}
abbr {
font-size: 85%;
font-weight: bold;
color: #555;
text-transform: uppercase;
}
abbr[title] {
cursor: help;
border-bottom: 1px dotted #e5e5e5;
}
/* Code */
code,
pre, .codeblock {
font-family: Menlo, Monaco, "Courier New", monospace;
}
code {
padding: .25em .5em;
font-size: 85%;
color: #bf616a;
background-color: #f9f9f9;
border-radius: 3px;
}
pre, .codeblock {
display: block;
margin-top: 0;
margin-bottom: 1rem;
padding: 1rem;
font-size: .8rem;
line-height: 1.4;
white-space: pre;
white-space: pre-wrap;
word-break: break-all;
word-wrap: break-word;
background-color: #f9f9f9;
}
pre code, .codeblock code {
padding: 0;
font-size: 90%;
color: inherit;
background-color: transparent;
}
.highlight {
margin-bottom: 1rem;
border-radius: 4px;
}
.highlight pre {
margin-bottom: 0;
}
/* Quotes */
blockquote {
padding: .5rem 1rem;
margin: .8rem 0;
color: #7a7a7a;
border-left: .25rem solid #e5e5e5;
}
blockquote p:last-child {
margin-bottom: 0;
}
@media (min-width: 30rem) {
blockquote {
padding-right: 5rem;
padding-left: 1.25rem;
}
}
img {
display: block;
margin: 0 0 1rem;
border-radius: 5px;
min-width:100%;
max-width:100%;
height:auto;
}
/* Tables */
table {
margin-bottom: 1rem;
width: 100%;
border: 1px solid #e5e5e5;
border-collapse: collapse;
}
td,
th {
padding: .25rem .5rem;
border: 1px solid #e5e5e5;
}
tbody tr:nth-child(odd) td,
tbody tr:nth-child(odd) th {
background-color: #f9f9f9;
}
/*
* Custom type
*
* Extend paragraphs with `.lead` for larger introductory text.
*/
.lead {
font-size: 1.25rem;
font-weight: 300;
}
/*
* Messages
*
* Show alert messages to users. You may add it to single elements like a `<p>`,
* or to a parent if there are multiple elements to show.
*/
.message {
margin-bottom: 1rem;
padding: 1rem;
color: #717171;
background-color: #f9f9f9;
}
/*
* Container
*
* Center the page content.
*/
.container {
max-width: 38rem;
padding-left: 1rem;
padding-right: 1rem;
margin-left: auto;
margin-right: auto;
}
/*
* Masthead
*
* Super small header above the content for site name and short description.
*/
.masthead {
padding-top: 1rem;
padding-bottom: 1rem;
margin-bottom: 3rem;
}
.masthead-title {
margin-top: 0;
margin-bottom: 0;
color: #505050;
}
.masthead-title a {
color: #505050;
}
.masthead-title small {
font-size: 75%;
font-weight: 400;
color: #c0c0c0;
letter-spacing: 0;
}
/*
* Posts and pages
*
* Each post is wrapped in `.post` and is used on default and post layouts. Each
* page is wrapped in `.page` and is only used on the page layout.
*/
.page,
.post {
margin-bottom: 4em;
}
/* Blog post or page title */
.page-title,
.post-title,
.post-title a {
color: #303030;
}
.page-title,
.post-title {
margin-top: 0;
}
/* Meta data line below post title */
.post-date {
display: block;
margin-top: -.5rem;
margin-bottom: 1rem;
color: #9a9a9a;
}
/* Related posts */
.related {
padding-top: 2rem;
padding-bottom: 2rem;
border-top: 1px solid #eee;
}
.related-posts {
padding-left: 0;
list-style: none;
}
.related-posts h3 {
margin-top: 0;
}
.related-posts li small {
font-size: 75%;
color: #999;
}
.related-posts li a:hover {
color: #268bd2;
text-decoration: none;
}
.related-posts li a:hover small {
color: inherit;
}
/*
* Pagination
*
* Super lightweight (HTML-wise) blog pagination. `span`s are provide for when
* there are no more previous or next posts to show.
*/
.pagination {
overflow: hidden; /* clearfix */
margin-left: -1rem;
margin-right: -1rem;
font-family: "PT Sans", Helvetica, Arial, sans-serif;
color: #ccc;
text-align: center;
}
/* Pagination items can be `span`s or `a`s */
.pagination-item {
display: block;
padding: 1rem;
border: 1px solid #eee;
}
.pagination-item:first-child {
margin-bottom: -1px;
}
/* Only provide a hover state for linked pagination items */
a.pagination-item:hover {
background-color: #f5f5f5;
}
@media (min-width: 30rem) {
.pagination {
margin: 3rem 0;
}
.pagination-item {
float: left;
width: 50%;
}
.pagination-item:first-child {
margin-bottom: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.pagination-item:last-child {
margin-left: -1px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
}

View File

@ -1,66 +0,0 @@
.hll { background-color: #ffffcc }
/*{ background: #f0f3f3; }*/
.c { color: #999; } /* Comment */
.err { color: #AA0000; background-color: #FFAAAA } /* Error */
.k { color: #006699; } /* Keyword */
.o { color: #555555 } /* Operator */
.cm { color: #0099FF; font-style: italic } /* Comment.Multiline */
.cp { color: #009999 } /* Comment.Preproc */
.c1 { color: #999; } /* Comment.Single */
.cs { color: #999; } /* Comment.Special */
.gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #FF0000 } /* Generic.Error */
.gh { color: #003300; } /* Generic.Heading */
.gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */
.go { color: #AAAAAA } /* Generic.Output */
.gp { color: #000099; } /* Generic.Prompt */
.gs { } /* Generic.Strong */
.gu { color: #003300; } /* Generic.Subheading */
.gt { color: #99CC66 } /* Generic.Traceback */
.kc { color: #006699; } /* Keyword.Constant */
.kd { color: #006699; } /* Keyword.Declaration */
.kn { color: #006699; } /* Keyword.Namespace */
.kp { color: #006699 } /* Keyword.Pseudo */
.kr { color: #006699; } /* Keyword.Reserved */
.kt { color: #007788; } /* Keyword.Type */
.m { color: #FF6600 } /* Literal.Number */
.s { color: #d44950 } /* Literal.String */
.na { color: #4f9fcf } /* Name.Attribute */
.nb { color: #336666 } /* Name.Builtin */
.nc { color: #00AA88; } /* Name.Class */
.no { color: #336600 } /* Name.Constant */
.nd { color: #9999FF } /* Name.Decorator */
.ni { color: #999999; } /* Name.Entity */
.ne { color: #CC0000; } /* Name.Exception */
.nf { color: #CC00FF } /* Name.Function */
.nl { color: #9999FF } /* Name.Label */
.nn { color: #00CCFF; } /* Name.Namespace */
.nt { color: #2f6f9f; } /* Name.Tag */
.nv { color: #003333 } /* Name.Variable */
.ow { color: #000000; } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mf { color: #FF6600 } /* Literal.Number.Float */
.mh { color: #FF6600 } /* Literal.Number.Hex */
.mi { color: #FF6600 } /* Literal.Number.Integer */
.mo { color: #FF6600 } /* Literal.Number.Oct */
.sb { color: #CC3300 } /* Literal.String.Backtick */
.sc { color: #CC3300 } /* Literal.String.Char */
.sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */
.s2 { color: #CC3300 } /* Literal.String.Double */
.se { color: #CC3300; } /* Literal.String.Escape */
.sh { color: #CC3300 } /* Literal.String.Heredoc */
.si { color: #AA0000 } /* Literal.String.Interpol */
.sx { color: #CC3300 } /* Literal.String.Other */
.sr { color: #33AAAA } /* Literal.String.Regex */
.s1 { color: #CC3300 } /* Literal.String.Single */
.ss { color: #FFCC33 } /* Literal.String.Symbol */
.bp { color: #336666 } /* Name.Builtin.Pseudo */
.vc { color: #003333 } /* Name.Variable.Class */
.vg { color: #003333 } /* Name.Variable.Global */
.vi { color: #003333 } /* Name.Variable.Instance */
.il { color: #FF6600 } /* Literal.Number.Integer.Long */
.css .o,
.css .o + .nt,
.css .nt + .nt { color: #999; }

View File

@ -1,8 +0,0 @@
#This is a header
This is a simple **markdown file**. When I type stuff, it appears!
I can get it to reload and everything...
But if there are multiple lines...
I really do expect a paragraph break, here, though. I don't