mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
Merge branch 'master' of https://github.com/urbit/urbit
This commit is contained in:
commit
897855c76b
@ -19,30 +19,30 @@
|
||||
== ::
|
||||
++ hood :: assembly plan
|
||||
$: zus=@ud :: zuse kelvin
|
||||
sur=(list hook) :: structures
|
||||
sur=(list hoot) :: structures
|
||||
lib=(list hoof) :: libraries
|
||||
fan=(list horn) :: resources
|
||||
src=(list hoop) :: program
|
||||
== ::
|
||||
++ hoof (pair term (unit (pair case ship))) :: resource reference
|
||||
++ hook (pair bean hoof) :: structure gate/core
|
||||
++ hoot (pair bean hoof) :: structure gate/core
|
||||
++ hoop :: source in hood
|
||||
$% [%& p=twig] :: direct twig
|
||||
[%| p=beam] :: resource location
|
||||
== ::
|
||||
++ horn :: resource tree
|
||||
$% [%and p=twig] :: /& twig by hand
|
||||
$% [%ape p=twig] :: /& twig by hand
|
||||
[%arg p=twig] :: /$ argument
|
||||
[%day p=horn] :: /| @dr map by @dr
|
||||
[%day p=horn] :: /| list by @dr
|
||||
[%dub p=term q=horn] :: /= apply face
|
||||
[%fan p=(list horn)] :: /: list
|
||||
[%fan p=(list horn)] :: /. list
|
||||
[%for p=path q=horn] :: /, descend
|
||||
[%hub p=horn] :: /@ map by @ud
|
||||
[%man p=(map term horn)] :: /* map by hand
|
||||
[%nap p=horn] :: /% map by @tas
|
||||
[%now p=horn] :: /& map by @da
|
||||
[%hub p=horn] :: /@ list by @ud
|
||||
[%man p=(map span horn)] :: /* hetero map
|
||||
[%nap p=horn] :: /% homo map
|
||||
[%now p=horn] :: /& list by @da
|
||||
[%saw p=twig q=horn] :: /; operate on
|
||||
[%see p=beam q=horn] :: /. relative to
|
||||
[%see p=beam q=horn] :: /: relative to
|
||||
[%sic p=tile q=horn] :: /^ cast
|
||||
[%toy p=mark] :: /mark/ static
|
||||
== ::
|
||||
@ -409,7 +409,7 @@
|
||||
++ fang :: protocol door
|
||||
|= [cof=cafe for=mark bek=beak]
|
||||
^- (bolt vase)
|
||||
=+ pax=/door/[for]/mac
|
||||
=+ pax=/door/[for]/mar
|
||||
=+ ^= bem ^- beam
|
||||
:_ pax
|
||||
?: =(p.bek our) bek
|
||||
@ -443,7 +443,7 @@
|
||||
==
|
||||
::
|
||||
;~ pose
|
||||
(ifix [;~(plug fas hep gap) gap] (most ;~(plug com gaw) hook))
|
||||
(ifix [;~(plug fas hep gap) gap] (most ;~(plug com gaw) hoot))
|
||||
(easy ~)
|
||||
==
|
||||
::
|
||||
@ -467,7 +467,7 @@
|
||||
==
|
||||
==
|
||||
::
|
||||
++ hook
|
||||
++ hoot
|
||||
;~ pose
|
||||
(stag %| ;~(pfix tar hoof))
|
||||
(stag %& hoof)
|
||||
@ -488,8 +488,8 @@
|
||||
;~ pfix fas
|
||||
;~ pose
|
||||
(stag %toy ;~(sfix sym fas))
|
||||
(stag %and ;~(pfix and:sign and:read))
|
||||
(stag %arg ;~(pfix arg:sign and:read))
|
||||
(stag %ape ;~(pfix ape:sign ape:read))
|
||||
(stag %arg ;~(pfix arg:sign ape:read))
|
||||
(stag %day ;~(pfix day:sign day:read))
|
||||
(stag %dub ;~(pfix dub:sign dub:read))
|
||||
(stag %fan ;~(pfix fan:sign fan:read))
|
||||
@ -498,6 +498,7 @@
|
||||
(stag %man ;~(pfix man:sign man:read))
|
||||
(stag %nap ;~(pfix nap:sign day:read))
|
||||
(stag %now ;~(pfix now:sign day:read))
|
||||
(stag %saw ;~(pfix saw:sign saw:read))
|
||||
(stag %see ;~(pfix see:sign see:read))
|
||||
(stag %sic ;~(pfix sic:sign sic:read))
|
||||
==
|
||||
@ -509,7 +510,7 @@
|
||||
;~(pose wid tal)
|
||||
::
|
||||
++ read
|
||||
|% ++ and
|
||||
|% ++ ape
|
||||
%+ rail
|
||||
(ifix [sel ser] (stag %cltr (most ace wide:vez)))
|
||||
;~(pfix gap tall:vez)
|
||||
@ -546,28 +547,33 @@
|
||||
::
|
||||
++ see
|
||||
%+ rail
|
||||
;~(plug (ifix [sel ser] have) apex(tol |))
|
||||
;~(plug ;~(sfix have col) apex(tol |))
|
||||
;~(pfix gap ;~(plug have ;~(pfix gap apex)))
|
||||
::
|
||||
++ saw
|
||||
%+ rail
|
||||
;~(plug ;~(sfix wide:vez sem) apex(tol |))
|
||||
;~(pfix gap ;~(plug tall:vez ;~(pfix gap apex)))
|
||||
::
|
||||
++ sic
|
||||
%+ rail
|
||||
;~(plug (ifix [sel ser] toil:vez) apex(tol |))
|
||||
;~(plug ;~(sfix toil:vez ket) apex(tol |))
|
||||
;~(pfix gap ;~(plug howl:vez ;~(pfix gap apex)))
|
||||
--
|
||||
::
|
||||
++ sign
|
||||
|% ++ and ;~(pose pam (jest %and))
|
||||
|% ++ ape ;~(pose sig (jest %ape))
|
||||
++ arg ;~(pose buc (jest %arg))
|
||||
++ day ;~(pose bar (jest %day))
|
||||
++ dub ;~(pose tis (jest %dub))
|
||||
++ fan ;~(pose col (jest %fan))
|
||||
++ fan ;~(pose dot (jest %fan))
|
||||
++ for ;~(pose com (jest %for))
|
||||
++ hub ;~(pose pat (jest %hub))
|
||||
++ man ;~(pose tar (jest %man))
|
||||
++ nap ;~(pose cen (jest %nap))
|
||||
++ now ;~(pose fas (jest %now))
|
||||
++ saw ;~(pose sem (jest %saw))
|
||||
++ see ;~(pose dot (jest %see))
|
||||
++ see ;~(pose col (jest %see))
|
||||
++ sic ;~(pose ket (jest %sic))
|
||||
--
|
||||
--
|
||||
@ -963,40 +969,62 @@
|
||||
|= [cof=cafe sel=_..body]
|
||||
^$(cof cof, src t.src, ..body sel)
|
||||
::
|
||||
++ chai :: atomic map
|
||||
++ chad :: atomic list
|
||||
|= [cof=cafe bax=vase doe=term hon=horn]
|
||||
^- (bolt vase)
|
||||
%+ cope ((lash (slat doe)) cof how)
|
||||
|= [cof=cafe yep=(map ,@ span)]
|
||||
=+ ^= poy ^- (list (pair ,@ span))
|
||||
%+ sort (~(tap by yep) ~)
|
||||
|=([a=[@ *] b=[@ *]] (lth -.a -.b))
|
||||
%+ cope
|
||||
|- ^- (bolt (list (pair ,@ vase)))
|
||||
?~ poy (fine cof ~)
|
||||
%+ cope $(poy t.poy)
|
||||
|= [cof=cafe nex=(list (pair ,@ vase))]
|
||||
%+ cope (chap(s.how [q.i.poy s.how]) cof bax hon)
|
||||
|= [cof=cafe elt=vase]
|
||||
(fine cof [[p.i.poy elt] nex])
|
||||
|= [cof=cafe yal=(list (pair ,@ vase))]
|
||||
%+ fine cof
|
||||
|- ^- vase
|
||||
?~ yal [[%cube 0 [%atom %n]] 0]
|
||||
(slop (slop [[%atom doe] p.i.yal] q.i.yal) $(yal t.yal))
|
||||
::
|
||||
++ chai :: atomic map
|
||||
|= [cof=cafe bax=vase hon=horn]
|
||||
^- (bolt vase)
|
||||
%+ cope (lend cof how)
|
||||
|= [cof=cafe arc=arch]
|
||||
%+ cope
|
||||
|- ^- (bolt (map ,@ vase))
|
||||
?~ yep (fine cof ~)
|
||||
%+ cope $(yep l.yep)
|
||||
?~ r.arc (fine cof ~)
|
||||
%+ cope $(r.arc l.r.arc)
|
||||
|= [cof=cafe lef=(map ,@ vase)]
|
||||
%+ cope `(bolt (map ,@ vase))`^$(cof cof, yep r.yep)
|
||||
%+ cope `(bolt (map ,@ vase))`^$(cof cof, r.arc r.r.arc)
|
||||
|= [cof=cafe rig=(map ,@ vase)]
|
||||
%+ cope (chap(s.how [q.n.yep s.how]) cof bax hon)
|
||||
%+ cope (chap(s.how [p.n.r.arc s.how]) cof bax hon)
|
||||
|= [cof=cafe nod=vase]
|
||||
(fine cof [[p.n.yep nod] lef rig])
|
||||
(fine cof [[p.n.r.arc nod] lef rig])
|
||||
|= [cof=cafe doy=(map ,@ vase)]
|
||||
%+ fine cof
|
||||
|- ^- vase
|
||||
?~ doy [[%cube 0 [%atom %n]] 0]
|
||||
%+ slop
|
||||
(slop [[%atom doe] p.n.doy] q.n.doy)
|
||||
(slop [[%atom %a] p.n.doy] q.n.doy)
|
||||
(slop $(doy l.doy) $(doy r.doy))
|
||||
::
|
||||
++ chap :: produce resources
|
||||
|= [cof=cafe bax=vase hon=horn]
|
||||
^- (bolt vase)
|
||||
?- -.hon
|
||||
%and (maim cof bax p.hon)
|
||||
%ape (maim cof bax p.hon)
|
||||
%arg
|
||||
%+ cope (maim cof bax p.hon)
|
||||
|= [cof=cafe gat=vase]
|
||||
(maul cof gat !>([how arg]))
|
||||
::
|
||||
%day (chai cof bax %dr p.hon)
|
||||
%day (chad cof bax %dr p.hon)
|
||||
%dub
|
||||
%+ cope $(hon q.hon)
|
||||
|= [cof=cafe vax=vase]
|
||||
@ -1018,7 +1046,7 @@
|
||||
(slop i.tev $(tev t.tev))
|
||||
::
|
||||
%for $(hon q.hon, s.how (weld (flop p.hon) s.how))
|
||||
%hub (chai cof bax %ud p.hon)
|
||||
%hub (chad cof bax %ud p.hon)
|
||||
%man
|
||||
|- ^- (bolt vase)
|
||||
?~ p.hon (fine cof [[%cube 0 [%atom %n]] 0])
|
||||
@ -1033,9 +1061,8 @@
|
||||
(slop [[%atom %tas] p.n.p.hon] vax)
|
||||
(slop lef rig)
|
||||
::
|
||||
%now (chai cof bax %da p.hon)
|
||||
%nap (chai cof bax %tas p.hon)
|
||||
::
|
||||
%now (chad cof bax %da p.hon)
|
||||
%nap (chai cof bax p.hon)
|
||||
%see $(hon q.hon, how p.hon)
|
||||
%saw
|
||||
%+ cope $(hon q.hon)
|
||||
@ -1051,13 +1078,13 @@
|
||||
|= [cof=cafe tug=vase]
|
||||
?. (~(nest ut p.tug) | p.vax)
|
||||
(flaw cof [%leaf "type error: {<p.hon>} {<q.hon>}"]~)
|
||||
(fine cof vax)
|
||||
(fine cof [p.tug q.vax])
|
||||
::
|
||||
%toy (cope (make cof %bake p.hon how ~) feel)
|
||||
==
|
||||
::
|
||||
++ head :: consume structures
|
||||
|= [cof=cafe bir=(list hook)]
|
||||
|= [cof=cafe bir=(list hoot)]
|
||||
|- ^- (bolt ,_..head)
|
||||
?~ bir
|
||||
(fine cof ..head)
|
||||
|
5
main/lib/example/core.hook
Normal file
5
main/lib/example/core.hook
Normal file
@ -0,0 +1,5 @@
|
||||
|%
|
||||
++ fib |=(x=@ ~+(?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2))))))
|
||||
--
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
::
|
||||
:::: /hoon/core/html/pro
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
:::: compute
|
||||
::
|
||||
|_ htm=@t
|
||||
::
|
||||
++ grow :: convert to
|
||||
|%
|
||||
++ mime :: convert to %mime
|
||||
[/text/html (met 3 htm) htm]
|
||||
--
|
||||
--
|
||||
|
16
main/mar/html/door.hook
Normal file
16
main/mar/html/door.hook
Normal file
@ -0,0 +1,16 @@
|
||||
::
|
||||
:::: /hoon/core/html/pro
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
:::: compute
|
||||
::
|
||||
|_ htm=@t
|
||||
::
|
||||
++ grow :: convert to
|
||||
|% ::
|
||||
++ mime [/text/html (met 3 htm) htm] :: to %mime
|
||||
++ hymn (rash htm apex:xmlp) :: to %hymn
|
||||
-- ::
|
||||
--
|
||||
|
12
main/pub/fab/fun/five/hymn.hook
Normal file
12
main/pub/fab/fun/five/hymn.hook
Normal file
@ -0,0 +1,12 @@
|
||||
/= ctx /$ |=([p=beam q=path] +<)
|
||||
::
|
||||
;html
|
||||
;head
|
||||
;title: Fun Experiment Five
|
||||
==
|
||||
;body
|
||||
;p: This page was built at {<(tope p.ctx)>}.
|
||||
;br;
|
||||
;p: The remainder path was {<q.ctx>}.
|
||||
==
|
||||
==
|
19
main/pub/fab/fun/four/hymn.hook
Normal file
19
main/pub/fab/fun/four/hymn.hook
Normal file
@ -0,0 +1,19 @@
|
||||
/= gas /$ fuel
|
||||
::
|
||||
=+ arg=(biff (~(get by qix.gas) %number) (slat %ud))
|
||||
=+ fib=|=(x=@ ~+(?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2))))))
|
||||
::
|
||||
;html
|
||||
;head
|
||||
;title: Fun Experiment Four
|
||||
==
|
||||
;body
|
||||
;p: Welcome, {<cip.ced.gas>}!
|
||||
;+ ?~ arg
|
||||
;p: Usage: ?number=x
|
||||
;p ; This is an ;{i "HTML file"} which
|
||||
; computes the Fibonacci number
|
||||
; of {<u.arg>}: {<(fib u.arg)>}.
|
||||
==
|
||||
==
|
||||
==
|
1
main/pub/fab/fun/one.md
Normal file
1
main/pub/fab/fun/one.md
Normal file
@ -0,0 +1 @@
|
||||
This is a *fun experiment* in markdown.
|
11
main/pub/fab/fun/three/hymn.hook
Normal file
11
main/pub/fab/fun/three/hymn.hook
Normal file
@ -0,0 +1,11 @@
|
||||
=+ fib=|=(x=@ ?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2)))))
|
||||
;html
|
||||
;head ;title: Fun Experiment Three
|
||||
==
|
||||
;body
|
||||
;p ; This is an ;{i "HTML file"} which
|
||||
; computes the Fibonacci number
|
||||
; of 12: {<(fib 12)>}.
|
||||
==
|
||||
==
|
||||
==
|
5
main/pub/fab/fun/two/down.hook
Normal file
5
main/pub/fab/fun/two/down.hook
Normal file
@ -0,0 +1,5 @@
|
||||
:~ :- %par
|
||||
:~ tex/"This is a "
|
||||
emp/bent/~[tex/"fun experiment "]
|
||||
tex/"in markdown; 2 + 2 is {<(add 2 2)>}."
|
||||
== ==
|
9
main/pub/fab/mad/five/down.hook
Normal file
9
main/pub/fab/mad/five/down.hook
Normal file
@ -0,0 +1,9 @@
|
||||
/- down
|
||||
^- down
|
||||
:~ :- %par
|
||||
:~ tex/"This is a "
|
||||
emp/bent/~[tex/"fun experiment "]
|
||||
tex/"in markdown; 2 + 2 is {<(add 2 2)>}."
|
||||
== ==
|
||||
|
||||
|
21
main/pub/fab/mad/four/hymn.hook
Normal file
21
main/pub/fab/mad/four/hymn.hook
Normal file
@ -0,0 +1,21 @@
|
||||
:: This fourth experiment is profoundly biblical.
|
||||
::
|
||||
:::: /hoon/four/mad/fab/pub
|
||||
::
|
||||
/= bible /: /======/res/bible
|
||||
/; |= a=(list (pair ,@ manx))
|
||||
(turn a |=([* b=manx] b))
|
||||
/@
|
||||
/hymn/
|
||||
::
|
||||
:::: ~tasfyn-partyv
|
||||
::
|
||||
!:
|
||||
;html
|
||||
;head
|
||||
;title: Mad Experiment Four
|
||||
==
|
||||
;body
|
||||
;* bible
|
||||
==
|
||||
==
|
25
main/pub/fab/mad/one/hymn.hook
Normal file
25
main/pub/fab/mad/one/hymn.hook
Normal file
@ -0,0 +1,25 @@
|
||||
:: Our first experiment with major hood runes.
|
||||
::
|
||||
:::: /hoon/one/mad/src/pub
|
||||
::
|
||||
/= gas /$ fuel
|
||||
// /===/pub/src/mad/fib
|
||||
::
|
||||
:::: ~tasfyn-partyv
|
||||
::
|
||||
=+ arg=(biff (~(get by qix.gas) %number) (slat %ud))
|
||||
::
|
||||
;html
|
||||
;head
|
||||
;title: Mad Experiment One
|
||||
==
|
||||
;body
|
||||
;+ ?~ arg
|
||||
;p: Usage: ?number=x
|
||||
;p ; This is an ;{i "HTML file"} which
|
||||
; computes the Fibonacci number
|
||||
; of {<u.arg>}: {<(fib u.arg)>}.
|
||||
==
|
||||
==
|
||||
==
|
||||
|
1
main/pub/fab/mad/res/bible/1.html
Normal file
1
main/pub/fab/mad/res/bible/1.html
Normal file
@ -0,0 +1 @@
|
||||
<p>The earth was without form, and void.</p>
|
1
main/pub/fab/mad/res/bible/2.html
Normal file
1
main/pub/fab/mad/res/bible/2.html
Normal file
@ -0,0 +1 @@
|
||||
<p>Then Cain slew Abel.</p>
|
1
main/pub/fab/mad/res/bible/3.html
Normal file
1
main/pub/fab/mad/res/bible/3.html
Normal file
@ -0,0 +1 @@
|
||||
<p>I bring not peace, but a sword.</p>
|
1
main/pub/fab/mad/res/bible/4.html
Normal file
1
main/pub/fab/mad/res/bible/4.html
Normal file
@ -0,0 +1 @@
|
||||
<p>And I saw a pale horse, and upon him a pale rider.</p>
|
1
main/pub/fab/mad/res/hello/hymn.hook
Normal file
1
main/pub/fab/mad/res/hello/hymn.hook
Normal file
@ -0,0 +1 @@
|
||||
;p: Hello, world.
|
23
main/pub/fab/mad/six/hymn.hook
Normal file
23
main/pub/fab/mad/six/hymn.hook
Normal file
@ -0,0 +1,23 @@
|
||||
:: Our sixth experiment with major hood runes.
|
||||
::
|
||||
:::: /hoon/six/mad/fab/pub
|
||||
::
|
||||
/+ example
|
||||
/= gas /$ fuel
|
||||
::
|
||||
:::: ~tasfyn-partyv
|
||||
::
|
||||
=+ arg=(biff (~(get by qix.gas) %number) (slat %ud))
|
||||
;html
|
||||
;head
|
||||
;title: Mad Experiment Two
|
||||
==
|
||||
;body
|
||||
;+ ?~ arg
|
||||
;p: Usage: ?number=x
|
||||
;p ; This is an ;{i "HTML file"} which
|
||||
; computes the Fibonacci number
|
||||
; of {<u.arg>}: {<(fib u.arg)>}.
|
||||
==
|
||||
==
|
||||
==
|
17
main/pub/fab/mad/three/hymn.hook
Normal file
17
main/pub/fab/mad/three/hymn.hook
Normal file
@ -0,0 +1,17 @@
|
||||
:: This third experiment wears the horns.
|
||||
::
|
||||
:::: /hoon/three/mad/fab/pub
|
||||
::
|
||||
/= hello /^ manx /:/======/res/hello:/hymn/
|
||||
::
|
||||
:::: ~tasfyn-partyv
|
||||
::
|
||||
;html
|
||||
;head
|
||||
;title: Mad Experiment Three
|
||||
==
|
||||
;body
|
||||
;+ hello
|
||||
==
|
||||
==
|
||||
|
25
main/pub/fab/mad/two/hymn.hook
Normal file
25
main/pub/fab/mad/two/hymn.hook
Normal file
@ -0,0 +1,25 @@
|
||||
:: Our second experiment with major hood runes.
|
||||
::
|
||||
:::: /hoon/two/mad/src/pub
|
||||
::
|
||||
/= gas /$ fuel
|
||||
// /===/pub/src/mad/tools
|
||||
::
|
||||
:::: ~tasfyn-partyv
|
||||
::
|
||||
=+ arg=(biff (~(get by qix.gas) %number) (slat %ud))
|
||||
::
|
||||
;html
|
||||
;head
|
||||
;title: Mad Experiment Two
|
||||
==
|
||||
;body
|
||||
;+ ?~ arg
|
||||
;p: Usage: ?number=x
|
||||
;p ; This is an ;{i "HTML file"} which
|
||||
; computes the Fibonacci number
|
||||
; of {<u.arg>}: {<(fib u.arg)>}.
|
||||
==
|
||||
==
|
||||
==
|
||||
|
3
main/pub/src/mad/fib.hoon
Normal file
3
main/pub/src/mad/fib.hoon
Normal file
@ -0,0 +1,3 @@
|
||||
|%
|
||||
++ fib |=(x=@ ~+(?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2))))))
|
||||
--
|
1
main/pub/src/mad/tools/fib.hoon
Normal file
1
main/pub/src/mad/tools/fib.hoon
Normal file
@ -0,0 +1 @@
|
||||
|=(x=@ ~+(?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2))))))
|
@ -4,3 +4,4 @@
|
||||
/? 314
|
||||
/- *markdown
|
||||
down
|
||||
|
||||
|
@ -19,3 +19,4 @@
|
||||
[%tex p=tape] :: text
|
||||
== ::
|
||||
--
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user