moved /% to ren, changed /% to act on virtual path only

This commit is contained in:
Anton Dyudin 2015-12-21 17:29:47 -08:00
parent 1df8b9ede8
commit 4efa26c2d9
21 changed files with 195 additions and 82 deletions

View File

@ -944,10 +944,9 @@
|= [wir=whir ext=term bem=beam]
=+ yac=for-client
=. him.yac ?.(aut anon him.yac)
=: r.bem ?+(r.bem r.bem [%ud %0] da/now)
s.bem [%web ~(rent co (fcgi quy fcgi-cred.yac)) s.bem]
==
(execute wir -.bem [%boil ext bem ~])
=+ arg=/web/[~(rent co (fcgi quy fcgi-cred.yac))]
=. r.bem ?+(r.bem r.bem [%ud %0] da/now)
(execute wir -.bem [%boil ext bem arg])
::
::
++ apex

View File

@ -22,7 +22,7 @@
-- ::
|% :: structures
++ axle :: all %ford state
$: %1 :: version for update
$: %2 :: version for update
pol=(map ship baby) ::
== ::
++ baby :: state by ship
@ -106,7 +106,7 @@
++ chub :: cache merge
|= [a=cafe b=cafe] ::
^- cafe ::
[(grom p.a p.b) (grum q.a q.b)] ::
[(~(uni in p.a) p.b) (~(uni by q.a) q.b)] ::
:: ::
++ faun (flux |=(a=vase [%& %noun a])) :: vase to gage
++ feel (flux |=(a=cage q.a)) :: cage to vase
@ -136,15 +136,6 @@
++ flue |=(a=cafe (fine a ~)) :: cafe to empty
++ flux |* a=_,* :: bolt lift (fmap)
|*([b=cafe c=_+<.a] (fine b (a c))) ::
++ grom :: merge sets
|* [one=(set) two=(set)]
^+ one
(~(gas in one) (~(tap in two) ~)) :: XX ugh
::
++ grum :: merge maps
|* [one=(map) two=(map)]
^+ one
(~(gas by one) (~(tap by two) ~)) :: XX ugh
::
++ lark :: filter arch names
|= [wox=$+(span (unit ,@)) arc=arch]
@ -373,7 +364,7 @@
:- p=p.nuf
^= q
?- -.q.nuf
%0 [%0 p=(grom p.q.hoc p.q.nuf) q=[q.q.hoc q.q.nuf]]
%0 [%0 p=(~(uni in p.q.hoc) p.q.nuf) q=[q.q.hoc q.q.nuf]]
%1 q.nuf
%2 q.nuf
==
@ -382,7 +373,7 @@
^= q
?- -.q.nuf
%0 q.hoc
%1 [%1 p=(grom p.q.nuf p.q.hoc)]
%1 [%1 p=(~(uni in p.q.nuf) p.q.hoc)]
%2 q.nuf
==
%2 hoc
@ -403,23 +394,23 @@
^= q
?- -.q.nuf
%1 q.nuf
%2 [%2 p=(grom `_p.q.nuf`p.q.hoc p.q.nuf) q=q.q.nuf]
%0 [%0 p=(grom `_p.q.nuf`p.q.hoc p.q.nuf) q=q.q.nuf]
%2 [%2 p=(~(uni in `_p.q.nuf`p.q.hoc) p.q.nuf) q=q.q.nuf]
%0 [%0 p=(~(uni in `_p.q.nuf`p.q.hoc) p.q.nuf) q=q.q.nuf]
== ==
::
++ coop :: bolt alter
|* [hoc=(bolt) fun=(burg)]
|* [hoc=(bolt) fun=$+(cafe (bolt))]
?- -.q.hoc
%1 hoc
%0 hoc
%2 =+ nuf=(fun(+<- p.hoc))
%2 =+ nuf=(fun p.hoc)
:- p=p.nuf
^= q
?- -.q.nuf
%1 q.nuf
%0 [%0 p=(grom `_p.q.nuf`p.q.hoc p.q.nuf) q=q.q.nuf]
%0 [%0 p=(~(uni in `_p.q.nuf`p.q.hoc) p.q.nuf) q=q.q.nuf]
%2 =. q.q.nuf (welp q.q.nuf q.q.hoc)
[%2 p=(grom `_p.q.nuf`p.q.hoc p.q.nuf) q=q.q.nuf]
[%2 p=(~(uni in `_p.q.nuf`p.q.hoc) p.q.nuf) q=q.q.nuf]
== ==
::
++ coup :: toon to bolt
@ -705,17 +696,19 @@
=| tol=?
|%
++ apex
~! -:*^horn
%+ knee *^horn |. ~+
;~ pfix fas
;~ pose
(stag %toy ;~(sfix sym fas))
(stag %ape ;~(pfix sig ape:read))
(stag %arg ;~(pfix buc ape:read))
(stag %alt ;~(pfix hax fan:read))
(stag %day ;~(pfix bar day:read))
(stag %dub ;~(pfix tis dub:read))
(stag %fan ;~(pfix dot fan:read))
(stag %for ;~(pfix com for:read))
(stag %hel ;~(pfix cen hel:read))
(stag %hel ;~(pfix cen day:read))
(stag %hub ;~(pfix pat day:read))
(stag %man ;~(pfix tar man:read))
(stag %nap ;~(pfix cab day:read))
@ -755,11 +748,6 @@
%+ rail
;~(plug (ifix [sel ser] hath) apex(tol |))
;~(pfix gap ;~(plug hath ;~(pfix gap apex)))
::
++ hel
%+ rail
;~(plug ;~(pose ;~(sfix dem:ag cen) (easy 0)) apex(tol |))
;~(pfix gap ;~(plug ;~(pose ;~(sfix dem:ag gap) (easy 0)) apex))
::
++ man
%+ rail fail
@ -1185,11 +1173,19 @@
%+ cope (lima cof for mob (flop mer))
|= [cof=cafe vux=(unit vase)]
?^ vux (fine cof u.vux)
?~ s.mob
%+ flaw cof
~[leaf/"build {<for>}" leaf/"no usable ancestors" (smyt (tope bem))]
?~ s.mob (limp cof for bem arg)
^$(s.mob t.s.mob, mer [i.s.mob mer])
::
++ limp :: render
|= [cof=cafe for=mark bem=beam arg=heel]
%+ cope (fame cof -.bem /[for]/ren)
|= [cof=cafe bom=beam]
(cope (fade cof %hoon bom) abut:(meow bem arg))
:: |= [cof=cafe vax=vase]
:: %+ flaw cof
:: ~[leaf/"build {<for>}" leaf/"no usable ancestors" (smyt (tope bem))]
::
++ link :: translate
|= [cof=cafe too=mark for=mark vax=vase]
^- (bolt vase)
@ -1462,6 +1458,7 @@
=| $: rop=(map term (pair hoof twig)) :: structures
bil=(map term (pair hoof twig)) :: libraries
boy=(list twig) :: body stack
lit=? :: drop arguments
==
~% %meow ..meow
==
@ -1567,6 +1564,12 @@
%+ cope (maim cof bax p.hon)
|= [cof=cafe gat=vase]
(maul cof gat !>([how arg]))
::
%alt
%. cof
|= cof=cafe ^- (bolt vase)
?~ p.hon (flaw cof leaf/"ford: out of options" ~)
(coop ^$(cof cof, hon i.p.hon) ..$(p.hon t.p.hon))
::
%day (chad cof bax %dr p.hon)
%dub
@ -1588,12 +1591,7 @@
(slop i.tev $(tev t.tev))
::
%for $(hon q.hon, s.how (weld (flop p.hon) s.how))
%hel
%= $
hon q.hon
arg (scag p.hon arg)
s.how (weld (slag p.hon arg) s.how)
==
%hel $(hon p.hon, lit |)
%hub (chad cof bax %ud p.hon)
%man
|- ^- (bolt vase)
@ -1631,7 +1629,7 @@
(flaw cof [%leaf "type error: {<p.hon>} {<q.hon>}"]~)
(fine cof [p.tug q.vax])
::
%toy (cope (cope (make cof %boil p.hon how ~) furl) feel)
%toy (cope (cope (make cof %boil p.hon how ?:(lit ~ arg)) furl) feel)
==
::
++ chop :: possible subpaths
@ -1639,6 +1637,7 @@
=+ acc=[new=*(set beam) old=old]
|- ^+ acc
?- -.hon
%hel $(hon p.hon)
?(%ape %arg %toy) acc
?(%dub %sic %saw) $(hon q.hon)
?(%day %hub %nap %now) acc :: drop to avoid cycles
@ -1647,12 +1646,7 @@
=. r.p.hon ?:(?=([%ud 0] r.p.hon) r.how r.p.hon)
$(hon q.hon, how p.hon)
::
%hel
=. s.how (weld (slag p.hon arg) s.how)
?: (~(has in old.acc) how) acc
[(~(put in new.acc) how) (~(put in old.acc) how)]
::
%fan
?(%fan %alt)
|- ^+ acc
?~ p.hon acc
^$(hon i.p.hon, acc $(p.hon t.p.hon))
@ -1894,8 +1888,81 @@
~
::
++ load :: highly forgiving
|= old=axle
..^$(+>- old)
=< |= old=?(axle [%1 pol=(map ship baby-1)])
?- -.old
%2 ..^$(+>- old)
%1 ..^$(+>- [%1 (~(run by pol.old) baby-load)])
==
|%
++ horn-1
$_
=+ hon=*horn
~| hon
|-
?- -.hon
%hel [%hel *@ q=$(hon p.hon)]
::
?(%ape %arg %toy %alt) hon
?(%day %hub %nap %now) hon(p $(hon p.hon))
?(%dub %for %saw %see %sic) hon(q $(hon q.hon))
%fan hon(p (turn p.hon ..$))
%man hon(p (~(run by p.hon) ..$))
==
++ horn-load
|= hon=horn-1 ^- horn
?- -.hon
%hel [%hel $(hon q.hon)]
::
?(%ape %arg %toy %alt) hon
?(%day %hub %nap %now) hon(p $(hon p.hon))
?(%dub %for %saw %see %sic) hon(q $(hon q.hon))
%fan hon(p (turn p.hon ..$))
%man hon(p (~(run by p.hon) ..$))
==
++ hood-1 ,_%*(. *hood fan *(list horn-1))
++ hood-load |=(hood-1 +<(fan (turn fan horn-load)))
++ calx-1 ,_=+(cal=*calx ?+(-.cal cal %hood cal(r *hood-1)))
++ calx-load |=(cal=calx-1 ?+(-.cal cal %hood cal(r (hood-load r.cal))))
::
++ silk-1
$_
=+ sil=*silk
|-
?- -.sil
%plan sil(r *hood-1)
::
^ sil(p $(sil p.sil), q $(sil q.sil))
?(%$ %bake %boil %bunt %core %file %reef %vale %volt) sil
?(%cast %dude %flag %ride) sil(q $(sil q.sil))
?(%call %diff %pact) sil(p $(sil p.sil), q $(sil q.sil))
%join sil(q $(sil q.sil), r $(sil r.sil))
%mash sil(r.q $(sil r.q.sil), r.r $(sil r.r.sil))
%tabl sil(p (turn p.sil |=([a=silk b=silk] [^$(sil a) ^$(sil b)])))
%mute
sil(p $(sil p.sil), q (turn q.sil |=([a=wing b=silk] [a ^$(sil b)])))
==
++ silk-load
|= sil=silk-1 ^- silk
?- -.sil
%plan sil(r (hood-load r.sil))
::
^ [$(sil p.sil) $(sil q.sil)]
?(%$ %bake %boil %bunt %core %file %reef %vale %volt) sil
?(%cast %dude %flag %ride) sil(q $(sil q.sil))
?(%call %diff %pact) sil(p $(sil p.sil), q $(sil q.sil))
%join sil(q $(sil q.sil), r $(sil r.sil))
%mash sil(r.q $(sil r.q.sil), r.r $(sil r.r.sil))
%tabl sil(p (turn p.sil |=([a=silk-1 b=silk-1] [^$(sil a) ^$(sil b)])))
%mute
sil(p $(sil p.sil), q (turn q.sil |=([a=wing b=silk-1] [a ^$(sil b)])))
==
++ task-1 ,_%*(. *task kas *silk-1)
++ task-load |=(task-1 +<(kas (silk-load kas)))
++ baby-1 ,_%*(. *baby jav *(map ,* calx-1), q.tad *(map ,@ task-1))
++ baby-load
|= baby-1
+<(jav (~(run by jav) calx-load), q.tad (~(run by q.tad) task-load))
--
::=. old
:: ?. ?=([%0 *] old) old :: remove at 1
:: :- %1

