mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
Merge branch 'master' of https://github.com/urbit/urbit
This commit is contained in:
commit
4b4ba12e1c
@ -1,4 +1,4 @@
|
||||
!:
|
||||
::
|
||||
:: clay (4c), revision control
|
||||
::
|
||||
|= pit=vase
|
||||
|
@ -33,7 +33,7 @@
|
||||
+>(mos [[hen [%give %blit (flop wab)]] mos])
|
||||
::
|
||||
++ wod :: word forward
|
||||
|= bed=bean
|
||||
|= bed=bein
|
||||
^- @ud
|
||||
?: =(bul.bed bus.bed)
|
||||
bus.bed
|
||||
@ -48,7 +48,7 @@
|
||||
$(bus.bed +(bus.bed))
|
||||
::
|
||||
++ wob :: word backward
|
||||
|= bed=bean
|
||||
|= bed=bein
|
||||
^- @ud
|
||||
?: =(0 bus.bed)
|
||||
bus.bed
|
||||
@ -63,7 +63,7 @@
|
||||
$(bus.bed (dec bus.bed))
|
||||
::
|
||||
++ edit :: change the bed
|
||||
|= bed=bean
|
||||
|= bed=bein
|
||||
^+ +>
|
||||
=. q.q.yar [~ bed]
|
||||
?> ?=(^ q.q.yar)
|
||||
@ -388,7 +388,7 @@
|
||||
::
|
||||
%helo :: trigger prompt
|
||||
%- edit
|
||||
=| bed=bean
|
||||
=| bed=bein
|
||||
=+ ^= hyt ^- hist
|
||||
=+ hyt=(~(get by r.yar) p.fav)
|
||||
?~(hyt *hist u.hyt)
|
||||
|
@ -275,7 +275,7 @@
|
||||
==
|
||||
::
|
||||
%waft
|
||||
?. ?=([%hork @ @ ~] tea)
|
||||
?. ?=([%hork @ ~] tea)
|
||||
+.$
|
||||
(gosh q.p.fav (need (slaw %ud i.t.tea)) ((hard httr) q.fav))
|
||||
::
|
||||
@ -442,13 +442,13 @@
|
||||
==
|
||||
::
|
||||
++ hoth :: simple app request
|
||||
|= [our=ship num=@ud ses=hole app=term pax=path]
|
||||
|= [our=ship num=@ud ses=hole app=term hop=hope]
|
||||
%_ +>
|
||||
mow
|
||||
:_ mow
|
||||
:^ hen %toss %g
|
||||
:- [%hoth (scot %p our) ses (scot %ud num) ~]
|
||||
[%show [our app] ~ `(unit plan)``[%x [now `~0s] pax]]
|
||||
[%show [our app] ~ hop]
|
||||
==
|
||||
::
|
||||
++ hork :: remote request
|
||||
@ -854,7 +854,7 @@
|
||||
^- (unit seam)
|
||||
?> ?=(^ fur)
|
||||
?> ?=(^ paw)
|
||||
`[%aps u.fur i.paw t.paw]
|
||||
`[%apg u.fur i.paw t.paw]
|
||||
::
|
||||
++ flea :: permissive decimal
|
||||
|= txt=@t
|
||||
@ -1449,9 +1449,15 @@
|
||||
%way [[~ pip] +>.$]
|
||||
%new
|
||||
?- -.som.pip
|
||||
%aps :: XX a mere stub
|
||||
%apg :: XX a mere stub
|
||||
~& [%wink-apg p.som.pip r.som.pip]
|
||||
:- [~ pip(pez %way)]
|
||||
+>.$(..ya (hoth our num ses p.som.pip r.som.pip))
|
||||
+>.$(..ya (hoth our num ses q.som.pip %& r.som.pip))
|
||||
::
|
||||
%apl !!
|
||||
%apm !!
|
||||
%aps !!
|
||||
%apu !!
|
||||
::
|
||||
%con
|
||||
:_ +>.$
|
||||
@ -1559,7 +1565,9 @@
|
||||
;
|
||||
; if(e.keyCode == 69 && ctrl == true) {
|
||||
; console.log('^e')
|
||||
; $input[0].selectionStart = $input[0].selectionEnd = $input.val().length
|
||||
; $input[0].selectionStart =
|
||||
; $input[0].selectionEnd =
|
||||
; $input.val().length;
|
||||
; return
|
||||
; }
|
||||
; if(e.keyCode == 65 && ctrl == true) {
|
||||
@ -1591,7 +1599,8 @@
|
||||
; $input.val(hist[hind])
|
||||
; setTimeout(function() {
|
||||
; console.log(hist[hind].length)
|
||||
; $input[0].setSelectionRange(hist[hind].length,hist[hind].length)
|
||||
; $input[0].setSelectionRange
|
||||
; (hist[hind].length,hist[hind].length)
|
||||
; }, 0)
|
||||
; return;
|
||||
; }
|
||||
|
@ -516,6 +516,7 @@
|
||||
++ make :: reduce silk
|
||||
|= [cof=cafe kas=silk]
|
||||
^- (bolt cage)
|
||||
~& %ford-make
|
||||
?- -.kas
|
||||
^
|
||||
%. [cof p.kas q.kas]
|
||||
|
@ -3,7 +3,7 @@
|
||||
::::
|
||||
|= pit=vase
|
||||
=> =~
|
||||
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: structures
|
||||
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: structures
|
||||
++ axle :: all %gall state
|
||||
$: %0 :: state version
|
||||
pol=(map ship mast) :: apps by ship
|
||||
@ -11,24 +11,31 @@
|
||||
++ bone ,@ud :: opaque duct
|
||||
++ gift :: out result <-$
|
||||
$% [%back p=?] :: %mess ack good/bad
|
||||
[%bock p=path q=?] :: %show on/off
|
||||
[%bust ~] :: reset duct
|
||||
[%crud p=(list tank)] :: error
|
||||
[%meta p=vase] :: application gift
|
||||
[%rash p=json] :: web reaction
|
||||
[%rasp p=cage] :: urbit reaction
|
||||
[%rush p=@da q=json] :: web result
|
||||
[%rust p=@da q=cage] :: urbit result
|
||||
[%meta p=vase] :: meta-gift
|
||||
== ::
|
||||
++ kiss :: in request ->$
|
||||
$% [%mess p=hasp q=(disk)] :: urbit message
|
||||
$% [%cuff p=(unit cuff) q=kiss] :: controlled kiss
|
||||
[%mesh p=hasp q=path r=json] :: web message (json)
|
||||
[%mess p=hasp q=cage] :: urbit message
|
||||
[%mush p=hasp q=path r=cage] :: web message (mime)
|
||||
[%nuke p=hasp] :: reset this duct
|
||||
:: [%puke p=(list tank) q=kiss] :: inbound error
|
||||
[%user p=(unit chop) q=kiss] :: restriction
|
||||
[%show p=hasp q=path r=(unit plan)] :: subscription
|
||||
:: [%puke p=(list tank) q=kiss] :: kiss will fail
|
||||
[%shah p=hasp q=(unit hope)] :: web subscribe
|
||||
[%show p=hasp q=(unit hope)] :: urbit subscribe
|
||||
[%soft p=*] :: soft kiss
|
||||
== ::
|
||||
++ knob :: pending action
|
||||
$% [%boot ~] :: boot/reboot
|
||||
[%crud p=(list tank)] :: error
|
||||
[%mess p=(disk)] :: message
|
||||
[%mess p=cage] :: message
|
||||
[%nuke ~] :: reboot
|
||||
[%show p=path q=(unit plan)] :: subscription
|
||||
[%show p=(unit hope)] :: subscription
|
||||
[%take p=path q=vase] :: user result
|
||||
== ::
|
||||
++ mast :: apps by ship
|
||||
@ -39,7 +46,7 @@
|
||||
++ rapt |*(a=$+(* *) (qual path path ,@da a)) :: versioned result
|
||||
++ scar :: opaque duct system
|
||||
$: p=@ud :: bone sequence
|
||||
q=(map duct ,[p=bone q=(unit chop)]) :: by duct
|
||||
q=(map duct ,[p=bone q=(unit cuff)]) :: by duct
|
||||
r=(map bone duct) :: by bone
|
||||
== ::
|
||||
++ seat :: the living app
|
||||
@ -55,20 +62,6 @@
|
||||
[%ruse p=curd] :: user wrapper
|
||||
[%writ p=riot] :: version result
|
||||
== ::
|
||||
++ suit :: application gift
|
||||
$% [%back p=?] :: %mess ack good/bad
|
||||
[%bock p=path q=?] :: %show on/off
|
||||
[%boom ~] :: reset all ducts
|
||||
[%bust ~] :: reset this duct
|
||||
[%barn p=(rapt (disk))] :: %v report
|
||||
[%crud p=(list tank)] :: error notification
|
||||
[%dash p=(rapt null)] :: %u report
|
||||
[%dish p=(rapt (disk))] :: %z report
|
||||
[%diff p=(rapt (unit (disk)))] :: %w report
|
||||
[%file p=(rapt (disk))] :: %x report
|
||||
[%fold p=(rapt arch)] :: %y report
|
||||
[%rasp p=(disk)] :: response message
|
||||
== ::
|
||||
++ toil (pair duct knob) :: work in progress
|
||||
-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: functions
|
||||
@ -83,17 +76,17 @@
|
||||
all
|
||||
::
|
||||
++ read :: read permission
|
||||
|= law=(unit chop)
|
||||
|= law=(unit cuff)
|
||||
^- (unit (set monk))
|
||||
?~(law [~ ~] p.u.law)
|
||||
::
|
||||
++ ride :: all permission
|
||||
|= [use=(unit (set monk)) say=(unit (set monk))]
|
||||
^- (unit chop)
|
||||
^- (unit cuff)
|
||||
?~(say ~ `[use u.say])
|
||||
::
|
||||
++ rite :: write permission
|
||||
|= law=(unit chop)
|
||||
|= law=(unit cuff)
|
||||
^- (unit (set monk))
|
||||
?~(law ~ `q.u.law)
|
||||
::
|
||||
@ -107,9 +100,9 @@
|
||||
^+ one
|
||||
(~(gas by one) (~(tap by two) ~)) :: XX ugh
|
||||
::
|
||||
++ limp :: merge chops
|
||||
|= [a=(unit chop) b=(unit chop)]
|
||||
^- (unit chop)
|
||||
++ limp :: merge cuffs
|
||||
|= [a=(unit cuff) b=(unit cuff)]
|
||||
^- (unit cuff)
|
||||
?~ a b
|
||||
?~ b a
|
||||
:- ~
|
||||
@ -135,23 +128,26 @@
|
||||
++ call :: handle request
|
||||
|= [hen=duct hil=(hypo kiss)]
|
||||
|- ^- [p=(list move) q=_..^^$]
|
||||
=+ =| law=(unit chop)
|
||||
|- ^- $: law=(unit chop)
|
||||
=+ =| law=(unit cuff)
|
||||
|- ^- $: law=(unit cuff)
|
||||
hap=hasp
|
||||
kon=knob
|
||||
==
|
||||
?- -.q.hil
|
||||
%cuff $(q.hil q.q.hil, law (limp p.q.hil law))
|
||||
%mesh !!
|
||||
%mess [law p.q.hil %mess q.q.hil]
|
||||
%show [law p.q.hil %show q.q.hil r.q.hil]
|
||||
%mush !!
|
||||
%shah !!
|
||||
%show [law p.q.hil %show q.q.hil]
|
||||
%soft $(q.hil ((hard kiss) p.q.hil))
|
||||
%nuke [law p.q.hil %nuke ~]
|
||||
%user $(q.hil q.q.hil, law (limp p.q.hil law))
|
||||
==
|
||||
abet:work:(quem:(boar:(goat hap) hen law) kon)
|
||||
::
|
||||
++ take :: accept response
|
||||
|= [pax=path hen=duct hil=(hypo sign)] ::
|
||||
^- [(list move) _..^$]
|
||||
^- [p=(list move) q=_..^$]
|
||||
=+ lum=(lump pax)
|
||||
=< abet =< work
|
||||
(more:(bear:(gaur p.lum) hen) q.lum hil)
|
||||
@ -250,7 +246,7 @@
|
||||
::
|
||||
++ boar :: write forward
|
||||
|= $: hen=duct :: cause
|
||||
law=(unit chop) :: permissions
|
||||
law=(unit cuff) :: permissions
|
||||
==
|
||||
=^ orf zam.sat
|
||||
=+ orf=(~(get by q.zam.sat) hen)
|
||||
@ -466,9 +462,9 @@
|
||||
[(sump (slot 2 vud)) $(vud (slot 3 vud))]
|
||||
::
|
||||
++ show :: subscribe
|
||||
|= [pax=path pul=(unit plan)] :: subscription
|
||||
|= hup=(unit hope) :: subscription
|
||||
^+ +>
|
||||
%_(+> vey.sat (~(put to vey.sat) hen %show pax pul))
|
||||
%_(+> vey.sat (~(put to vey.sat) hen %show hup))
|
||||
::
|
||||
++ sump
|
||||
|= wec=vase
|
||||
@ -540,9 +536,9 @@
|
||||
~& %yawn-show
|
||||
?~ huv.sat
|
||||
~& [%show-none our app]
|
||||
gone:(give %bock p.kon |)
|
||||
gone:(give %bust ~)
|
||||
%^ game [%step %peer] u.huv.sat
|
||||
!>([ost use p.kon q.kon])
|
||||
!>([ost use p.kon])
|
||||
::
|
||||
%take
|
||||
~& %yawn-take
|
||||
|
233
arvo/hoon.hoon
233
arvo/hoon.hoon
@ -480,7 +480,8 @@
|
||||
$(a (sub a b), c +(c))
|
||||
::
|
||||
++ fac :: factorial
|
||||
|= a=@ :: This should be jetted.
|
||||
~/ %fac
|
||||
|= a=@
|
||||
^- @
|
||||
?: =(0 a)
|
||||
1
|
||||
@ -1323,7 +1324,7 @@
|
||||
++ in :: set engine
|
||||
~/ %in
|
||||
|/ a=(set)
|
||||
+- all
|
||||
+- all :: logical AND
|
||||
~/ %all
|
||||
|* b=$+(* ?)
|
||||
|- ^- ?
|
||||
@ -1331,7 +1332,7 @@
|
||||
&
|
||||
?&((b n.a) $(a l.a) $(a r.a))
|
||||
::
|
||||
+- any
|
||||
+- any :: logical OR
|
||||
~/ %any
|
||||
|* b=$+(* ?)
|
||||
|- ^- ?
|
||||
@ -1339,7 +1340,7 @@
|
||||
|
|
||||
?|((b n.a) $(a l.a) $(a r.a))
|
||||
::
|
||||
+- del
|
||||
+- del :: b without any a
|
||||
~/ %del
|
||||
|* b=*
|
||||
|- ^+ a
|
||||
@ -1356,7 +1357,7 @@
|
||||
[n.l.a l.l.a $(l.a r.l.a)]
|
||||
[n.r.a $(r.a l.r.a) r.r.a]
|
||||
::
|
||||
+- dig
|
||||
+- dig :: axis of a in b
|
||||
|= b=*
|
||||
=+ c=1
|
||||
|- ^- (unit ,@)
|
||||
@ -1366,7 +1367,7 @@
|
||||
$(a l.a, c (peg c 6))
|
||||
$(a r.a, c (peg c 7))
|
||||
::
|
||||
+- gas
|
||||
+- gas :: concatenate
|
||||
~/ %gas
|
||||
|= b=(list ,_?>(?=(^ a) n.a))
|
||||
|- ^+ a
|
||||
@ -1374,7 +1375,7 @@
|
||||
a
|
||||
$(b t.b, a (put(+< a) i.b))
|
||||
::
|
||||
+- has
|
||||
+- has :: b exists in a check
|
||||
~/ %has
|
||||
|* b=*
|
||||
|- ^- ?
|
||||
@ -1386,7 +1387,7 @@
|
||||
$(a l.a)
|
||||
$(a r.a)
|
||||
::
|
||||
+- put
|
||||
+- put :: puts b in a, sorted
|
||||
~/ %put
|
||||
|* b=*
|
||||
|- ^+ a
|
||||
@ -1406,13 +1407,13 @@
|
||||
[n.a l.a c]
|
||||
[n.c [n.a l.a l.c] r.c]
|
||||
::
|
||||
+- rep
|
||||
+- rep :: replace by tile
|
||||
|* [b=* c=_,*]
|
||||
|-
|
||||
?~ a b
|
||||
$(a r.a, b $(a l.a, b (c n.a b)))
|
||||
::
|
||||
+- tap
|
||||
+- tap :: list tiles a set
|
||||
~/ %tap
|
||||
|= b=(list ,_?>(?=(^ a) n.a))
|
||||
^+ b
|
||||
@ -1420,7 +1421,7 @@
|
||||
b
|
||||
$(a r.a, b [n.a $(a l.a)])
|
||||
::
|
||||
+- wyt
|
||||
+- wyt :: depth of set
|
||||
.+
|
||||
|- ^- @
|
||||
?~(a 0 +((add $(a l.a) $(a r.a))))
|
||||
@ -1438,12 +1439,12 @@
|
||||
::
|
||||
++ ja :: jar engine
|
||||
|/ a=(jar)
|
||||
+- get
|
||||
+- get :: gets list by key
|
||||
|* b=*
|
||||
=+ c=(~(get by a) b)
|
||||
?~(c ~ u.c)
|
||||
::
|
||||
+- add
|
||||
+- add :: adds key-list pair
|
||||
|* [b=* c=*]
|
||||
=+ d=(get(a +>) b)
|
||||
(~(put by a) [d c])
|
||||
@ -1451,17 +1452,17 @@
|
||||
::
|
||||
++ ju :: jug engine
|
||||
|/ a=(jug)
|
||||
+- get
|
||||
+- get :: gets set by key
|
||||
|* b=*
|
||||
=+ c=(~(get by a) b)
|
||||
?~(c ~ u.c)
|
||||
::
|
||||
+- has
|
||||
+- has :: existence check
|
||||
|* [b=* c=*]
|
||||
^- ?
|
||||
(~(has in (get(+< a) b)) c)
|
||||
::
|
||||
+- put
|
||||
+- put :: adds key-set pair
|
||||
|* [b=* c=*]
|
||||
^+ a
|
||||
=+ d=(get(+< a) b)
|
||||
@ -1471,7 +1472,7 @@
|
||||
++ by :: map engine
|
||||
~/ %by
|
||||
|/ a=(map)
|
||||
+- all
|
||||
+- all :: logical AND
|
||||
~/ %all
|
||||
|* b=$+(* ?)
|
||||
|- ^- ?
|
||||
@ -1479,7 +1480,7 @@
|
||||
&
|
||||
?&((b q.n.a) $(a l.a) $(a r.a))
|
||||
::
|
||||
+- any
|
||||
+- any :: logical OR
|
||||
~/ %any
|
||||
|* b=$+(* ?)
|
||||
|- ^- ?
|
||||
@ -1487,7 +1488,7 @@
|
||||
|
|
||||
?|((b q.n.a) $(a l.a) $(a r.a))
|
||||
::
|
||||
+- del
|
||||
+- del :: delete at key b
|
||||
~/ %del
|
||||
|* b=*
|
||||
|- ^+ a
|
||||
@ -1504,7 +1505,7 @@
|
||||
[n.l.a l.l.a $(l.a r.l.a)]
|
||||
[n.r.a $(r.a l.r.a) r.r.a]
|
||||
::
|
||||
+- dig
|
||||
+- dig :: axis of b key
|
||||
|= b=*
|
||||
=+ c=1
|
||||
|- ^- (unit ,@)
|
||||
@ -1514,7 +1515,7 @@
|
||||
$(a l.a, c (peg c 6))
|
||||
$(a r.a, c (peg c 7))
|
||||
::
|
||||
+- gas
|
||||
+- gas :: concatenate
|
||||
~/ %gas
|
||||
|* b=(list ,[p=* q=*])
|
||||
=> .(b `(list ,_?>(?=(^ a) n.a))`b)
|
||||
@ -1523,7 +1524,7 @@
|
||||
a
|
||||
$(b t.b, a (put(+< a) p.i.b q.i.b))
|
||||
::
|
||||
+- get
|
||||
+- get :: grab value by key
|
||||
~/ %get
|
||||
|* b=*
|
||||
|- ^- ?(~ [~ u=_?>(?=(^ a) q.n.a)])
|
||||
@ -1535,18 +1536,18 @@
|
||||
$(a l.a)
|
||||
$(a r.a)
|
||||
::
|
||||
+- has
|
||||
+- has :: key existence check
|
||||
~/ %has
|
||||
|* b=*
|
||||
!=(~ (get(+< a) b))
|
||||
::
|
||||
+- mar
|
||||
+- mar :: add with validation
|
||||
|* [b=_?>(?=(^ a) p.n.a) c=(unit ,_?>(?=(^ a) q.n.a))]
|
||||
?~ c
|
||||
(del b)
|
||||
(put b u.c)
|
||||
::
|
||||
+- put
|
||||
+- put :: adds key-value pair
|
||||
~/ %put
|
||||
|* [b=* c=*]
|
||||
|- ^+ a
|
||||
@ -1568,13 +1569,13 @@
|
||||
[n.a l.a d]
|
||||
[n.d [n.a l.a l.d] r.d]
|
||||
::
|
||||
+- rep
|
||||
+- rep :: replace by product
|
||||
|* [b=* c=_,*]
|
||||
|-
|
||||
?~ a b
|
||||
$(a r.a, b $(a l.a, b (c n.a b)))
|
||||
::
|
||||
+- rib
|
||||
+- rib :: transform + product
|
||||
|* [b=* c=_,*]
|
||||
|- ^+ [b a]
|
||||
?~ a [b ~]
|
||||
@ -1584,13 +1585,13 @@
|
||||
=+ f=$(a r.a, b -.e)
|
||||
[-.f [n.a +.e +.f]]
|
||||
::
|
||||
+- run
|
||||
+- run :: turns to tuples
|
||||
|* b=_,*
|
||||
|-
|
||||
?~ a a
|
||||
[[p.n.a (b q.n.a)] $(a l.a) $(a r.a)]
|
||||
::
|
||||
+- tap
|
||||
+- tap :: listify pairs
|
||||
~/ %tap
|
||||
|= b=(list ,_?>(?=(^ a) n.a))
|
||||
^+ b
|
||||
@ -1598,7 +1599,7 @@
|
||||
b
|
||||
$(a r.a, b [n.a $(a l.a)])
|
||||
::
|
||||
+- uni
|
||||
+- uni :: union, merge
|
||||
~/ %uni
|
||||
|= b=_a
|
||||
?@ b a
|
||||
@ -1607,7 +1608,7 @@
|
||||
b (~(uni by l.b) r.b)
|
||||
==
|
||||
::
|
||||
+- wyt
|
||||
+- wyt :: depth of map
|
||||
.+
|
||||
|- ^- @
|
||||
?~(a 0 +((add $(a l.a) $(a r.a))))
|
||||
@ -1626,17 +1627,17 @@
|
||||
$(a [n.r.a $(a [n.a l.a l.r.a]) r.r.a])
|
||||
a
|
||||
::
|
||||
+- dep
|
||||
+- dep :: max depth of queue
|
||||
|- ^- @
|
||||
?~ a 0
|
||||
+((max $(a l.a) $(a r.a)))
|
||||
::
|
||||
+- gas
|
||||
+- gas :: insert list to que
|
||||
|= b=(list ,_?>(?=(^ a) n.a))
|
||||
|- ^+ a
|
||||
?~(b a $(b t.b, a (put(+< a) i.b)))
|
||||
::
|
||||
+- get
|
||||
+- get :: head-tail pair
|
||||
|- ^+ [p=?>(?=(^ a) n.a) q=a]
|
||||
?~ a
|
||||
!!
|
||||
@ -1648,27 +1649,27 @@
|
||||
[n.a l.a q.b]
|
||||
[n.q.b [n.a l.a l.q.b] r.q.b]
|
||||
::
|
||||
+- nap
|
||||
+- nap :: removes head
|
||||
?> ?=(^ a)
|
||||
?: =(~ l.a) r.a
|
||||
=+ b=get(+< l.a)
|
||||
bal(+< ^+(a [p.b q.b r.a]))
|
||||
::
|
||||
+- put
|
||||
+- put :: insert new head
|
||||
|* b=*
|
||||
|- ^+ a
|
||||
?~ a
|
||||
[b ~ ~]
|
||||
bal(+< a(l $(a l.a)))
|
||||
::
|
||||
+- tap
|
||||
+- tap :: adds list to end
|
||||
|= b=(list ,_?>(?=(^ a) n.a))
|
||||
^+ b
|
||||
?~ a
|
||||
b
|
||||
$(a r.a, b [n.a $(a l.a)])
|
||||
::
|
||||
+- top
|
||||
+- top :: produces head
|
||||
|- ^- (unit ,_?>(?=(^ a) n.a))
|
||||
?~ a ~
|
||||
?~(r.a [~ n.a] $(a r.a))
|
||||
@ -1772,19 +1773,19 @@
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 2eB, parsing (tracing) ::
|
||||
::
|
||||
++ last |= [zyc=hair naz=hair]
|
||||
++ last |= [zyc=hair naz=hair] :: farther trace
|
||||
^- hair
|
||||
?: =(p.zyc p.naz)
|
||||
?:((gth q.zyc q.naz) zyc naz)
|
||||
?:((gth p.zyc p.naz) zyc naz)
|
||||
::
|
||||
++ lust |= [weq=char naz=hair]
|
||||
++ lust |= [weq=char naz=hair] :: detect newline
|
||||
^- hair
|
||||
?:(=(10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 2eC, parsing (custom rules) ::
|
||||
::
|
||||
++ cold
|
||||
++ cold :: replace w/ constant
|
||||
~/ %cold
|
||||
|* [cus=* sef=_rule]
|
||||
~/ %fun
|
||||
@ -1794,7 +1795,7 @@
|
||||
vex
|
||||
[p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
|
||||
::
|
||||
++ cook
|
||||
++ cook :: apply gate
|
||||
~/ %cook
|
||||
|* [poq=_,* sef=_rule]
|
||||
~/ %fun
|
||||
@ -1804,7 +1805,7 @@
|
||||
vex
|
||||
[p=p.vex q=[~ u=[p=(poq p.u.q.vex) q=q.u.q.vex]]]
|
||||
::
|
||||
++ easy
|
||||
++ easy :: always parse
|
||||
~/ %easy
|
||||
|* huf=*
|
||||
~/ %fun
|
||||
@ -1812,19 +1813,19 @@
|
||||
^- (like ,_huf)
|
||||
[p=p.tub q=[~ u=[p=huf q=tub]]]
|
||||
::
|
||||
++ fail |=(tub=nail [p=p.tub q=~])
|
||||
++ full
|
||||
++ fail |=(tub=nail [p=p.tub q=~]) :: never parse
|
||||
++ full :: has to fully parse
|
||||
|* sef=_rule
|
||||
|= tub=nail
|
||||
=+ vex=(sef tub)
|
||||
?@(q.vex vex ?:(=(~ q.q.u.q.vex) vex [p=p.vex q=~]))
|
||||
::
|
||||
++ funk
|
||||
++ funk :: add to tape first
|
||||
|* [pre=tape sef=_rule]
|
||||
|= tub=nail
|
||||
(sef p.tub (weld pre q.tub))
|
||||
::
|
||||
++ here
|
||||
++ here :: place-based apply
|
||||
~/ %here
|
||||
|* [hez=_|=([a=pint b=*] [a b]) sef=_rule]
|
||||
~/ %fun
|
||||
@ -1834,7 +1835,7 @@
|
||||
vex
|
||||
[p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]]
|
||||
::
|
||||
++ jest
|
||||
++ jest :: match a cord
|
||||
|= daf=@t
|
||||
|= tub=nail
|
||||
=+ fad=daf
|
||||
@ -1846,7 +1847,7 @@
|
||||
$(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
|
||||
::
|
||||
++ just :: XX redundant, jest
|
||||
~/ %just
|
||||
~/ %just :: match a char
|
||||
|= daf=char
|
||||
~/ %fun
|
||||
|= tub=nail
|
||||
@ -1857,13 +1858,13 @@
|
||||
(fail tub)
|
||||
(next tub)
|
||||
::
|
||||
++ knee
|
||||
++ knee :: callbacks
|
||||
|* [gar=* sef=_|.(rule)]
|
||||
|= tub=nail
|
||||
^- (like ,_gar)
|
||||
((sef) tub)
|
||||
::
|
||||
++ mask
|
||||
++ mask :: match char in set
|
||||
~/ %mask
|
||||
|= bud=(list char)
|
||||
~/ %fun
|
||||
@ -1875,7 +1876,7 @@
|
||||
(fail tub)
|
||||
(next tub)
|
||||
::
|
||||
++ next
|
||||
++ next :: consume a char
|
||||
|= tub=nail
|
||||
^- (like char)
|
||||
?@ q.tub
|
||||
@ -1883,7 +1884,7 @@
|
||||
=+ zac=(lust i.q.tub p.tub)
|
||||
[zac [~ i.q.tub [zac t.q.tub]]]
|
||||
::
|
||||
++ sear
|
||||
++ sear :: conditional cook
|
||||
~/ %sear
|
||||
|* [pyq=_|=(* *(unit)) sef=_rule]
|
||||
~/ %fun
|
||||
@ -1896,7 +1897,7 @@
|
||||
[p=p.vex q=~]
|
||||
[p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
|
||||
::
|
||||
++ shim
|
||||
++ shim :: match char in range
|
||||
~/ %shim
|
||||
|= [les=@ mos=@]
|
||||
~/ %fun
|
||||
@ -1908,7 +1909,7 @@
|
||||
(fail tub)
|
||||
(next tub)
|
||||
::
|
||||
++ stag
|
||||
++ stag :: add a label
|
||||
~/ %stag
|
||||
|* [gob=* sef=_rule]
|
||||
~/ %fun
|
||||
@ -1982,7 +1983,7 @@
|
||||
?> ?=(^ q.wag)
|
||||
[(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
|
||||
::
|
||||
++ stun
|
||||
++ stun :: parse several times
|
||||
~/ %stun
|
||||
|* [[les=@ mos=@] fel=_rule]
|
||||
~/ %fun
|
||||
@ -2006,7 +2007,7 @@
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 2eD, parsing (combinators) ::
|
||||
::
|
||||
++ bend
|
||||
++ bend :: conditional comp
|
||||
~/ %bend
|
||||
|* raq=_|*([a=* b=*] [~ u=[a b]])
|
||||
~/ %fun
|
||||
@ -2024,7 +2025,7 @@
|
||||
::
|
||||
++ comp
|
||||
~/ %comp
|
||||
|* raq=_|*([a=* b=*] [a b])
|
||||
|* raq=_|*([a=* b=*] [a b]) :: arbitrary compose
|
||||
~/ %fun
|
||||
|* [vex=edge sab=_rule]
|
||||
?@ q.vex
|
||||
@ -2035,18 +2036,18 @@
|
||||
[p=yur q=q.yit]
|
||||
[p=yur q=[~ u=[p=(raq p.u.q.vex p.u.q.yit) q=q.u.q.yit]]]
|
||||
::
|
||||
++ glue
|
||||
++ glue :: add rule
|
||||
~/ %glue
|
||||
|* bus=_rule
|
||||
~/ %fun
|
||||
|* [vex=edge sab=_rule]
|
||||
(plug vex ;~(pfix bus sab))
|
||||
::
|
||||
++ pfix
|
||||
++ pfix :: discard first rule
|
||||
~/ %pfix
|
||||
(comp |*([a=* b=*] b))
|
||||
::
|
||||
++ plug
|
||||
++ plug :: first then second
|
||||
~/ %plug
|
||||
|* [vex=edge sab=_rule]
|
||||
?@ q.vex
|
||||
@ -2057,7 +2058,7 @@
|
||||
[p=yur q=q.yit]
|
||||
[p=yur q=[~ u=[p=[p.u.q.vex p.u.q.yit] q=q.u.q.yit]]]
|
||||
::
|
||||
++ pose
|
||||
++ pose :: first or second
|
||||
~/ %pose
|
||||
|* [vex=edge sab=_rule]
|
||||
?@ q.vex
|
||||
@ -2065,7 +2066,7 @@
|
||||
[p=(last p.vex p.roq) q=q.roq]
|
||||
vex
|
||||
::
|
||||
++ sfix
|
||||
++ sfix :: discard second rule
|
||||
~/ %sfix
|
||||
(comp |*([a=* b=*] a))
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
@ -2107,7 +2108,7 @@
|
||||
|* [bus=_rule fel=_rule]
|
||||
;~((comp raq) fel (stir rud raq ;~(pfix bus fel)))
|
||||
::
|
||||
++ star
|
||||
++ star :: 0 or more times
|
||||
|* fel=_rule
|
||||
(stir `(list ,_(wonk *fel))`~ |*([a=* b=*] [a b]) fel)
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
@ -2149,16 +2150,19 @@
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 2eG, parsing (whitespace) ::
|
||||
::
|
||||
++ dog ;~(plug dot gay)
|
||||
++ doh ;~(plug ;~(plug hep hep) gay)
|
||||
++ dun (cold ~ ;~(plug hep hep))
|
||||
++ duq (cold ~ ;~(plug tis hep))
|
||||
++ duz (cold ~ ;~(plug tis tis))
|
||||
++ gah (mask [`@`10 ' ' ~])
|
||||
++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah))))
|
||||
++ gaq ;~(pose (just `@`10) ;~(plug gah ;~(pose gah vul)) vul)
|
||||
++ gay ;~(pose gap (easy ~))
|
||||
++ vul %- cold :- ~
|
||||
++ dog ;~(plug dot gay) ::
|
||||
++ doh ;~(plug ;~(plug hep hep) gay) ::
|
||||
++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
|
||||
++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
|
||||
++ gah (mask [`@`10 ' ' ~]) :: newline or ace
|
||||
++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) ::
|
||||
++ gaq ;~ pose :: end of line
|
||||
(just `@`10)
|
||||
;~(plug gah ;~(pose gah vul))
|
||||
vul
|
||||
==
|
||||
++ gay ;~(pose gap (easy ~)) ::
|
||||
++ vul %- cold :- ~ :: comments
|
||||
;~ plug col col
|
||||
(star ;~(pose (shim 32 126) (shim 128 255)))
|
||||
(just `@`10)
|
||||
@ -2166,31 +2170,39 @@
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 2eH, parsing (idioms) ::
|
||||
::
|
||||
++ alf ;~(pose low hig)
|
||||
++ aln ;~(pose low hig nud)
|
||||
++ alp ;~(pose low hig nud hep)
|
||||
++ bet ;~(pose (cold 2 hep) (cold 3 lus))
|
||||
++ bin (bass 2 (most gon but))
|
||||
++ but (cook |=(a=@ (sub a '0')) (shim '0' '1'))
|
||||
++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7'))
|
||||
++ dem (bass 10 (most gon dit))
|
||||
++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9'))
|
||||
++ gul ;~(pose (cold 2 gal) (cold 3 gar))
|
||||
++ gon ;~(pose ;~(plug bas gay fas) (easy ~))
|
||||
++ hex (bass 16 (most gon hit))
|
||||
++ hig (shim 'A' 'Z')
|
||||
++ hit ;~ pose
|
||||
++ alf ;~(pose low hig) :: alphabetic
|
||||
++ aln ;~(pose low hig nud) :: alphanumeric
|
||||
++ alp ;~(pose low hig nud hep) :: alphanumeric and -
|
||||
++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
|
||||
++ bin (bass 2 (most gon but)) :: binary to atom
|
||||
++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
|
||||
++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
|
||||
++ dem (bass 10 (most gon dit)) :: decimal to atom
|
||||
++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
|
||||
++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
|
||||
++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
|
||||
++ hex (bass 16 (most gon hit)) :: hex to atom
|
||||
++ hig (shim 'A' 'Z') :: uppercase
|
||||
++ hit ;~ pose :: hex digits
|
||||
dit
|
||||
(cook |=(a=char (sub a 87)) (shim 'a' 'f'))
|
||||
(cook |=(a=char (sub a 55)) (shim 'A' 'F'))
|
||||
==
|
||||
++ low (shim 'a' 'z')
|
||||
++ mes (cook |=([a=@ b=@] (add (mul 16 a) b)) ;~(plug hit hit))
|
||||
++ nix (boss 256 (star ;~(pose aln cab)))
|
||||
++ nud (shim '0' '9')
|
||||
++ poy ;~(pfix bas ;~(pose bas soq mes))
|
||||
++ qit ;~(pose (shim 32 38) (shim 40 91) (shim 93 126) (shim 128 255) poy)
|
||||
++ qut (ifix [soq soq] (boss 256 (more gon qit)))
|
||||
++ low (shim 'a' 'z') :: lowercase
|
||||
++ mes %+ cook :: hexbyte
|
||||
|=([a=@ b=@] (add (mul 16 a) b))
|
||||
;~(plug hit hit)
|
||||
++ nix (boss 256 (star ;~(pose aln cab))) ::
|
||||
++ nud (shim '0' '9') :: numeric
|
||||
++ poy ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
|
||||
++ qit ;~ pose :: chars in a cord
|
||||
(shim 32 38)
|
||||
(shim 40 91)
|
||||
(shim 93 126)
|
||||
(shim 128 255)
|
||||
poy
|
||||
==
|
||||
++ qut (ifix [soq soq] (boss 256 (more gon qit))) :: cord
|
||||
++ sym
|
||||
%+ cook
|
||||
|=(a=tape (rap 3 ^-((list ,@) a)))
|
||||
@ -2208,7 +2220,7 @@
|
||||
?> ?=(^ q.wag)
|
||||
[p.wag [~ (peg p.u.q.vex p.u.q.wag) q.u.q.wag]]
|
||||
==
|
||||
++ vit
|
||||
++ vit :: base64 digit
|
||||
;~ pose
|
||||
(cook |=(a=@ (sub a 65)) (shim 'A' 'Z'))
|
||||
(cook |=(a=@ (sub a 71)) (shim 'a' 'z'))
|
||||
@ -2219,7 +2231,7 @@
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 2eI, parsing (external) ::
|
||||
::
|
||||
++ rash |*([naf=@ sab=_rule] (scan (trip naf) sab))
|
||||
++ rash |*([naf=@ sab=_rule] (scan (trip naf) sab)) ::
|
||||
++ rush |*([naf=@ sab=_rule] (rust (trip naf) sab))
|
||||
++ rust |* [los=tape sab=_rule]
|
||||
=+ vex=((full sab) [[1 1] los])
|
||||
@ -5156,7 +5168,7 @@
|
||||
%void
|
||||
[%face cog der]
|
||||
::
|
||||
++ bean ^-(type [%fork [%cube 0 %atom %f] [%cube 1 %atom %f]])
|
||||
++ bool ^-(type [%fork [%cube 0 %atom %f] [%cube 1 %atom %f]])
|
||||
++ flay
|
||||
~/ %flay
|
||||
|= pok=port
|
||||
@ -7023,9 +7035,9 @@
|
||||
[(nice %noun) [%2 q:$(gen p.gen, gol %noun) q:$(gen q.gen, gol %noun)]]
|
||||
::
|
||||
[%dtts *]
|
||||
[(nice bean) [%5 q:$(gen p.gen, gol %noun) q:$(gen q.gen, gol %noun)]]
|
||||
[(nice bool) [%5 q:$(gen p.gen, gol %noun) q:$(gen q.gen, gol %noun)]]
|
||||
::
|
||||
[%dtwt *] [(nice bean) [%3 q:$(gen p.gen, gol %noun)]]
|
||||
[%dtwt *] [(nice bool) [%3 q:$(gen p.gen, gol %noun)]]
|
||||
[%ktbr *] =+(vat=$(gen p.gen) [(wrap(sut p.vat) %iron) q.vat])
|
||||
[%ktls *]
|
||||
=+(hif=(nice (play p.gen)) [hif q:$(gen q.gen, gol hif)])
|
||||
@ -7058,7 +7070,7 @@
|
||||
$(gen r.gen, sut (busk p.gen q.gen))
|
||||
::
|
||||
[%wtcl *]
|
||||
=+ nor=$(gen p.gen, gol bean)
|
||||
=+ nor=$(gen p.gen, gol bool)
|
||||
=+ fex=(gain p.gen)
|
||||
=+ wux=(lose p.gen)
|
||||
=+ ^= duy
|
||||
@ -7070,7 +7082,7 @@
|
||||
[(fork p.hiq p.ran) (cond duy q.hiq q.ran)]
|
||||
::
|
||||
[%wtts *]
|
||||
:- (nice bean)
|
||||
:- (nice bool)
|
||||
%- fish(sut (play ~(bunt al p.gen)))
|
||||
(cove q:$(gen [%cnzz q.gen], gol %noun))
|
||||
::
|
||||
@ -7184,9 +7196,9 @@
|
||||
=+([$(gen p.gen, gol %noun) $(gen q.gen, gol %noun)] (both %noun))
|
||||
::
|
||||
[%dtts *]
|
||||
=+([$(gen p.gen, gol %noun) $(gen q.gen, gol %noun)] (both bean))
|
||||
=+([$(gen p.gen, gol %noun) $(gen q.gen, gol %noun)] (both bool))
|
||||
::
|
||||
[%dtwt *] =+($(gen p.gen, gol %noun) (both bean)) :: XX =|
|
||||
[%dtwt *] =+($(gen p.gen, gol %noun) (both bool)) :: XX =|
|
||||
[%ktbr *]
|
||||
=+(vat=$(gen p.gen) [(wrap(sut p.vat) %iron) (wrap(sut q.vat) %iron)])
|
||||
::
|
||||
@ -7218,7 +7230,7 @@
|
||||
==
|
||||
::
|
||||
[%wtcl *]
|
||||
=+ nor=$(gen p.gen, gol bean)
|
||||
=+ nor=$(gen p.gen, gol bool)
|
||||
=+ ^= hiq ^- [p=type q=type]
|
||||
=+ fex=[p=(gain p.gen) q=(gain(sut dox) p.gen)]
|
||||
?: =(%void p.fex)
|
||||
@ -7243,7 +7255,7 @@
|
||||
=+ pov=[p=(fish(sut p.waz) p.syx) q=(fish(sut q.waz) q.syx)]
|
||||
?. &(=(p.syx q.syx) =(p.pov q.pov))
|
||||
~|(%mull-bonk-a !!)
|
||||
(both bean)
|
||||
(both bool)
|
||||
::
|
||||
[%zpcb *] ~_((show %o p.gen) $(gen q.gen))
|
||||
[%zpcm *] [(nice (play p.gen)) (play(sut dox) p.gen)]
|
||||
@ -7536,11 +7548,11 @@
|
||||
$(mew t.mew, rag q:(tock p.i.mew ^$(gen q.i.mew) rag))
|
||||
[%dtkt *] %noun
|
||||
[%dtls *] [%atom %$]
|
||||
[%dtzy *] ?:(=(%f p.gen) ?>((lte q.gen 1) bean) [%atom p.gen])
|
||||
[%dtzy *] ?:(=(%f p.gen) ?>((lte q.gen 1) bool) [%atom p.gen])
|
||||
[%dtzz *] [%cube q.gen ?:(.?(q.gen) %noun [%atom p.gen])]
|
||||
[%dttr *] %noun
|
||||
[%dtts *] bean
|
||||
[%dtwt *] bean
|
||||
[%dtts *] bool
|
||||
[%dtwt *] bool
|
||||
[%ktbr *] (wrap(sut $(gen p.gen)) %iron)
|
||||
[%ktls *] $(gen p.gen)
|
||||
[%ktpm *] (wrap(sut $(gen p.gen)) %zinc)
|
||||
@ -8523,7 +8535,6 @@
|
||||
++ gunk ~+((glue muck))
|
||||
++ butt |*(zor=_rule ?:(tol ;~(sfix zor ;~(plug gap duz)) zor))
|
||||
++ ulva |*(zor=_rule ?.(tol fail ;~(sfix zor ;~(plug gap dun))))
|
||||
++ neck ;~(pose duz ;~(pfix ;~(plug duq gap) wisp))
|
||||
++ hank (most muck loaf)
|
||||
++ loaf ?:(tol tall wide)
|
||||
++ lobe ?:(tol howl toil)
|
||||
@ -8814,7 +8825,7 @@
|
||||
== ::
|
||||
++ desk ,@tas :: ship desk case spur
|
||||
++ cage ,[p=lode q=vase] :: structured data
|
||||
++ chop :: permissions
|
||||
++ cuff :: permissions
|
||||
$: p=(unit (set monk)) :: readers
|
||||
q=(set monk) :: authors
|
||||
== ::
|
||||
|
@ -348,7 +348,7 @@
|
||||
~|(%test-fail-seal !!)
|
||||
msg
|
||||
::
|
||||
++ hmac :: HMAC calculation
|
||||
++ hmac :: HMAC-SHA1
|
||||
|= [key=@ mes=@]
|
||||
=+ ip=(fil 2 64 0x36)
|
||||
=+ op=(fil 3 64 0x5c)
|
||||
@ -2007,7 +2007,7 @@
|
||||
raz=(map path race) :: statements inbound
|
||||
ryl=(map path rill) :: statements outbound
|
||||
== ::
|
||||
++ bean :: terminal control
|
||||
++ bein :: terminal control
|
||||
$: $: bul=@ud :: buffer length
|
||||
bus=@ud :: cursor in buffer
|
||||
but=(list ,@c) :: buffer text
|
||||
@ -2062,7 +2062,7 @@
|
||||
q=@ud :: depth
|
||||
r=(list (list ,@c)) :: kills
|
||||
== ::
|
||||
++ blur ,[p=@ud q=(unit bean) r=blot] :: columns, prompt
|
||||
++ blur ,[p=@ud q=(unit bein) r=blot] :: columns, prompt
|
||||
++ boar :: execution instance
|
||||
$% [%n p=(unit coal) q=claw r=lath] :: new/ready
|
||||
[%r p=(unit worm)] :: running/done
|
||||
@ -2128,7 +2128,6 @@
|
||||
[%helo p=path q=prod] :: trigger prompt
|
||||
[%hole p=lane q=@] :: packet failed
|
||||
[%hoop p=(unit)] :: namespace response
|
||||
[%hope p=path] :: namespace request
|
||||
[%info p=@p q=@tas r=nori] :: internal edit
|
||||
[%ingo p=@p q=@tas r=nori] :: internal noun edit
|
||||
[%init p=@p] :: report install
|
||||
@ -2149,7 +2148,7 @@
|
||||
[%logo p=@] :: logout
|
||||
[%loot p=@tas q=path] :: request directory
|
||||
[%make p=(unit ,@t) q=@ud r=@] :: wild license
|
||||
[%mean p=ship q=term r=chop s=vase] :: application event
|
||||
[%mean p=ship q=term r=cuff s=vase] :: application event
|
||||
[%meta p=vase] :: meta-card
|
||||
[%meat p=ship q=card] :: concrete app action
|
||||
[%mess p=hasp q=(disk)] :: urbit message
|
||||
@ -2168,7 +2167,7 @@
|
||||
[%rest ~] :: reset to factory
|
||||
[%save p=path q=@] :: write atomic file
|
||||
[%send p=lane q=@] :: transmit packet
|
||||
[%show p=hasp q=path r=(unit plan)] :: subscription
|
||||
[%show p=hasp q=(unit hope)] :: urbit subscribe
|
||||
[%sith p=@p q=@uw] :: imperial generator
|
||||
[%soft p=*] :: untyped card
|
||||
[%sync ~] :: reset soft state
|
||||
@ -2238,6 +2237,10 @@
|
||||
cum=(map ,@tas ,*) :: custom dirt
|
||||
== ::
|
||||
++ cult (map duct rave) :: subscriptions
|
||||
++ cuff :: permissions
|
||||
$: p=(unit (set monk)) :: readers
|
||||
q=(set monk) :: authors
|
||||
== ::
|
||||
++ deed ,[p=@ q=step] :: signature, stage
|
||||
++ dome :: project state
|
||||
$: ang=agon :: pedigree
|
||||
@ -2350,6 +2353,7 @@
|
||||
++ hiss ,[p=purl q=moth] :: outbound request
|
||||
++ hist ,[p=@ud q=(list ,@t)] :: depth texts
|
||||
++ hole ,@t :: session identity
|
||||
++ hope (pair ,? path) :: view/subscribe
|
||||
++ hook path :: request origin
|
||||
++ hoot ,[p=? q=? r=(unit ,@ud) s=host] :: secure/mapped/host
|
||||
++ hort ,[p=(unit ,@ud) q=host] :: http port/host
|
||||
@ -2544,6 +2548,7 @@
|
||||
++ rump ,[p=care q=case r=@tas s=path] :: relative path
|
||||
++ rung $: rus=(map desk rede) :: neighbor desks
|
||||
== ::
|
||||
++ sash (pair term (unit hope)) :: web subscribe
|
||||
++ saba ,[p=ship q=@tas r=moar s=(list nori)] :: patch/merge
|
||||
++ sufi :: domestic host
|
||||
$: hoy=(list ship) :: hierarchy
|
||||
@ -2561,7 +2566,11 @@
|
||||
pus=(unit ,@ta) :: password
|
||||
== ::
|
||||
++ seam :: logical request
|
||||
$% [%aps p=term q=term r=path] :: app; logo; path
|
||||
$% [%apg p=term q=logo r=path] :: app get
|
||||
[%apl p=term q=@ud r=term] :: app poll
|
||||
[%apm p=term q=json] :: app message
|
||||
[%aps p=term q=term r=(unit path)] :: app subscribe
|
||||
[%apu p=term q=logo r=octs] :: app upload
|
||||
[%cog p=@ud q=@ud] :: console get
|
||||
[%con p=@ud] :: console face
|
||||
[%cop p=@ud q=@ud r=json] :: console put
|
||||
|
@ -6,7 +6,7 @@
|
||||
=> +
|
||||
=> ^/===/lib/pony
|
||||
=> ^/===/lib/chat
|
||||
=+ flag=?(%elvis %quiet %time [%haus p=@p])
|
||||
=+ flag=?(%all %rooms %monitor %never %leet %nub %time [%haus p=@p])
|
||||
=+ flags=*(list flag)
|
||||
=> |%
|
||||
++ chk-flag |=(f=@tas (lien flags |=(flag =(f +<))))
|
||||
@ -75,10 +75,16 @@
|
||||
:- %leaf
|
||||
%+ welp
|
||||
?. (chk-flag %time) ~
|
||||
"{(scow %ud h.da)}:{(scow %ud m.da)} "
|
||||
(weld (timestamp sen) " ")
|
||||
"%{(trip roo)} {chr}{nym}: {(trip p.dum)}"
|
||||
==
|
||||
::
|
||||
++ timestamp
|
||||
|= t=@da
|
||||
=+ da=(yell t)
|
||||
"{?:((gth 10 h.da) "0" "")}{(scow %ud h.da)}:".
|
||||
"{?:((gth 10 m.da) "0" "")}{(scow %ud m.da)}"
|
||||
|
||||
++ read-wlist
|
||||
|= pax=path
|
||||
%- (unit (list))
|
||||
@ -104,8 +110,6 @@
|
||||
|= [est=time *]
|
||||
|= args=(list flag)
|
||||
=. flags `(list flag)`args
|
||||
?: &((chk-flag %elvis) (chk-flag %quiet))
|
||||
~| %invalid-parameters !!
|
||||
=+ sta=est :: move up to declaration of state
|
||||
=. wak est
|
||||
=. bud :: future maintainers: don't add more cell types with changing this
|
||||
@ -113,9 +117,14 @@
|
||||
(roll args |=([p=flag q=@p] ?:(?=(^ p) p.p q)))
|
||||
bud
|
||||
=. kills %- (list ,@p)
|
||||
(fall (read-wlist /[(scot %p who)]/conf/[(scot %da est)]/chat/killfile/wlist) ~)
|
||||
%+ fall
|
||||
(read-wlist /[(scot %p who)]/conf/[(scot %da est)]/chat/killfile/wlist)
|
||||
~
|
||||
=. rooms %- (list ^room)
|
||||
(fall (read-wlist /[(scot %p who)]/conf/[(scot %da est)]/chat/[(scot %p bud)]/wlist) ~[coci])
|
||||
%+ fall
|
||||
%- read-wlist
|
||||
/[(scot %p who)]/conf/[(scot %da est)]/chat/[(scot %p bud)]/wlist
|
||||
~[coci]
|
||||
|- ^- bowl
|
||||
=< abet:init
|
||||
|%
|
||||
@ -195,10 +204,17 @@
|
||||
==
|
||||
::
|
||||
++ priv :: private message
|
||||
|= [her=@p mes=^mess]
|
||||
|= [now=@da her=@p mes=^mess]
|
||||
^+ +>
|
||||
?: (dead her) +>
|
||||
(show (rend est '(private)' "" (trip (numb her est)) mes))
|
||||
=+ ^= nym
|
||||
=+ yow=(scot %p her)
|
||||
=+ ^= woy
|
||||
%- (hard ,@t)
|
||||
.^(%a (scot %p who) %name (scot %da now) (scot %p her) ~)
|
||||
?: =(%$ woy) yow
|
||||
(cat 3 yow (cat 3 ' ' woy))
|
||||
(show (rend est '(private)' "" (trip nym) mes))
|
||||
::
|
||||
++ said :: server message
|
||||
|= [her=@p duz=(list zong)]
|
||||
@ -234,14 +250,28 @@
|
||||
q
|
||||
==
|
||||
?(%new %out)
|
||||
?: ?| (dead p.r.i.duz)
|
||||
(chk-flag %quiet)
|
||||
&(!(chk-flag %elvis) (gth sta p.i.duz))
|
||||
==
|
||||
?. ?& !(dead p.r.i.duz)
|
||||
?| (chk-flag %all)
|
||||
?& (lth sta p.i.duz)
|
||||
?| (chk-flag %rooms)
|
||||
?& =(coci q.i.duz)
|
||||
(chk-flag %monitor)
|
||||
== == ==
|
||||
== ==
|
||||
~
|
||||
?- -.i.duz
|
||||
%new ~[[%leaf "{(trip q.r.i.duz)} saunters into %{(trip q.i.duz)}"]]
|
||||
%out ~[[%leaf "{(trip q.r.i.duz)} ducks out of %{(trip q.i.duz)}"]]
|
||||
:_ ~ :- %leaf
|
||||
;: weld
|
||||
?. (chk-flag %time) ~
|
||||
(timestamp p.i.duz)
|
||||
?- -.i.duz
|
||||
%new " +"
|
||||
%out " -"
|
||||
==
|
||||
?: (chk-flag %nub)
|
||||
(trip q.r.i.duz)
|
||||
(scow %p p.r.i.duz)
|
||||
?: (chk-flag %monitor) ~
|
||||
(weld " %" (trip q.i.duz))
|
||||
== ==
|
||||
==
|
||||
::
|
||||
@ -256,7 +286,9 @@
|
||||
giz
|
||||
=+ j=(jam (weld her (skip kills |=(a=@p (lien her |=(b=@p =(a b)))))))
|
||||
=+ encoded=(cat 3 (scot %uw j) `@t`10) :: Base-64 encoding
|
||||
[[%ok (foal /[(scot %p who)]/conf/[(scot %da est)]/chat/killfile/wlist encoded)] giz]
|
||||
:_ giz
|
||||
:- %ok
|
||||
(foal /[(scot %p who)]/conf/[(scot %da est)]/chat/killfile/wlist encoded)
|
||||
==
|
||||
::
|
||||
++ resurrect
|
||||
@ -266,7 +298,9 @@
|
||||
giz
|
||||
=+ j=(jam (skip kills |=(a=@p (lien her |=(b=@p =(a b))))))
|
||||
=+ encoded=(cat 3 (scot %uw j) `@t`10) :: Base-64 encoding
|
||||
[[%ok (foal /[(scot %p who)]/conf/[(scot %da est)]/chat/killfile/wlist encoded)] giz]
|
||||
:_ giz
|
||||
:- %ok
|
||||
(foal /[(scot %p who)]/conf/[(scot %da est)]/chat/killfile/wlist encoded)
|
||||
==
|
||||
::
|
||||
++ add-room
|
||||
@ -278,7 +312,10 @@
|
||||
giz
|
||||
=+ encoded=(cat 3 (scot %uw (jam rs)) `@t`10) :: Base-64 encoding
|
||||
:_ giz
|
||||
[%ok (foal /[(scot %p who)]/conf/[(scot %da est)]/chat/[(scot %p bud)]/wlist encoded)]
|
||||
:- %ok
|
||||
%+ foal
|
||||
/[(scot %p who)]/conf/[(scot %da est)]/chat/[(scot %p bud)]/wlist
|
||||
encoded
|
||||
==
|
||||
~
|
||||
`zing`[%lus roo]
|
||||
@ -293,7 +330,10 @@
|
||||
=+ j=(jam rs)
|
||||
=+ encoded=(cat 3 (scot %uw j) `@t`10) :: Base-64 encoding
|
||||
:_ giz
|
||||
[%ok (foal /[(scot %p who)]/conf/[(scot %da est)]/chat/[(scot %p bud)]/wlist encoded)]
|
||||
:- %ok
|
||||
%+ foal
|
||||
/[(scot %p who)]/conf/[(scot %da est)]/chat/[(scot %p bud)]/wlist
|
||||
encoded
|
||||
==
|
||||
~
|
||||
`zing`[%hep roo]
|
||||
@ -358,6 +398,6 @@
|
||||
(nice [~ (need (slaw %p i.t.pax))] p.nut)
|
||||
%up ?>(?=(%up -.nut) (toke p.nut))
|
||||
%wa ?>(?=(%wa -.nut) take)
|
||||
%ya ?>(?=(%lq -.nut) (priv p.nut ((hard ^mess) r.nut)))
|
||||
%ya ?>(?=(%lq -.nut) (priv now p.nut ((hard ^mess) r.nut)))
|
||||
==
|
||||
--
|
||||
|
@ -186,7 +186,7 @@
|
||||
:_ abet:pof(roo.ful oldroo)
|
||||
%- ~(gas by m)
|
||||
%+ turn
|
||||
(skip p.zig |=(a=room (levy roo.ful:pof |=(a=room =(a ^a)))))
|
||||
(skip p.zig |=(a=room (levy roo.ful:pof |=(a=room !=(a ^a)))))
|
||||
|=(r=room [r ~[[%out now r call:pof]]])
|
||||
==
|
||||
(tilt zew)
|
||||
|
@ -6,6 +6,6 @@
|
||||
|= [bud=@p ~]
|
||||
^- bowl
|
||||
:_ ~
|
||||
:~ [%la ((hard tank) .^(%c /(scot %p bud)/show=))]
|
||||
[%la ((hard tank) .^(%a /(scot %p bud)/show=))]
|
||||
:~ :: [%la ((hard tank) .^(%c /(scot %p bud)/show=))]
|
||||
[%la ((hard tank) .^(%a /(scot %p who)/show=/(scot %p bud)))]
|
||||
==
|
||||
|
Loading…
Reference in New Issue
Block a user