mirror of
https://github.com/urbit/shrub.git
synced 2025-01-05 19:46:50 +03:00
Merge commit '49429adb45ce1d7f685927ce6e901a3263d4c122' into remaint-merge-talk
This commit is contained in:
commit
41e2547c9b
152
app/dojo.hoon
152
app/dojo.hoon
@ -21,7 +21,7 @@
|
||||
$: say/sole-share :: command-line state
|
||||
dir/beam :: active path
|
||||
poy/(unit dojo-project) :: working
|
||||
{lib/(list hoof:ford) sur/(list hoof:ford)} :: lib+sur
|
||||
{lib/(list hoof:ford) sur/(list hoof:ford)} :: lib+sur
|
||||
var/(map term cage) :: variable state
|
||||
old/(set term) :: used TLVs
|
||||
buf/tape :: multiline buffer
|
||||
@ -41,7 +41,7 @@
|
||||
r/purl:eyre
|
||||
==
|
||||
{$poke p/goal} :: poke app
|
||||
{$show p/?($0 $1 $2 $3)} :: print val+span+twig
|
||||
{$show p/?($0 $1 $2 $3)} :: print val+type+hoon
|
||||
{$verb p/term} :: store variable
|
||||
{$help p/(list term)} :: look up help
|
||||
== ::
|
||||
@ -53,10 +53,10 @@
|
||||
$% {$ur p/(unit knot) q/purl:eyre} :: http GET request
|
||||
{$ge p/dojo-model} :: generator
|
||||
{$dv p/path} :: core from source
|
||||
{$ex p/twig} :: hoon expression
|
||||
{$ex p/hoon} :: hoon expression
|
||||
{$sa p/mark} :: example mark value
|
||||
{$as p/mark q/dojo-source} :: simple transmute
|
||||
{$do p/twig q/dojo-source} :: gate apply
|
||||
{$do p/hoon q/dojo-source} :: gate apply
|
||||
{$tu p/(list dojo-source)} :: tuple
|
||||
== ::
|
||||
++ dojo-model :: data construction
|
||||
@ -201,22 +201,22 @@
|
||||
++ dp-hooves :: hoof list
|
||||
:(stag 0 %ex %clsg (most ;~(plug com gaw) dp-hoof))
|
||||
::
|
||||
++ dp-hoof :: ++ford-hoof twig
|
||||
++ dp-hoof :: ++ford-hoof hoon
|
||||
;~ plug
|
||||
:(stag %sand %f ;~(pose (cold %| tar) (easy %&)))
|
||||
:(stag %sand %tas sym)
|
||||
%- dp-twig-punt
|
||||
%- dp-hoon-punt
|
||||
;~ (glue fas)
|
||||
;~(pfix fas (sear dp-case-twig nuck:so))
|
||||
;~(pfix fas (sear dp-case-hoon nuck:so))
|
||||
(stag %sand ;~(plug (cold %p sig) fed:ag))
|
||||
==
|
||||
==
|
||||
::
|
||||
++ dp-twig-punt :: twig of unit
|
||||
++ dp-hoon-punt :: hoon of unit
|
||||
|*(a/rule ;~(pose (stag [%bust %null] a) (easy [%bust %null])))
|
||||
::
|
||||
++ dp-case-twig
|
||||
|= a/coin ^- (unit twig)
|
||||
++ dp-case-hoon
|
||||
|= a/coin ^- (unit hoon)
|
||||
?. ?=({$~ case} a) ~
|
||||
%+ some
|
||||
[%rock %tas p.p.a]
|
||||
@ -229,7 +229,7 @@
|
||||
;~(plug (cold %ur lus) dp-iden-url)
|
||||
;~(plug (cold %ge lus) dp-model)
|
||||
;~(plug (cold %as pam) sym ;~(pfix ace dp-source))
|
||||
;~(plug (cold %do cab) dp-twig ;~(pfix ace dp-source))
|
||||
;~(plug (cold %do cab) dp-hoon ;~(pfix ace dp-source))
|
||||
dp-value
|
||||
==
|
||||
::
|
||||
@ -256,8 +256,8 @@
|
||||
++ dp-model ;~(plug dp-server dp-config) :: ++dojo-model
|
||||
++ dp-path (en-beam he-beam) :: ++path
|
||||
++ dp-server (stag 0 (most fas sym)) :: ++dojo-server
|
||||
++ dp-twig tall:(vang | dp-path) :: ++twig
|
||||
++ dp-rood :: 'dir' twig
|
||||
++ dp-hoon tall:(vang | dp-path) :: ++hoon
|
||||
++ dp-rood :: 'dir' hoon
|
||||
=> (vang | (en-beam dir))
|
||||
;~ pose
|
||||
rood
|
||||
@ -272,7 +272,7 @@
|
||||
++ dp-value :: ++dojo-source
|
||||
;~ pose
|
||||
(stag %sa ;~(pfix tar pam sym))
|
||||
(stag %ex dp-twig)
|
||||
(stag %ex dp-hoon)
|
||||
(stag %tu (ifix [sel ser] (most ace dp-source)))
|
||||
==
|
||||
::
|
||||
@ -536,7 +536,7 @@
|
||||
?- p.p.mad
|
||||
$0 ~
|
||||
$1 [[%rose [~ " " ~] (skol p.q.cay) ~] (mar)]
|
||||
$2 [[%rose [~ " " ~] (dy-show-span-noun p.q.cay) ~] (mar)]
|
||||
$2 [[%rose [~ " " ~] (dy-show-type-noun p.q.cay) ~] (mar)]
|
||||
==
|
||||
==
|
||||
::
|
||||
@ -558,17 +558,17 @@
|
||||
==
|
||||
::
|
||||
++ dy-inspect
|
||||
|= {topic/(list term) sut/span}
|
||||
|= {topic/(list term) sut/type}
|
||||
%+ dy-rash %tan
|
||||
|^ ^- tang
|
||||
=+ to-display=(find-item-in-span (flop topic) sut)
|
||||
=+ to-display=(find-item-in-type (flop topic) sut)
|
||||
?~ to-display
|
||||
[%leaf "Could not find help"]~
|
||||
(flop (print-item u.to-display))
|
||||
:> # %models
|
||||
+|
|
||||
::
|
||||
:> an overview of all named things in the span.
|
||||
:> an overview of all named things in the type.
|
||||
:>
|
||||
:> each item in the overview list is either a documentation for a sublist
|
||||
:> or an association between a term and documentation for it.
|
||||
@ -582,15 +582,15 @@
|
||||
{$item name/tape doc/what}
|
||||
==
|
||||
::
|
||||
:> the part of a {span} being inspected.
|
||||
:> the part of a {type} being inspected.
|
||||
++ item
|
||||
$% :> overview of span
|
||||
$% :> overview of type
|
||||
{$view items/overview}
|
||||
:> inspecting a full core.
|
||||
$: $core
|
||||
name/tape
|
||||
docs/what
|
||||
sut/span
|
||||
sut/type
|
||||
con/coil
|
||||
children/(unit item)
|
||||
==
|
||||
@ -599,13 +599,13 @@
|
||||
name/tape
|
||||
docs/what
|
||||
f/foot
|
||||
sut/span
|
||||
sut/type
|
||||
==
|
||||
:> inspecting a single chapter on a core.
|
||||
$: $chapter
|
||||
name/tape
|
||||
docs/what
|
||||
sut/span
|
||||
sut/type
|
||||
con/coil
|
||||
chapter-id/@
|
||||
==
|
||||
@ -623,11 +623,11 @@
|
||||
+|
|
||||
:> returns the item to print while searching through {topic}.
|
||||
:>
|
||||
:> this gate is called recursively to find the path {topic} in the span
|
||||
:> {sut}. once it finds the correct part of the span, it switches to
|
||||
:> ++build-inspectable-recursively to describe that part of the span.
|
||||
++ find-item-in-span
|
||||
|= {topics/(list term) sut/span}
|
||||
:> this gate is called recursively to find the path {topic} in the type
|
||||
:> {sut}. once it finds the correct part of the type, it switches to
|
||||
:> ++build-inspectable-recursively to describe that part of the type.
|
||||
++ find-item-in-type
|
||||
|= {topics/(list term) sut/type}
|
||||
^- (unit item)
|
||||
?~ topics
|
||||
:: we have no more search path. return the rest as an overview
|
||||
@ -682,31 +682,31 @@
|
||||
~
|
||||
?~ t.topics
|
||||
`[%face (trip q.p.sut) p.p.sut (build-inspectable-recursively q.sut)]
|
||||
(find-item-in-span t.topics q.sut)
|
||||
(find-item-in-type t.topics q.sut)
|
||||
::
|
||||
{$fork *}
|
||||
=/ spans/(list span) ~(tap in p.sut)
|
||||
=/ types/(list type) ~(tap in p.sut)
|
||||
|-
|
||||
?~ spans
|
||||
?~ types
|
||||
~
|
||||
=+ res=(find-item-in-span topics i.spans)
|
||||
=+ res=(find-item-in-type topics i.types)
|
||||
?~ res
|
||||
$(spans t.spans)
|
||||
$(types t.types)
|
||||
res
|
||||
::
|
||||
{$help *}
|
||||
:: while we found a raw help, it's associated on the wrong side of a
|
||||
:: set of topics. Walk through it instead of showing it.
|
||||
(find-item-in-span t.topics q.sut)
|
||||
(find-item-in-type t.topics q.sut)
|
||||
::
|
||||
{$hold *} $(sut (~(play ut p.sut) q.sut))
|
||||
$noun ~
|
||||
$void ~
|
||||
==
|
||||
::
|
||||
:> changes a {span} into an {item}.
|
||||
:> changes a {type} into an {item}.
|
||||
++ build-inspectable-recursively
|
||||
|= sut/span
|
||||
|= sut/type
|
||||
^- (unit item)
|
||||
?- sut
|
||||
::
|
||||
@ -730,13 +730,13 @@
|
||||
`[%face (trip q.p.sut) p.p.sut compiled-against]
|
||||
::
|
||||
{$fork *}
|
||||
=* spans ~(tap in p.sut)
|
||||
=* items (turn spans build-inspectable-recursively)
|
||||
=* types ~(tap in p.sut)
|
||||
=* items (turn types build-inspectable-recursively)
|
||||
(roll items join-items)
|
||||
::
|
||||
{$help *}
|
||||
=* rest-span (build-inspectable-recursively q.sut)
|
||||
`[%view [%header p.sut (item-as-overview rest-span)]~]
|
||||
=* rest-type (build-inspectable-recursively q.sut)
|
||||
`[%view [%header p.sut (item-as-overview rest-type)]~]
|
||||
::
|
||||
{$hold *} $(sut (~(play ut p.sut) q.sut))
|
||||
$noun ~
|
||||
@ -782,7 +782,7 @@
|
||||
::
|
||||
:> translate the internals of a core's {tomb} into an {overview}.
|
||||
++ arms-as-overview
|
||||
|= {a/(map term (pair what foot)) sut/span}
|
||||
|= {a/(map term (pair what foot)) sut/type}
|
||||
^- overview
|
||||
%+ turn ~(tap by a)
|
||||
|= (pair term (pair what foot))
|
||||
@ -807,7 +807,7 @@
|
||||
:> returns an overview for arms which are part of unnamed chapters,
|
||||
:> and an overview of the named chapters.
|
||||
++ arm-and-chapter-overviews
|
||||
|= {sut/span con/coil core-name/tape}
|
||||
|= {sut/type con/coil core-name/tape}
|
||||
^- {overview overview}
|
||||
=| arm-docs/overview :< documented arms
|
||||
=| chapter-docs/overview :< documented chapters
|
||||
@ -830,7 +830,7 @@
|
||||
::
|
||||
:> returns an overview of the arms in a specific chapter.
|
||||
++ arms-in-chapter
|
||||
|= {sut/span con/coil chapter-id/@}
|
||||
|= {sut/type con/coil chapter-id/@}
|
||||
^- overview
|
||||
=* chapter-tomb (~(got by q.s.con) chapter-id)
|
||||
(sort-overview (arms-as-overview q.chapter-tomb sut))
|
||||
@ -850,8 +850,8 @@
|
||||
{$item *} name.ovr
|
||||
==
|
||||
::
|
||||
++ what-from-span
|
||||
|= sut/span
|
||||
++ what-from-type
|
||||
|= sut/type
|
||||
?+ sut ~
|
||||
{$core *} q.r.q.sut
|
||||
{$help *} p.sut
|
||||
@ -876,7 +876,7 @@
|
||||
::
|
||||
:> renders the documentation for a full core.
|
||||
++ print-core
|
||||
|= {core-name/tape docs/what sut/span con/coil uit/(unit item)}
|
||||
|= {core-name/tape docs/what sut/type con/coil uit/(unit item)}
|
||||
^- tang
|
||||
=+ [arms chapters]=(arm-and-chapter-overviews sut con core-name)
|
||||
;: weld
|
||||
@ -902,19 +902,19 @@
|
||||
:> figures out which {what}s to use.
|
||||
:>
|
||||
:> there are three places with a relevant {what}: the {arm-doc} on the
|
||||
:> arm, the {what} in the computed span of the foot, and the {what} on
|
||||
:> the product of the default arm when the computed span is a core.
|
||||
:> arm, the {what} in the computed type of the foot, and the {what} on
|
||||
:> the product of the default arm when the computed type is a core.
|
||||
++ select-arm-docs
|
||||
|= {arm-doc/what f/foot sut/span}
|
||||
|= {arm-doc/what f/foot sut/type}
|
||||
:> the computed arm documentation and the product documentation.
|
||||
^- {what what}
|
||||
=+ foot-span=(~(play ut sut) p.f)
|
||||
=+ raw-product=(what-from-span foot-span)
|
||||
=+ foot-type=(~(play ut sut) p.f)
|
||||
=+ raw-product=(what-from-type foot-type)
|
||||
=/ product-product/what
|
||||
?. ?=({$core *} foot-span)
|
||||
?. ?=({$core *} foot-type)
|
||||
~
|
||||
=* inner-span (~(play ut foot-span) [%limb %$])
|
||||
(what-from-span inner-span)
|
||||
=* inner-type (~(play ut foot-type) [%limb %$])
|
||||
(what-from-type inner-type)
|
||||
:-
|
||||
?~ arm-doc
|
||||
raw-product
|
||||
@ -925,7 +925,7 @@
|
||||
::
|
||||
:> renders the documentation for a single arm in a core.
|
||||
++ print-arm
|
||||
|= {arm-name/tape arm-doc/what f/foot sut/span}
|
||||
|= {arm-name/tape arm-doc/what f/foot sut/type}
|
||||
:: todo: need to get the sample here. also hoist this to the general
|
||||
:: core printing machinery, too.
|
||||
=+ [main-doc product-doc]=(select-arm-docs arm-doc f sut)
|
||||
@ -939,7 +939,7 @@
|
||||
::
|
||||
:> renders the documentation for a chapter in a core.
|
||||
++ print-chapter
|
||||
|= {name/tape doc/what sut/span con/coil chapter-id/@}
|
||||
|= {name/tape doc/what sut/type con/coil chapter-id/@}
|
||||
;: weld
|
||||
(print-header name doc)
|
||||
::
|
||||
@ -1114,15 +1114,15 @@
|
||||
$(ret l, c t.c)
|
||||
$(c t.c)
|
||||
::
|
||||
++ dy-show-span-noun
|
||||
|= a/span ^- tank
|
||||
++ dy-show-type-noun
|
||||
|= a/type ^- tank
|
||||
=- >[-]<
|
||||
|- ^- $? $% {$atom @tas (unit @)}
|
||||
{$cell _$ _$}
|
||||
{$cube * _$}
|
||||
{$face {what $@(term tune)} _$}
|
||||
{$fork (set _$)}
|
||||
{$hold _$ twig}
|
||||
{$hold _$ hoon}
|
||||
==
|
||||
wain :: "<|core|>"
|
||||
$?($noun $void)
|
||||
@ -1130,20 +1130,20 @@
|
||||
?+ a a
|
||||
{?($cube $face) ^} a(q $(a q.a))
|
||||
{$cell ^} a(p $(a p.a), q $(a q.a))
|
||||
{$fork *} a(p (silt (turn ~(tap in p.a) |=(b/span ^$(a b)))))
|
||||
{$fork *} a(p (silt (turn ~(tap in p.a) |=(b/type ^$(a b)))))
|
||||
{$help *} !!
|
||||
{$core ^} `wain`/core
|
||||
{$hold *} a(p $(a p.a))
|
||||
==
|
||||
::
|
||||
++ dy-shown
|
||||
$? twig
|
||||
$? hoon
|
||||
$^ {dy-shown dy-shown}
|
||||
$% {$ur (unit knot) purl:eyre}
|
||||
{$dv path}
|
||||
{$sa mark}
|
||||
{$as mark dy-shown}
|
||||
{$do twig dy-shown}
|
||||
{$do hoon dy-shown}
|
||||
{$ge path (list dy-shown) (map term (unit dy-shown))}
|
||||
==
|
||||
==
|
||||
@ -1156,7 +1156,7 @@
|
||||
?- -.bil
|
||||
$?($ur $dv $sa) bil
|
||||
$ex ?. ?=({$cltr *} p.bil) p.bil
|
||||
|- ^- twig
|
||||
|- ^- hoon
|
||||
?~ p.p.bil !!
|
||||
?~ t.p.p.bil i.p.p.bil
|
||||
[i.p.p.bil $(p.p.bil t.p.p.bil)]
|
||||
@ -1180,7 +1180,7 @@
|
||||
(dy-diff %mor [%det lic] [%bel ~] ~)
|
||||
(dy-slam(per `dat) /edit u.pro !>((tufa buf.say)))
|
||||
::
|
||||
++ dy-span :: sole action
|
||||
++ dy-type :: sole action
|
||||
|= act/sole-action
|
||||
?- -.act
|
||||
$det (dy-edit +.act)
|
||||
@ -1230,7 +1230,7 @@
|
||||
%- dy-silk-vase
|
||||
?~(b !>([~ ~]) (dy-vase p.u.b))
|
||||
::
|
||||
++ dy-twig-head :: dynamic state
|
||||
++ dy-hoon-head :: dynamic state
|
||||
:: todo: how do i separate the toplevel 'dojo state' comment?
|
||||
:> dojo state
|
||||
:>
|
||||
@ -1286,7 +1286,7 @@
|
||||
(dy-meal (slot 7 vax))
|
||||
::
|
||||
$|
|
||||
=> .(vax (slap vax !,(*twig ?>(?=($| -) .)))) :: XX working spec #72
|
||||
=> .(vax (slap vax !,(*hoon ?>(?=($| -) .)))) :: XX working spec #72
|
||||
=+ typ={$| (unit knot) hiss:eyre *}
|
||||
=+ [~ usr hiz ~]=((dy-cast typ !>(*typ)) vax)
|
||||
=. ..dy (he-diff %tan leaf+"< {(en-purl:html p.hiz)}" ~)
|
||||
@ -1333,14 +1333,14 @@
|
||||
(slop hed $(p.bil t.p.bil))
|
||||
==
|
||||
::
|
||||
++ dy-twig-mark :: XX architect
|
||||
++ dy-hoon-mark :: XX architect
|
||||
=+ ^= ope
|
||||
|= gen/twig ^- twig
|
||||
|= gen/hoon ^- hoon
|
||||
?: ?=(?($sggl $sggr) -.gen)
|
||||
$(gen q.gen)
|
||||
=+ ~(open ap gen)
|
||||
?.(=(gen -) $(gen -) gen)
|
||||
|= gen/twig ^- (unit mark)
|
||||
|= gen/hoon ^- (unit mark)
|
||||
=. gen (ope gen)
|
||||
?: ?=({$cnts {@ $~} $~} gen)
|
||||
(bind (~(get by var) i.p.gen) head)
|
||||
@ -1361,12 +1361,12 @@
|
||||
==
|
||||
::
|
||||
++ dy-mare :: build expression
|
||||
|= gen/twig
|
||||
|= gen/hoon
|
||||
^- silk:ford
|
||||
=+ too=(dy-twig-mark gen)
|
||||
=+ too=(dy-hoon-mark gen)
|
||||
=- ?~(too - [%cast u.too -])
|
||||
:+ %ride gen
|
||||
:- [%$ dy-twig-head]
|
||||
:- [%$ dy-hoon-head]
|
||||
[%plan he-beam blob+** [zuse sur lib ~ ~]]
|
||||
::
|
||||
++ dy-step :: advance project
|
||||
@ -1574,11 +1574,11 @@
|
||||
==
|
||||
==
|
||||
::
|
||||
++ he-span :: apply input
|
||||
++ he-type :: apply input
|
||||
|= act/sole-action
|
||||
^+ +>
|
||||
?^ poy
|
||||
he-pine:(~(dy-span dy u.poy) act)
|
||||
he-pine:(~(dy-type dy u.poy) act)
|
||||
?- -.act
|
||||
$det (he-stir +.act)
|
||||
$ret (he-done (tufa buf.say))
|
||||
@ -1704,7 +1704,7 @@
|
||||
|= {moz/(list move) ses/session}
|
||||
=> ~(. he moz ses)
|
||||
=- [wrap=- +]
|
||||
|* he-arm/_he-span
|
||||
|* he-arm/_he-type
|
||||
|= _+<.he-arm
|
||||
^- (quip move _..he)
|
||||
he-abet:(he-arm +<)
|
||||
@ -1721,7 +1721,7 @@
|
||||
::
|
||||
++ poke-sole-action
|
||||
|= act/sole-action ~| poke+act %. act
|
||||
(wrap he-span):arm
|
||||
(wrap he-type):arm
|
||||
::
|
||||
++ poke-lens-command
|
||||
|= com/command:lens ~| poke-lens+com %. com
|
||||
|
@ -82,7 +82,7 @@
|
||||
{$name audience human} ::< set our name
|
||||
:: messaging ::
|
||||
{$say (list speech)} ::< send message
|
||||
{$eval cord twig} ::< send #-message
|
||||
{$eval cord hoon} ::< send #-message
|
||||
{$target p/audience q/(unit work)} ::< set active targets
|
||||
{$reply $@(@ud {@u @ud}) (list speech)} ::< reply to
|
||||
:: displaying info ::
|
||||
@ -559,7 +559,7 @@
|
||||
::> || %parsers
|
||||
::> various parsers for command line input.
|
||||
|%
|
||||
++ expr ::< [cord twig]
|
||||
++ expr ::< [cord hoon]
|
||||
|= tub/nail %. tub
|
||||
%+ stag (crip q.tub)
|
||||
wide:(vang & [&1:% &2:% (scot %da now.bol) |3:%])
|
||||
@ -1013,7 +1013,7 @@
|
||||
?. =(q nym) ~
|
||||
[~ u=p]
|
||||
::
|
||||
++ twig-head ::< eval data
|
||||
++ hoon-head ::< eval data
|
||||
::> makes a vase of environment data to evaluate
|
||||
::> against (for #-messages).
|
||||
::
|
||||
@ -1129,8 +1129,8 @@
|
||||
::> executes {exe} and sends both its code and
|
||||
::> result.
|
||||
::
|
||||
|= {txt/cord exe/twig}
|
||||
=> |.([(sell (slap (slop twig-head seed) exe))]~)
|
||||
|= {txt/cord exe/hoon}
|
||||
=> |.([(sell (slap (slop hoon-head seed) exe))]~)
|
||||
=+ tan=p:(mule .)
|
||||
(say [%exp txt tan] ~)
|
||||
::
|
||||
|
@ -1,3 +1,4 @@
|
||||
::BROKEN fixme when md is properly merged
|
||||
::
|
||||
:::: hoon/cram/gen
|
||||
::
|
||||
|
@ -4,6 +4,8 @@
|
||||
::
|
||||
/? 310
|
||||
/- sole
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
=, sole
|
||||
:- %get |= {^ {a/hiss $~} usr/iden}
|
||||
^- (sole-request (cask httr))
|
||||
|
@ -4,6 +4,8 @@
|
||||
::
|
||||
/? 310
|
||||
/- sole
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
=, sole
|
||||
:- %get |= {^ {a/tape $~} $~}
|
||||
^- (sole-request (cask httr))
|
||||
|
@ -2,7 +2,9 @@
|
||||
::
|
||||
:::: /hoon/url/curl/gen
|
||||
::
|
||||
/? 310
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
:::::
|
||||
::
|
||||
|
@ -78,9 +78,8 @@
|
||||
:- %say
|
||||
|= *
|
||||
=< [%noun (say-hello %world)]
|
||||
=> :> #
|
||||
:> # %arch
|
||||
:> #
|
||||
=> :> # %arch
|
||||
:>
|
||||
:> structures for our imaginary hello, world generator.
|
||||
:>
|
||||
:> nothing forces us to put structures in a separate core.
|
||||
@ -95,6 +94,7 @@
|
||||
:> in a separate chapter (separated by {+|}).
|
||||
|%
|
||||
:> # %model
|
||||
:>
|
||||
:> models (molds) are functions that normalize nouns.
|
||||
:>
|
||||
:> arms producing molds are introduced with {+=}. for molds,
|
||||
@ -103,16 +103,16 @@
|
||||
+|
|
||||
+= spot [p=@ q=@] :< a coordinate
|
||||
+= tops :> also a coordinate
|
||||
{p/@ q/@}
|
||||
[p=@ q=@]
|
||||
+= goof :> a simple tuple
|
||||
$: foo/@ :< something mysterious
|
||||
bar/@ :< go here for drink
|
||||
moo/(binary-tree juice) :< cows do this
|
||||
$: foo=@ :< something mysterious
|
||||
bar=@ :< go here for drink
|
||||
moo=(binary-tree juice) :< cows do this
|
||||
==
|
||||
+= juice :> fruity beverage
|
||||
$% {$plum p/@} :< fresh prune
|
||||
{$pear p/@ q/@} :< good for cider
|
||||
{$acai p/@} :< aztec superfood
|
||||
$% [%plum p=@] :< fresh prune
|
||||
[%pear p=@ q=@] :< good for cider
|
||||
[%acai p=@] :< aztec superfood
|
||||
==
|
||||
:> #
|
||||
:> # %pattern
|
||||
@ -124,8 +124,8 @@
|
||||
:> or "higher-kinded types".
|
||||
+|
|
||||
++ binary-tree :< tree pattern
|
||||
|* a/$-(* *)
|
||||
$@($~ {n/a l/(binary-tree a) r/(binary-tree a)})
|
||||
|* a=$-(* *)
|
||||
$@($~ [n=a l=(binary-tree a) r=(binary-tree a)])
|
||||
:> #
|
||||
:> # %constant
|
||||
:> #
|
||||
@ -134,8 +134,9 @@
|
||||
++ answer :< answer to everything
|
||||
42
|
||||
--
|
||||
:> #
|
||||
:> # %work
|
||||
:>
|
||||
:> #
|
||||
:> engines for our imaginary hello, world app.
|
||||
:>
|
||||
:> note that ++say-goodbye is the correct notation, even though
|
||||
@ -147,7 +148,7 @@
|
||||
:>
|
||||
|= :> txt: friend to say hi to
|
||||
:>
|
||||
txt/term
|
||||
txt=term
|
||||
^- tape
|
||||
"hello, {(rip 3 txt)}"
|
||||
:> ++say-goodbye: say a really proper goodbye
|
||||
@ -164,8 +165,8 @@
|
||||
:>
|
||||
|= :> txt: departing friend
|
||||
:> num: number of friends
|
||||
$: txt/term
|
||||
num/@
|
||||
$: txt=term
|
||||
num=@
|
||||
==
|
||||
^- tape
|
||||
:> foo: four
|
||||
@ -176,6 +177,6 @@
|
||||
"goodbye and {(scot %ud moo)}, {(rip 3 txt)}"
|
||||
:> :> ++say-minimum
|
||||
++ say-minimum :> minimal decoration
|
||||
|= txt/term
|
||||
|= txt=term
|
||||
"nothing to say to {(rip 3 txt)}"
|
||||
--
|
||||
|
@ -1,3 +1,4 @@
|
||||
::BROKEN
|
||||
=> |%
|
||||
--
|
||||
|* $: :> vinyl: historical state (including version)
|
||||
|
@ -3,6 +3,8 @@
|
||||
:::: /hoon/ask/hood/gen
|
||||
::
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
:- %say
|
||||
|= {^ {mel/cord $~} $~}
|
||||
=+ adr=(star ;~(less (mask "\"\\()[],:;<>@") prn))
|
||||
|
@ -4,6 +4,8 @@
|
||||
::
|
||||
/? 310
|
||||
/- sole
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
::
|
||||
|
@ -3,6 +3,8 @@
|
||||
:::: /hoon/bonus/hood/gen
|
||||
::
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
::
|
||||
@ -13,4 +15,4 @@
|
||||
?~ opt $(opt [planets=1]~)
|
||||
?~ +.opt $(+.opt [stars=0]~)
|
||||
:- %womb-bonus
|
||||
[(scot %uv pas) planets stars]
|
||||
[(scot %uv pas) planets.opt stars.opt]
|
||||
|
@ -4,6 +4,8 @@
|
||||
::
|
||||
/? 314
|
||||
/- sole
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
::
|
||||
@ -31,4 +33,4 @@
|
||||
%+ sole-go (boss 256 (star prn))
|
||||
|= sec/@t
|
||||
%+ sole-so %write-sec-atom :: XX typed pair
|
||||
[hot (of-wain key sec ~)]
|
||||
[hot (of-wain:format key sec ~)]
|
||||
|
@ -4,6 +4,8 @@
|
||||
::
|
||||
/? 314
|
||||
/- sole
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
::
|
||||
|
@ -3,7 +3,8 @@
|
||||
:::: /hoon/load/hood/gen
|
||||
::
|
||||
/? 310
|
||||
/+ womb
|
||||
/+ womb, old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
::
|
||||
|
@ -3,6 +3,8 @@
|
||||
:::: /hoon/mv/hood/gen
|
||||
::
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
:- %say
|
||||
|= {^ {input/path output/path $~} $~}
|
||||
:- %kiln-info
|
||||
|
@ -2,6 +2,8 @@
|
||||
:::: /hoon/report/hood/gen
|
||||
::
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
::
|
||||
|
@ -3,6 +3,8 @@
|
||||
:::: /hoon/save/hood/gen
|
||||
::
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
::
|
||||
|
@ -3,6 +3,8 @@
|
||||
:::: /hoon/serve/hood/gen
|
||||
::
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
::
|
||||
|
@ -2,6 +2,8 @@
|
||||
:::: /hoon/metal/gen
|
||||
::
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
!:
|
||||
@ -277,7 +279,7 @@
|
||||
=/ dat .^(@t %cx pax)
|
||||
[(met 3 dat) dat]
|
||||
==
|
||||
=/ all (~(tap by dir.lon) ~)
|
||||
=/ all ~(tap by dir.lon)
|
||||
|- ^- mode:clay
|
||||
?~ all hav
|
||||
$(all t.all, hav ^$(tyl [p.i.all tyl]))
|
||||
|
@ -4,6 +4,8 @@
|
||||
::
|
||||
/? 310
|
||||
/- sole
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
[. sole]
|
||||
::
|
||||
::::
|
||||
|
@ -1,3 +1,4 @@
|
||||
::BROKEN
|
||||
:: Compile arvo as a pill noun, for compiler changes;
|
||||
:: usage
|
||||
::
|
||||
@ -6,6 +7,8 @@
|
||||
:::: /hoon/mud/gen
|
||||
::
|
||||
/? 310
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
::::
|
||||
!:
|
||||
|
366
gen/musk.hoon
Normal file
366
gen/musk.hoon
Normal file
@ -0,0 +1,366 @@
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= {^ {{typ/type gen/hoon $~} $~}}
|
||||
=< :- %noun
|
||||
=+ pro=(~(mint ut typ) %noun gen)
|
||||
~_ (~(dunk ut typ) 'blow-subject')
|
||||
=+ bus=(bran:musk typ)
|
||||
~& [%subject-mask mask.bus]
|
||||
=+ jon=(apex:musk bus q.pro)
|
||||
?~ jon
|
||||
~& %constant-stopped
|
||||
!!
|
||||
?. ?=($& -.u.jon)
|
||||
~& %constant-blocked
|
||||
!!
|
||||
:: [p.pro [%1 p.u.jon]]
|
||||
p.u.jon
|
||||
|%
|
||||
++ musk :: nock with block set
|
||||
=> |%
|
||||
++ block
|
||||
:: identity of resource awaited
|
||||
:: XX parameterize
|
||||
noun
|
||||
::
|
||||
++ result
|
||||
:: internal interpreter result
|
||||
::
|
||||
$@(~ seminoun)
|
||||
::
|
||||
++ seminoun
|
||||
:: partial noun; blocked subtrees are ~
|
||||
::
|
||||
{mask/stencil data/noun}
|
||||
::
|
||||
++ stencil
|
||||
:: noun knowledge map
|
||||
::
|
||||
$% :: no; noun has partial block substructure
|
||||
::
|
||||
{$| left/stencil rite/stencil}
|
||||
:: yes; noun is either fully complete, or fully blocked
|
||||
::
|
||||
{$& blocks/(set block)}
|
||||
==
|
||||
::
|
||||
++ output
|
||||
:: nil; interpreter stopped
|
||||
::
|
||||
%- unit
|
||||
:: yes, complete noun; no, list of blocks
|
||||
::
|
||||
(each noun (list block))
|
||||
--
|
||||
|%
|
||||
++ bran
|
||||
|= sut/type
|
||||
=+ gil=*(set type)
|
||||
|- ^- seminoun
|
||||
?- sut
|
||||
$noun [&+[~ ~ ~] ~]
|
||||
$void [&+[~ ~ ~] ~]
|
||||
{$atom *} ?~(q.sut [&+[~ ~ ~] ~] [&+~ u.q.sut])
|
||||
{$cell *} (combine $(sut p.sut) $(sut q.sut))
|
||||
{$core *} %+ combine:musk
|
||||
?~ p.s.q.sut [&+[~ ~ ~] ~]
|
||||
[&+~ p.s.q.sut]
|
||||
$(sut p.sut)
|
||||
{$face *} $(sut ~(repo ut sut))
|
||||
{$fork *} [&+[~ ~ ~] ~]
|
||||
{$help *} $(sut ~(repo ut sut))
|
||||
{$hold *} ?: (~(has in gil) sut)
|
||||
[&+[~ ~ ~] ~]
|
||||
$(sut ~(repo ut sut), gil (~(put in gil) sut))
|
||||
==
|
||||
++ abet
|
||||
:: simplify raw result
|
||||
::
|
||||
|= $: :: noy: raw result
|
||||
::
|
||||
noy/result
|
||||
==
|
||||
^- output
|
||||
:: propagate stop
|
||||
::
|
||||
?~ noy ~
|
||||
:- ~
|
||||
:: merge all blocking sets
|
||||
::
|
||||
=/ blocks (squash mask.noy)
|
||||
?: =(~ blocks)
|
||||
:: no blocks, data is complete
|
||||
::
|
||||
&+data.noy
|
||||
:: reduce block set to block list
|
||||
::
|
||||
|+~(tap in blocks)
|
||||
::
|
||||
++ apex
|
||||
:: execute nock on partial subject
|
||||
::
|
||||
|= $: :: bus: subject, a partial noun
|
||||
:: fol: formula, a complete noun
|
||||
::
|
||||
bus/seminoun
|
||||
fol/noun
|
||||
==
|
||||
^- output
|
||||
:: simplify result
|
||||
::
|
||||
%- abet
|
||||
:: interpreter loop
|
||||
::
|
||||
|- ^- result
|
||||
:: ~& [%apex-fol fol]
|
||||
:: ~& [%apex-mac mask.bus]
|
||||
:: =- ~& [%apex-pro-mac ?@(foo ~ ~!(foo mask.foo))]
|
||||
:: foo
|
||||
:: ^= foo
|
||||
:: ^- result
|
||||
?@ fol
|
||||
:: bad formula, stop
|
||||
::
|
||||
~
|
||||
?: ?=(^ -.fol)
|
||||
:: hed: interpret head
|
||||
::
|
||||
=+ hed=$(fol -.fol)
|
||||
:: propagate stop
|
||||
::
|
||||
?~ hed ~
|
||||
:: tal: interpret tail
|
||||
::
|
||||
=+ tal=$(fol +.fol)
|
||||
:: propagate stop
|
||||
::
|
||||
?~ tal ~
|
||||
:: combine
|
||||
::
|
||||
(combine hed tal)
|
||||
?+ fol
|
||||
:: bad formula; stop
|
||||
::
|
||||
~
|
||||
:: 0; fragment
|
||||
::
|
||||
{$0 b/@}
|
||||
:: if bad axis, stop
|
||||
::
|
||||
?: =(0 b.fol) ~
|
||||
:: reduce to fragment
|
||||
::
|
||||
(fragment b.fol bus)
|
||||
::
|
||||
:: 1; constant
|
||||
::
|
||||
{$1 b/*}
|
||||
:: constant is complete
|
||||
::
|
||||
[&+~ b.fol]
|
||||
::
|
||||
:: 2; recursion
|
||||
::
|
||||
{$2 b/* c/*}
|
||||
:: require complete formula
|
||||
::
|
||||
%+ require
|
||||
:: compute formula with current subject
|
||||
::
|
||||
$(fol c.fol)
|
||||
|= :: ryf: next formula
|
||||
::
|
||||
ryf/noun
|
||||
:: lub: next subject
|
||||
::
|
||||
=+ lub=^$(fol b.fol)
|
||||
:: propagate stop
|
||||
::
|
||||
?~ lub ~
|
||||
:: recurse
|
||||
::
|
||||
^$(fol ryf, bus lub)
|
||||
::
|
||||
:: 3; probe
|
||||
::
|
||||
{$3 b/*}
|
||||
%+ require
|
||||
$(fol b.fol)
|
||||
|= :: fig: probe input
|
||||
::
|
||||
fig/noun
|
||||
:: yes if cell, no if atom
|
||||
::
|
||||
[&+~ .?(fig)]
|
||||
::
|
||||
:: 4; increment
|
||||
::
|
||||
{$4 b/*}
|
||||
%+ require
|
||||
$(fol b.fol)
|
||||
|= :: fig: increment input
|
||||
::
|
||||
fig/noun
|
||||
:: stop for cells, increment for atoms
|
||||
::
|
||||
?^(fig ~ [&+~ +(fig)])
|
||||
::
|
||||
:: 5; compare
|
||||
::
|
||||
{$5 b/*}
|
||||
%+ require
|
||||
$(fol b.fol)
|
||||
|= :: fig: operator input
|
||||
::
|
||||
fig/noun
|
||||
:: stop for atoms, compare cells
|
||||
::
|
||||
?@(fig ~ [&+~ =(-.fig +.fig)])
|
||||
::
|
||||
:: 6; if-then-else
|
||||
::
|
||||
{$6 b/* c/* d/*}
|
||||
:: use standard macro expansion (slow)
|
||||
::
|
||||
$(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
|
||||
::
|
||||
:: 7; composition
|
||||
::
|
||||
{$7 b/* c/*}
|
||||
:: use standard macro expansion (slow)
|
||||
::
|
||||
$(fol =>(fol [2 b 1 c]))
|
||||
::
|
||||
:: 8; declaration
|
||||
::
|
||||
{$8 b/* c/*}
|
||||
:: use standard macro expansion (slow)
|
||||
::
|
||||
$(fol =>(fol [7 [[7 [0 1] b] 0 1] c]))
|
||||
::
|
||||
:: 9; invocation
|
||||
::
|
||||
{$9 b/* c/*}
|
||||
:: use standard macro expansion (slow)
|
||||
::
|
||||
$(fol =>(fol [7 c 2 [0 1] 0 b]))
|
||||
::
|
||||
:: 10; static hint
|
||||
::
|
||||
{$10 @ c/*}
|
||||
:: ignore hint
|
||||
::
|
||||
$(fol c.fol)
|
||||
::
|
||||
:: 10; dynamic hint
|
||||
::
|
||||
{$10 {b/* c/*} d/*}
|
||||
:: noy: dynamic hint
|
||||
::
|
||||
=+ noy=$(fol c.fol)
|
||||
:: propagate stop
|
||||
::
|
||||
?~ noy ~
|
||||
:: otherwise, ignore hint
|
||||
::
|
||||
$(fol d.fol)
|
||||
==
|
||||
::
|
||||
++ combine
|
||||
:: combine a pair of seminouns
|
||||
::
|
||||
|= $: :: hed: head of pair
|
||||
:: tal: tail of pair
|
||||
::
|
||||
hed/seminoun
|
||||
tal/seminoun
|
||||
==
|
||||
^- seminoun
|
||||
?. ?& &(?=($& -.mask.hed) ?=($& -.mask.tal))
|
||||
=(=(~ blocks.mask.hed) =(~ blocks.mask.tal))
|
||||
==
|
||||
:: default merge
|
||||
::
|
||||
[|+[mask.hed mask.tal] [data.hed data.tal]]
|
||||
:: both sides total
|
||||
::
|
||||
?: =(~ blocks.mask.hed)
|
||||
:: both sides are complete
|
||||
::
|
||||
[&+~ data.hed data.tal]
|
||||
:: both sides are blocked
|
||||
::
|
||||
[&+(~(uni in blocks.mask.hed) blocks.mask.tal) ~]
|
||||
::
|
||||
++ fragment
|
||||
:: seek to an axis in a seminoun
|
||||
::
|
||||
|= $: :: axe: tree address of subtree
|
||||
:: bus: partial noun
|
||||
::
|
||||
axe/axis
|
||||
bus/seminoun
|
||||
==
|
||||
|- ^- result
|
||||
:: 1 is the root
|
||||
::
|
||||
?: =(1 axe) bus
|
||||
:: now: 2 or 3, top of axis
|
||||
:: lat: rest of axis
|
||||
::
|
||||
=+ [now=(cap axe) lat=(mas axe)]
|
||||
?- -.mask.bus
|
||||
:: subject is fully blocked or complete
|
||||
::
|
||||
$& :: if fully blocked, produce self
|
||||
::
|
||||
?^ blocks.mask.bus bus
|
||||
:: descending into atom, stop
|
||||
::
|
||||
?@ data.bus ~
|
||||
:: descend into complete cell
|
||||
::
|
||||
$(axe lat, bus [&+~ ?:(=(2 now) -.data.bus +.data.bus)])
|
||||
:: subject is partly blocked
|
||||
::
|
||||
$| :: descend into partial cell
|
||||
::
|
||||
%= $
|
||||
axe lat
|
||||
bus ?: =(2 now)
|
||||
[left.mask.bus -.data.bus]
|
||||
[rite.mask.bus +.data.bus]
|
||||
== ==
|
||||
:: require complete intermediate step
|
||||
::
|
||||
++ require
|
||||
|= $: noy/result
|
||||
yen/$-(noun result)
|
||||
==
|
||||
^- result
|
||||
:: propagate stop
|
||||
::
|
||||
?~ noy ~
|
||||
:: if partial block, squash blocks and stop
|
||||
::
|
||||
?: ?=($| -.mask.noy) [&+(squash mask.noy) ~]
|
||||
:: if full block, propagate block
|
||||
::
|
||||
?: ?=(^ blocks.mask.noy) [mask.noy ~]
|
||||
:: otherwise use complete noun
|
||||
::
|
||||
(yen data.noy)
|
||||
::
|
||||
++ squash
|
||||
:: convert stencil to block set
|
||||
::
|
||||
|= tyn/stencil
|
||||
^- (set block)
|
||||
?- -.tyn
|
||||
$& blocks.tyn
|
||||
$| (~(uni in $(tyn left.tyn)) $(tyn rite.tyn))
|
||||
==
|
||||
--
|
||||
--
|
@ -5,6 +5,8 @@
|
||||
/? 310
|
||||
:: Input twitter keys
|
||||
/- sole
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
=+ cryp=crub
|
||||
=+ [sole]
|
||||
|
@ -20,14 +20,17 @@
|
||||
~& %solid-start
|
||||
=+ txt=.^(@t %cx (weld pax `path`[%hoon ~]))
|
||||
=+ rax=.^(@t %cx (weld arp `path`[%hoon ~]))
|
||||
~& %solid-loaded
|
||||
=+ gen=(rain pax txt)
|
||||
~& %solid-parsed
|
||||
=+ one=(~(mint ut %noun) %noun gen)
|
||||
~& %solid-compiled
|
||||
=+ two=(~(mint ut p.one) %noun (rain arp rax))
|
||||
~& %solid-arvo
|
||||
=+ ken=[7 q.one q.two]
|
||||
=+ ^= ken
|
||||
=- ?:(?=($& -.res) p.res ((slog p.res) ~))
|
||||
^= res %- mule |.
|
||||
~& %solid-loaded
|
||||
=+ gen=(rain pax txt)
|
||||
~& %solid-parsed
|
||||
=+ one=(~(mint ut %noun) %noun gen)
|
||||
~& %solid-compiled
|
||||
=+ two=(~(mint ut p.one) %noun (rain arp rax))
|
||||
~& %solid-arvo
|
||||
[7 q.one q.two]
|
||||
~& [%solid-kernel `@ux`(mug ken)]
|
||||
:- ken
|
||||
=+ all=.*(0 ken)
|
||||
|
@ -2,7 +2,10 @@
|
||||
::
|
||||
:::: /hoon/feed/twit/gen
|
||||
::
|
||||
/? 310
|
||||
/- twitter
|
||||
/+ old-zuse
|
||||
=, old-zuse
|
||||
::
|
||||
:::: ~fyr
|
||||
::
|
||||
|
@ -1,3 +1,4 @@
|
||||
::BROKEN
|
||||
!:
|
||||
::::
|
||||
::
|
||||
|
61
lib/cram.hoon
Normal file
61
lib/cram.hoon
Normal file
@ -0,0 +1,61 @@
|
||||
|%
|
||||
++ static :: freeze .mdh hoon subset
|
||||
|= gen/hoon ^- {inf/(map term dime) elm/manx}
|
||||
?+ -.gen
|
||||
=/ gen ~(open ap gen)
|
||||
?: =(gen ^gen) ~|([%cram-dynamic -.gen] !!)
|
||||
$(gen gen)
|
||||
::
|
||||
$xray [~ (single (shut gen))]
|
||||
^ [(malt (frontmatter p.gen)) (single (shut q.gen))]
|
||||
==
|
||||
::
|
||||
++ single :: unwrap one-elem marl
|
||||
|= xml/marl ^- manx
|
||||
?: ?=({* $~} xml) i.xml
|
||||
~|(%many-elems !!)
|
||||
::
|
||||
++ shut-mart :: xml attrs
|
||||
|=({n/mane v/(list beer:hoon)} [n (turn v |=(a/beer:hoon ?^(a !! a)))])
|
||||
::
|
||||
++ shut :: as xml constant
|
||||
|= gen/hoon ^- marl
|
||||
?+ -.gen ~|([%bad-xml -.gen] !!)
|
||||
$dbug $(gen q.gen)
|
||||
::
|
||||
$xray
|
||||
[[n.g.p.gen (turn a.g.p.gen shut-mart)] $(gen [%smts c.p.gen])]~
|
||||
::
|
||||
$smts
|
||||
?~ p.gen ~
|
||||
=- (weld - $(p.gen t.p.gen))
|
||||
?^ -.i.p.gen $(gen [%xray i.p.gen])
|
||||
~| [%shut-tuna -.i.p.gen]
|
||||
?+ -.i.p.gen !!
|
||||
$manx ?>(?=($xray -.p.i.p.gen) $(gen p.i.p.gen))
|
||||
$marl ?>(?=($smts -.p.i.p.gen) $(gen p.i.p.gen))
|
||||
==
|
||||
==
|
||||
::
|
||||
::
|
||||
++ frontmatter :: parse ~[[%foo 1] [%bar ~s2]]
|
||||
|= gen/hoon ^- (list {term dime})
|
||||
?: ?=({$bust $null} gen) ~
|
||||
?: ?=($dbug -.gen) $(gen q.gen)
|
||||
?. ?=($clsg -.gen) ~|([%bad-frontmatter -.gen] !!)
|
||||
%+ turn p.gen
|
||||
|= gen/hoon
|
||||
?. ?=(^ -.gen)
|
||||
=/ gen ~(open ap gen)
|
||||
?: =(gen ^gen) ~|([%bad-frontmatter-elem -.gen] !!)
|
||||
$(gen gen)
|
||||
=/ hed (as-dime p.gen)
|
||||
?. =(%tas p.hed) ~|([%bad-frontmatter-key-type p.hed] !!)
|
||||
[q.hed (as-dime q.gen)]
|
||||
::
|
||||
++ as-dime :: %foo ~.foo 0vbar etc
|
||||
|= gen/hoon ^- dime
|
||||
?: ?=($dbug -.gen) $(gen q.gen)
|
||||
?. ?=({?($rock $sand) @ @} gen) ~|([%bad-literal gen] !!)
|
||||
+.gen
|
||||
--
|
@ -1 +0,0 @@
|
||||
fd
|
@ -20,8 +20,8 @@
|
||||
++ yu yu:chrono:userlib :: UTC format constants
|
||||
++ moon en-mite:mimes:html :: mime type to text
|
||||
++ perk perk.is :: parse cube fork
|
||||
++ poja en-json:html :: parse JSON
|
||||
++ pojo de-json:html :: print json
|
||||
++ poja de-json:html :: parse JSON
|
||||
++ pojo en-json:html :: print json
|
||||
++ poxo en-xml:html :: node to tape
|
||||
++ poxa de-xml:html :: xml parser
|
||||
++ jo dejs-soft:format :: json reparser
|
||||
|
1823
lib/vast2.hoon
1823
lib/vast2.hoon
File diff suppressed because it is too large
Load Diff
20
mar/umd.hoon
20
mar/umd.hoon
@ -2,23 +2,31 @@
|
||||
:::: /hoon/umd/mar
|
||||
::
|
||||
/? 310
|
||||
/+ cram
|
||||
::
|
||||
|_ mud/@t
|
||||
++ grow
|
||||
|%
|
||||
++ mime [/text/x-unmark (taco mud)]
|
||||
++ mime [/text/x-unmark (as-octs:mimes:html mud)]
|
||||
++ txt
|
||||
(lore mud)
|
||||
(to-wain:format mud)
|
||||
++ elem
|
||||
^- manx
|
||||
[/div ~(shut ap %xml (rash mud fenced:cram:vast))]
|
||||
elm:(static:cram (ream mud))
|
||||
++ front :: XX performance, types
|
||||
^- (map term knot)
|
||||
%- ~(run by inf:(static:cram (ream mud)))
|
||||
|= a=dime ^- cord
|
||||
?+ (end 3 1 p.a) (scot a)
|
||||
%t q.a
|
||||
==
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ mime |=({p/mite q/octs} q.q)
|
||||
++ mime |=({p/mite:eyre q/octs:eyre} q.q)
|
||||
++ noun @t
|
||||
++ txt role
|
||||
--
|
||||
++ txt of-wain:format
|
||||
--
|
||||
++ grad %txt
|
||||
++ garb /down
|
||||
--
|
||||
|
@ -2,11 +2,17 @@
|
||||
:::: /hoon/comments/tree/ren
|
||||
::
|
||||
/? 310
|
||||
/: /%/comments /_ @da
|
||||
/: /%/comments
|
||||
/; |= a/(map knot {ship marl})
|
||||
=- (sort - dor)
|
||||
%+ turn ~(tap by a)
|
||||
|=({b/knot c/{ship marl}} [(slav %da b) c])
|
||||
/_
|
||||
/; |= a/manx ^- {ship marl}
|
||||
~| a
|
||||
?> ?=(_[/div ;/(~) ~[[%h2 **] ~[[%code **] ;/(who=**)]] kid=**] a)
|
||||
=> .(a ^+([/div ;/(~) ~[[%h2 **] ~[[%code **] ;/(who=*tape)]] kid=*marl] a))
|
||||
%. a
|
||||
|: a=[/div ;/(~) ~[[%h2 **] ~[[%code **] ;/(who=*tape)]] kid=*marl]
|
||||
[(slav %p (crip who.a)) kid.a]
|
||||
/&elem&/md/
|
||||
::
|
||||
|
@ -31,7 +31,7 @@
|
||||
^- marl
|
||||
;= ;title: Urbit - A personal server
|
||||
;meta(name "viewport", content "width=device-width, initial-scale=1");
|
||||
:: ;link(type "text/css", rel "stylesheet", href "//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.min.css");
|
||||
;link(type "text/css", rel "stylesheet", href "//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.min.css");
|
||||
;* ?. nopack.dbg
|
||||
:_ ~
|
||||
;link(type "text/css", rel "stylesheet", href "/===/web/pack/css/codemirror-fonts-bootstrap-tree.css");
|
||||
@ -49,9 +49,9 @@
|
||||
;script(type "text/javascript", src "{(cdnjs "react/0.14.6/react-dom")}");
|
||||
;script(type "text/javascript", src "{(cdnjs "flux/2.1.1/Flux")}");
|
||||
;* (turn ~(tap by extras) |=({@ a/@t} ;script(type "text/javascript"):"{(trip a)}"))
|
||||
:: ;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js");
|
||||
:: ;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/".
|
||||
:: "codemirror/4.3.0/mode/markdown/markdown.min.js");
|
||||
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js");
|
||||
:: ;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/".
|
||||
:: "codemirror/4.3.0/mode/markdown/markdown.min.js");
|
||||
;* ?. nopack.dbg
|
||||
:_ ~
|
||||
;script(type "text/javascript", src "{?.(aut "" "/~~/~/at")}".
|
||||
|
2176
sys/hoon.hoon
2176
sys/hoon.hoon
File diff suppressed because it is too large
Load Diff
@ -26,9 +26,9 @@
|
||||
$: p/(unit (set monk)) :: can be read by
|
||||
q/(set monk) :: caused or created by
|
||||
== ::
|
||||
++ curd {p/@tas q/*} :: spanless card
|
||||
++ curd {p/@tas q/*} :: typeless card
|
||||
++ duct (list wire) :: causal history
|
||||
++ hypo |*(a/mold (pair span a)) :: span associated
|
||||
++ hypo |*(a/mold (pair type a)) :: type associated
|
||||
++ hobo |* a/mold :: kiss wrapper
|
||||
$? $% {$soft p/*} ::
|
||||
== ::
|
||||
@ -48,7 +48,7 @@
|
||||
$@ mark :: plain mark
|
||||
$% {$tabl p/(list (pair marc marc))} :: map
|
||||
== ::
|
||||
++ mark @tas :: content span
|
||||
++ mark @tas :: content type
|
||||
++ mash |=(* (mass +<)) :: producing mass
|
||||
++ mass (pair cord (each noun (list mash))) :: memory usage
|
||||
++ mill (each vase milt) :: vase+metavase
|
||||
@ -56,7 +56,7 @@
|
||||
++ monk (each ship {p/@tas q/@ta}) :: general identity
|
||||
++ muse {p/@tas q/duct r/arvo} :: sourced move
|
||||
++ move {p/duct q/arvo} :: arvo move
|
||||
++ ovum {p/wire q/curd} :: spanless ovum
|
||||
++ ovum {p/wire q/curd} :: typeless ovum
|
||||
++ pane (list {p/@tas q/vase}) :: kernel modules
|
||||
++ pone (list {p/@tas q/vise}) :: kernel modules old
|
||||
++ ship @p :: network identity
|
||||
@ -67,10 +67,10 @@
|
||||
(unit (unit (cask))) ::
|
||||
++ slyt $-({* *} (unit (unit))) :: old namespace
|
||||
++ vile :: reflexive constants
|
||||
$: typ/span :: -:!>(*span)
|
||||
duc/span :: -:!>(*duct)
|
||||
pah/span :: -:!>(*path)
|
||||
mev/span :: -:!>([%meta *vase])
|
||||
$: typ/type :: -:!>(*type)
|
||||
duc/type :: -:!>(*duct)
|
||||
pah/type :: -:!>(*path)
|
||||
mev/type :: -:!>([%meta *vase])
|
||||
== ::
|
||||
++ wind :: new kernel action
|
||||
|* {a/mold b/mold} :: forward+reverse
|
||||
@ -192,9 +192,9 @@
|
||||
?. hip ~ :: a vase is a cell
|
||||
=^ vax p.sew (~(slot wa p.sew) 2 tiv) ::
|
||||
=^ hip p.sew (~(nest wa p.sew) typ.vil p.vax) ::
|
||||
?. hip ~ :: vase head is span
|
||||
?. hip ~ :: vase head is type
|
||||
%+ biff ::
|
||||
=+ mut=(milt q.tiv) :: card span, value
|
||||
=+ mut=(milt q.tiv) :: card type, value
|
||||
|- ^- (unit (pair milt worm)) ::
|
||||
?. ?=({$meta p/* q/milt} q.mut) `[mut p.sew] :: ordinary metacard
|
||||
=^ hip p.sew (~(nets wa p.sew) mev.vil p.mut)::
|
||||
@ -328,10 +328,10 @@
|
||||
(vent lal vil bud *worm (slym (slap bud (rain pax txt)) bud))
|
||||
::
|
||||
++ viol :: vane tools
|
||||
|= but/span
|
||||
|= but/type
|
||||
^- vile
|
||||
=+ pal=|=(a/@t ^-(span (~(play ut but) (vice a))))
|
||||
:* typ=(pal '*span')
|
||||
=+ pal=|=(a/@t ^-(type (~(play ut but) (vice a))))
|
||||
:* typ=(pal '*type')
|
||||
duc=(pal '*duct')
|
||||
pah=(pal '*path')
|
||||
mev=(pal '*{$meta $vase}')
|
||||
@ -549,11 +549,11 @@
|
||||
=^ zef niz
|
||||
(~(hurl (is vil eny bud niz) now) lac ovo)
|
||||
[zef +>.$]
|
||||
::
|
||||
++ vega :: reboot kernel
|
||||
|= {now/@da ova/(list ovum) hap/path zup/path}
|
||||
^- (unit {p/(list ovum) q/*})
|
||||
=- ?:(?=($| -.res) ((slog p.res) ~) `p.res)
|
||||
::
|
||||
++ veke :: build new kernel
|
||||
|= {now/@da hap/path zup/path}
|
||||
^- *
|
||||
=- ?:(?=($& -.res) p.res ((slog p.res) ~))
|
||||
^= res %- mule |.
|
||||
=+ pax=(weld hap `path`[%hoon ~])
|
||||
=+ wax=(weld zup `path`[%hoon ~])
|
||||
@ -567,7 +567,14 @@
|
||||
~& [%vega-arvo zup]
|
||||
=+ two=(~(mint ut p.one) %noun (rain zup arv))
|
||||
~& %vega-minted
|
||||
=+ ken=.*(0 [7 q.one q.two])
|
||||
.*(0 [7 q.one q.two])
|
||||
::
|
||||
++ vega :: reboot kernel
|
||||
|= {now/@da ova/(list ovum) hap/path zup/path}
|
||||
^- (unit {p/(list ovum) q/*})
|
||||
=- ?:(?=($| -.res) ((slog p.res) ~) `p.res)
|
||||
^= res %- mule |.
|
||||
=+ ken=(veke now hap zup)
|
||||
~& [%vega-kernel `@ux`(mug ken)]
|
||||
=+ ^= nex
|
||||
=+ gat=.*(ken .*(ken [0 87]))
|
||||
|
@ -1,4 +1,3 @@
|
||||
^%
|
||||
::
|
||||
:: dill (4d), terminal handling
|
||||
::
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,6 @@
|
||||
:: it's important to keep %zuse minimal. models and
|
||||
:: engines not used outside a vane should stay inside
|
||||
:: that vane.
|
||||
::
|
||||
~% %zuse +> ~
|
||||
=>
|
||||
:: :: ::
|
||||
@ -39,7 +38,7 @@
|
||||
++ roof (room vase) :: namespace
|
||||
++ room :: either namespace
|
||||
|* vase/mold :: vase or maze
|
||||
$- $: ref/* :: reference span
|
||||
$- $: ref/* :: reference type
|
||||
lyc/(unit (set ship)) :: leakset
|
||||
car/term :: perspective
|
||||
bem/beam :: path
|
||||
@ -59,7 +58,7 @@
|
||||
$_ =| mind
|
||||
^| |%
|
||||
++ load |~(seed ^|(+>))
|
||||
++ stay *mind :: preserve
|
||||
++ stay $:mind :: preserve
|
||||
++ plow :: work in time
|
||||
=| $: now/@da :: date
|
||||
eny/@e :: entropy
|
||||
@ -774,7 +773,7 @@
|
||||
== ::
|
||||
++ hoof (trel ? term (unit (pair case ship))) :: resource reference
|
||||
++ hoop :: source in hood
|
||||
$% {$& p/twig} :: direct twig
|
||||
$% {$& p/hoon} :: direct hoon
|
||||
{$| p/beam} :: resource location
|
||||
== ::
|
||||
++ hops :: XX late-bound path
|
||||
@ -782,23 +781,21 @@
|
||||
pof/(unit {p/@ud q/tyke}) ::
|
||||
== ::
|
||||
++ horn :: resource tree
|
||||
$% {$ape p/twig} :: /~ twig by hand
|
||||
{$arg p/twig} :: /$ argument
|
||||
{$alt p/(list horn)} :: /| options
|
||||
{$dep p/horn} :: /# insert dephash
|
||||
{$dub p/term q/horn} :: /= apply face
|
||||
{$fan p/(list horn)} :: /. list
|
||||
{$for p/(list (pair spur horn))} :: /, switch by path
|
||||
{$hel p/horn} :: /% propagate args
|
||||
{$lin p/(list mark) q/horn} :: /& translates
|
||||
{$man p/(map knot horn)} :: /* hetero map
|
||||
{$nap p/horn} :: /_ homo map
|
||||
{$now p/horn} :: deprecated
|
||||
{$nod p/term q/horn} :: /_ @ list by odor
|
||||
{$saw p/twig q/horn} :: /; operate on
|
||||
{$see p/hops q/horn} :: /: relative to
|
||||
{$sic p/twig q/horn} :: /^ cast
|
||||
{$toy p/? q/mark} :: /mark/ static/hook
|
||||
$% {$fssg p/hoon} :: /~ twig by hand
|
||||
{$fsbc p/hoon} :: /$ argument
|
||||
{$fsbr p/(list horn)} :: /| options
|
||||
{$fshx p/horn} :: /# insert dephash
|
||||
{$fsts p/term q/horn} :: /= apply face
|
||||
{$fsdt p/(list horn)} :: /. list
|
||||
{$fscm p/(list (pair spur horn))} :: /, switch by path
|
||||
{$fscn p/horn} :: /% propagate args
|
||||
{$fspm p/(list mark) q/horn} :: /& translates
|
||||
{$fscb p/horn} :: /_ homo map
|
||||
{$fssm p/hoon q/horn} :: /; operate on
|
||||
{$fscl p/hops q/horn} :: /: relative to
|
||||
{$fskt p/hoon q/horn} :: /^ cast
|
||||
{$fszp q/mark} :: /!mark/ eval value
|
||||
{$fszy q/mark} :: /mark/ static/grow
|
||||
== ::
|
||||
++ milk (trel ship desk silk) :: sourced silk
|
||||
++ silk :: construction layer
|
||||
@ -820,7 +817,7 @@
|
||||
{$pact p/silk q/silk} :: patch
|
||||
{$plan p/beam q/coin r/hood} :: structured assembly
|
||||
{$reef $~} :: kernel reef
|
||||
{$ride p/twig q/silk} :: silk thru twig
|
||||
{$ride p/hoon q/silk} :: silk thru hoon
|
||||
{$tabl p/(list (pair silk silk))} :: list
|
||||
{$vale p/mark q/*} :: validate
|
||||
{$volt p/(cask *)} :: unsafe add type
|
||||
|
@ -1,6 +1,5 @@
|
||||
---
|
||||
comments: true
|
||||
---
|
||||
:- ~[comments+&]
|
||||
;>
|
||||
|
||||
# Static
|
||||
|
||||
|
@ -2,12 +2,10 @@
|
||||
::
|
||||
:::: /hoon/all/unmark/web
|
||||
::
|
||||
/- down, markdown
|
||||
/+ vast2
|
||||
/+ cram
|
||||
::
|
||||
/= cor /^ (list {@ud wain})
|
||||
/: /%%/ /_ @ud /txt/
|
||||
/= mad /: /%%/cm-spec /down/
|
||||
::
|
||||
|%
|
||||
++ rolt |=(a/wall `tape`?~(a ~ ?~(t.a i.a :(weld i.a "\0a" $(a t.a)))))
|
||||
@ -16,14 +14,17 @@
|
||||
(rolt (zing (turn tan |=(a/tank (wash 0^wid a)))))
|
||||
::
|
||||
++ mads
|
||||
|= a/wain ^- marl
|
||||
=/ try (mule |.(~(shut ap (rash (nule ';>' a) apex:(sail &):vast2))))
|
||||
=, userlib
|
||||
|= a/wain ^- manx
|
||||
=/ try/(each manx tang)
|
||||
%- mule |.
|
||||
elm:(static:cram (rash (nule:unix ';>' a) apex:(sail &):vast))
|
||||
?- -.try
|
||||
$& p.try
|
||||
$| ;= ;div
|
||||
;h3: ERROR
|
||||
;pre: {(wush 120 p.try)}
|
||||
== == ==
|
||||
$| ;div
|
||||
;h3: ERROR
|
||||
;pre: {(wush 120 p.try)}
|
||||
== ==
|
||||
::
|
||||
++ split-on
|
||||
=| hed/wain
|
||||
@ -46,44 +47,11 @@
|
||||
^- manx
|
||||
;ul
|
||||
;li
|
||||
;h2: Core
|
||||
;ul
|
||||
;* ^- marl
|
||||
%+ turn cor
|
||||
|= {num/@u txt/wain}
|
||||
;li: ;{p -[<num>]} *{(mads txt)} ;{hr}
|
||||
;li: ;{p -[<num>]} +{(mads txt)} ;{hr}
|
||||
==
|
||||
==
|
||||
;li
|
||||
;h2: CommonMark
|
||||
;ol
|
||||
;* ?: [disabled=&] ; DISABLED
|
||||
^- marl
|
||||
%+ murn `down`mad
|
||||
|= a/elem:markdown
|
||||
?: ?=($head -.a)
|
||||
?. ?=({{$$ *} $~} q.a)
|
||||
~
|
||||
(some /(crip "h{<p.a>}") ;"{p.i.q.a}")
|
||||
?. ?=({$code ^ *} a) ~
|
||||
?. =("example" r.u.p.a) ~
|
||||
%- some
|
||||
^- manx
|
||||
|-
|
||||
=+ [inp out]=(split-on '.' q.a)
|
||||
=/ mar c:(snag 0 (mads inp))
|
||||
;li
|
||||
;pre: {(trip (role inp))}
|
||||
;p: =>
|
||||
;pre: {(trip (role out))}
|
||||
;p: vs
|
||||
;pre: {(many:poxo mar "")}
|
||||
;p
|
||||
;- =/ pox (rush (role out) many:poxa)
|
||||
?~ pox "INVALID"
|
||||
?: =(u.pox mar) "EQUIVALENT"
|
||||
?: =(u.pox (turn mar strip)) "COMPATIBLE"
|
||||
"DIVERGE"
|
||||
==
|
||||
== ==
|
||||
== ==
|
||||
==
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user