View File

@ -4631,7 +4631,7 @@
^- toon
?. ?=([2 *] ton) ton
:- %2
=. p.ton (moop p.ton)
:: =. p.ton (moop p.ton)
=+ yel=(lent p.ton)
=. p.ton
?. (gth yel 256) p.ton

View File

@ -2512,11 +2512,12 @@
++ horn :: resource tree
$% [%ape p=twig] :: /~ twig by hand
[%arg p=twig] :: /$ argument
[%alt p=(list horn)] :: /# options
[%day p=horn] :: /| list by @dr
[%dub p=term q=horn] :: /= apply face
[%fan p=(list horn)] :: /. list
[%for p=path q=horn] :: /, descend
[%hel p=@ud q=horn] :: /% propagate heel
[%hel p=horn] :: /% propagate args
[%hub p=horn] :: /@ list by @ud
[%man p=(map span horn)] :: /* hetero map
[%nap p=horn] :: /_ homo map

View File

@ -1,2 +0,0 @@
/: /%%%/tree/pub/docs /% /hymn/
-<

View File

@ -1,2 +0,0 @@
/: /%%%/tree/pub/docs /% /json/
-<

View File

@ -1,2 +0,0 @@
/: /%%%/tree/pub/front /% /hymn/
-<

View File

@ -1,2 +0,0 @@
/: /%%%/tree/pub/front /% /json/
-<

View File

@ -1,4 +1,5 @@
if(!window.urb.appl) window.urb.appl = null
window.urb = window.urb || {}
window.urb.appl = window.urb.appl || null
window.urb.req = function(method,url,params,json,cb) {
var xhr = new XMLHttpRequest()

14
mar/talklog/hymn.hoon Normal file
View File

@ -0,0 +1,14 @@
::
:::: /hoon/core/hymn/mar
::
/? 314
|_ own=manx
::
++ grow :: convert to
|%
++ html (crip (poxo own)) :: convert to %html
++ mime [/text/html (taco html)] :: convert to %mime
--
++ grab |% :: convert from
++ noun manx :: clam from %noun
-- --

14
mar/tree/hymn.hoon Normal file
View File

@ -0,0 +1,14 @@
::
:::: /hoon/core/hymn/mar
::
/? 314
|_ own=manx
::
++ grow :: convert to
|%
++ html (crip (poxo own)) :: convert to %html
++ mime [/text/html (taco html)] :: convert to %mime
--
++ grab |% :: convert from
++ noun manx :: clam from %noun
-- --

4
mar/tree/include.hoon Normal file
View File

@ -0,0 +1,4 @@
/- tree-include
|_ tree-include
++ grab |% ++ noun tree-include
-- --

19
mar/tree/json.hoon Normal file
View File

@ -0,0 +1,19 @@
::
:::: /hoon/json/mar
::
/? 314
::
:::: compute
::
|_ jon=json
::
++ grow :: convert to
|%
++ mime [/text/json (tact (pojo jon))] :: convert to %mime
--
++ grab
|% :: convert from
:: ++ mime |=([p=mite q=octs] (fall (rush (,@t q.q) apex:poja) *json))
++ noun json :: clam from %noun
--
--

View File

@ -14,8 +14,10 @@
++ grab
|% :: convert from
++ noun manx :: clam from %noun
++ hymn :: inject into %hymn
|= old=manx old :: moved to %eyre
:: ++ tree-hymn :: inject into %hymn
:: |= old=manx old :: moved to %eyre
:: XX in ren/
:: ~| hymn//mal-formed
:: :: ~| old
:: ?> ?=([[%html ~] [[%head ~] *] [[%body ~] ^] ~] old) :: XX static

View File

@ -1602,7 +1602,7 @@ $(function() {
};
TreeActions = require('./actions/TreeActions.coffee');
TreePersistence = require('./persistence/TreePersistence.coffee');
frag = window.tree.fragpath(window.location.pathname);
frag = window.tree.fragpath(window.location.pathname.replace(/\.[^\/]*$/, ''));
TreeActions.setCurr(frag);
TreeActions.loadPath(frag, window.tree.data);
rend(head({}, ""), $('#nav')[0]);
@ -2139,7 +2139,7 @@ module.exports = {
if (query == null) {
query = "no-query";
}
url = (window.tree.basepath(path)) + ".json?q=" + (this.encode(query));
url = (window.tree.basepath(path)) + ".tree-json?q=" + (this.encode(query));
if (dedup[url]) {
return;
}

View File

@ -1,5 +1,5 @@
/+ tree
/: /%%/ /% /elem/
/elem/
::
::::
::

View File

@ -1,13 +1,12 @@
:: Talk log front-end
::
:::: /hook/hymn/talklog/pub
:::: /hoon/hymn/talklog/ren
::
/? 310
:: /& |=([beam path] ~&(+< ~))
/= mez
/: /===/talk
/% 2
/; pojo
/; |=(a=(list ,[@ p=json]) =.(a (flop a) ?~(a [%a ~] p.i.a)))
/; |=(a=(list ,[@ p=json]) =.(a (flop a) ?~(a !! p.i.a)))
/& /json/
|%
++ cdnj |=(a=tape ;script(src "//cdnjs.cloudflare.com/ajax/libs/{a}");)
@ -29,9 +28,9 @@
;script(type "text/javascript", src "/~/at/home/lib/urb.js");
;link/"/home/pub/talk/src/css/main.css"(type "text/css", rel "stylesheet");
;script: window.MessageData = {mez}
;script@"src/MessagesComponent.coffee"(type "text/coffeescript");
;script@"src/util.coffee"(type "text/coffeescript");
;script@"src/main.coffee"(type "text/coffeescript");
;script@"/home/pub/talklog/src/MessagesComponent.coffee"(type "text/coffeescript");
;script@"/home/pub/talklog/src/util.coffee"(type "text/coffeescript");
;script@"/home/pub/talklog/src/main.coffee"(type "text/coffeescript");
;+ (cdnj "coffee-script/1.7.1/coffee-script.min.js")
==
==

View File

@ -1,7 +1,7 @@
::
/? 314
/- tree-include
/= dat /: /%%/ /% /json/ :: default include
/= dat /% /tree-json/ :: default include
/= aut /; |=(gas=epic (~(has ju aut.ced.gas) %$ (scot %p p.bem.gas)))
/$ fuel
::

View File

@ -1,9 +1,9 @@
/+ tree, react
/= mime /: /=== /% /^ mime /mime/
/= body /: /=== /% /elem/
/= snip /: /=== /% /snip/
/= meta /: /=== /% /front/
/= sect /: /=== /% /index/
/= mime /mime/
/= body /elem/
/= snip /snip/
/= meta /front/
/= sect /index/
!:
^- tree-include
=+ rj=react-to-json:react

View File

@ -4,13 +4,9 @@
/? 314
/+ tree
/= gas /$ fuel
/= dat /^ tree-include
/: /===/tree-gen /%
/tree-include/
::
/= dat /^ tree-include /tree-include/
/= kid /^ (map span tree-include)
/: /===/tree-gen /% 2 /_
/tree-include/
/_ /tree-include/
!:
::::
::

5
ren/urb.hoon Normal file
View File

@ -0,0 +1,5 @@
/% /#
/talklog-hymn/
/tree-hymn/
==
`manx`-<