This commit is contained in:
C. Guy Yarvin 2015-02-06 14:49:22 -08:00
commit fb05c0f38b
8 changed files with 241 additions and 41 deletions

View File

@ -440,7 +440,7 @@
vix=(bex +((cut 0 [25 2] mag))) :: width of sender
tay=(cut 0 [27 5] mag) :: message type
==
?> =(1 vez)
?> =(2 vez)
?> =(chk (end 0 20 (mug bod)))
:+ [(end 3 wix bod) (cut 3 [wix vix] bod)]
(kins tay)
@ -460,7 +460,7 @@
=+ tay=(ksin q.kec)
%+ mix
%+ can 0
:~ [3 1]
:~ [3 2]
[20 (mug bod)]
[2 yax]
[2 qax]
@ -1043,7 +1043,7 @@
++ gnaw :: gnaw:am
|= [kay=cape ryn=lane pac=rock] :: process packet
^- [p=(list boon) q=fort]
?. =(1 (end 0 3 pac)) [~ fox]
?. =(2 (end 0 3 pac)) [~ fox]
=+ kec=(bite pac)
?: (goop p.p.kec) [~ fox]
?. (~(has by urb.ton.fox) q.p.kec)

View File

@ -37,7 +37,7 @@
[%dub p=term q=horn] :: /= apply face
[%fan p=(list horn)] :: /. list
[%for p=path q=horn] :: /, descend
[%hel p=horn] :: /% propogate heel
[%hel p=@ud q=horn] :: /% propogate heel
[%hub p=horn] :: /@ list by @ud
[%man p=(map span horn)] :: /* hetero map
[%nap p=horn] :: /_ homo map
@ -519,7 +519,7 @@
(stag %dub ;~(pfix tis dub:read))
(stag %fan ;~(pfix dot fan:read))
(stag %for ;~(pfix com for:read))
(stag %hel ;~(pfix cen day:read))
(stag %hel ;~(pfix cen hel:read))
(stag %hub ;~(pfix pat day:read))
(stag %man ;~(pfix tar man:read))
(stag %nap ;~(pfix cab day:read))
@ -559,6 +559,11 @@
%+ 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
@ -1049,7 +1054,7 @@
|- ^- vase
?~ doy [[%cube 0 [%atom %n]] 0]
%+ slop
(slop [[%atom %a] p.n.doy] q.n.doy)
(slop [[%atom %ta] p.n.doy] q.n.doy)
(slop $(doy l.doy) $(doy r.doy))
::
++ chap :: produce resources
@ -1084,7 +1089,12 @@
(slop i.tev $(tev t.tev))
::
%for $(hon q.hon, s.how (weld (flop p.hon) s.how))
%hel $(hon p.hon, arg /, s.how (weld arg s.how))
%hel
%= $
hon q.hon
arg (scag p.hon arg)
s.how (weld (slag p.hon arg) s.how)
==
%hub (chad cof bax %ud p.hon)
%man
|- ^- (bolt vase)

View File

@ -139,19 +139,20 @@
?: =(0 txt) [~ +>.$]
=+ rey=(rush txt chat(lat lat.hid))
?~ rey
[(send /out %give %rush %tang [%leaf "invalid input"] ~) +>.$]
[(print %leaf "invalid input") +>.$]
|-
?- -.u.rey
%all =+ ^= mof
?~ pom ~
(send /out %give %rush %prompt '& ' %text '')
(send /out %rush %prompt '& ' %text '')
=^ mow +>.^$
(poke-zung(pom ~) ost our.hid %mess sat.fal p.u.rey)
[(welp mof mow) +>.^$(sen (~(put in sen) p.u.rey))]
%back
:_ +>.^$
%^ send /out %give :+ %rush %tang
%+ send /out :+ %rush %tang
%- turn :_ |=(a=zong (zong-to-tank | a))
%- flop
?- p.u.rey
%ud (scag q.u.rey msg:(grab sat.fal))
%da (since msg:(grab sat.fal) q.u.rey)
@ -164,19 +165,17 @@
%mess [p.u.rey %chat ~] our.hid %mess !>(q.u.rey)
==
?: =(pom [~ p.u.rey]) ~
(send /out %give %rush %prompt (cat 3 (scot %p p.u.rey) ' ') %text '')
(send /out %rush %prompt (cat 3 (scot %p p.u.rey) ' ') %text '')
%who
:_ +>.^$
%^ send /out %give :+ %rush %tang :_ ~
:+ %rose [", " "" ""]
%^ print %rose [", " "" ""]
%+ turn (~(tap by ami:(grab sat.fal)))
|= a=idad
:- %leaf
%- trip %^ cat 3 %^ cat 3 (scot %p p.a) ' ' q.a
%how
:_ +>.^$
%^ send /out %give :+ %rush %tang
%- flop
%+ send /out :+ %rush %tang
%- turn :_ |=(a=@t [%leaf (trip a)])
%- lore
%- (hard ,@t)
@ -219,7 +218,8 @@
;head
;title: Radio
;script(type "text/javascript", src "//use.typekit.net/fkv0sjk.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs".
"/jquery/2.1.1/jquery.min.js");
;script:'try{Typekit.load();}catch(e){}'
;link(rel "stylesheet", type "text/css", href "/gen/main/pub/src/chat/main.css");
==
@ -239,7 +239,7 @@
%+ welp
:+ [ost %pass /cmd-in %g %show [our.hid +.imp.hid] you /in/[-.imp.hid]]
[ost %pass /private %g %show [our.hid /chat] you /private]
(send /out %give %rush %prompt '& ' %text '')
(send /out %rush %prompt '& ' %text '')
mow
::
++ poke-mess
@ -292,8 +292,8 @@
==
[~ +>.$]
::
++ pass-took
|= [moz=(list move) ost=bone pax=path imp=path]
++ took
|= [ost=bone pax=path imp=path moz=(list move)]
:_ +>.$
:_(moz [ost %pass pax %g %took [our.hid imp] our.hid])
::
@ -302,18 +302,17 @@
^- [(list move) _+>]
:: ~& sih=sih
=+ sih=((hard sign) sih)
=+ took=|=([imp=path moz=(list move)] (pass-took moz ost pax imp))
?~ pax ~& %chat-pour-strange-path !!
:: ~& [%pour-mess pax]
?+ i.pax ~& %chat-pour-strange-path !!
%cmd-in
?- +<.sih
%nice [~ +>.$]
%mean [(send /out %give +.sih) +>.$]
%mean [(send /out +.sih) +>.$]
?(%rush %rust)
?> ?=(%txt -.p.sih)
=^ moz +>.$ (exec-cmd ost p.p.sih)
(took +.imp.hid moz)
(took ost pax +.imp.hid moz)
==
::
?(%mesg %priv)
@ -325,7 +324,7 @@
[~ +>.$]
?> ?=(%rush +<.sih)
?> ?=(%zong -.p.sih)
(took /chat (send /out %give %rush %tang (zong-to-tank & p.p.sih) ~))
(took ost pax /chat (print (zong-to-tank & p.p.sih)))
::
?(%radi-a %radi-m)
?: ?=(%nice +<.sih)
@ -369,8 +368,8 @@
==
=+ ^= pout ?:(=(i.pax %radi-a) %amigos %mensajes)
=. air (~(put by air) t.pax ya)
=+ mow=(send [pout t.pax] %give +.sih)
=< (took /radio mow)
=+ mow=(send [pout t.pax] +.sih)
=< (took ost pax /radio mow)
:: =< [mow +>.$]
:: XX yes, I just used an inline comment
:: XX and multiple XX's. why? because
@ -378,35 +377,34 @@
^+ .
?: =(%zong -.p.sih)
=+ zog=((hard zong) p.p.sih)
?: &(=(our.hid q.zog) (~(has in sen) r.zog))
+
:: ?: &(=(our.hid q.zog) (~(has in sen) r.zog))
:: + :: suppress own messages
:: ?: &(=(our.hid q.zog) =(`r.zog ~(top to sen)))
:: %_(+ sen ^+(sen ~(nap to sen)))
%_ +
mow
(welp mow (send /out %give %rush %tang (zong-to-tank | zog) ~))
(welp mow (print (zong-to-tank | zog)))
==
?: =(%zongs -.p.sih)
=+ zos=(scag 200 ((hard (list zong)) p.p.sih))
=< +(mow (flop mow))
|- ^+ +.$
?: =(~ zos) +.$ :: XX tm freakin i
|- ^+ +>.$
?: =(~ zos) +>.$ :: XX tm freakin i
=+ zoy=((hard zong) -.zos)
=. +.$ $(zos +.zos)
=. +>.$ $(zos +.zos)
?: &(=(our.hid &3.zoy) (~(has in sen) &4.zoy))
+.$
+>.$
:: ?: &(=(our.hid &3.zoy) =(`&4.zoy ~(top to sen)))
:: %_(+.$ sen `(qeu mess)`~(nap to sen))
%_ +.$
:: %_(+>.$ sen `(qeu mess)`~(nap to sen))
%_ +>.$
mow
(welp mow (send /out %give %rush %tang (zong-to-tank | zoy) ~))
(welp mow (print (zong-to-tank | zoy)))
==
?: =(%user -.p.sih)
=+ use=((hard user) p.p.sih)
%_ +
mow
?: let.fal ~
=- (send /out %give %rush %tang [%leaf -] ~)
%+ print %leaf
%+ weld
?: eth.fal "" (timestamp lat.hid)
%+ weld "{(iden p.p.use)} "
@ -434,12 +432,13 @@
[%tower *] b(|4 p.a)
==
::
++ print |=(a=tank (send /out %rush %tang [a]~))
++ send
|= [pax=path msg=(mold note gift)]
|= [pax=path msg=gift]
^- (list move)
:: ~& [%send pus.hid]
%+ turn (~(tap in (~(get ju pus.hid) pax)))
|=(ost=bone [ost msg])
|=(ost=bone [ost %give msg])
::
++ since
|= [ya=msg=(list zong) tim=@da]
@ -451,9 +450,9 @@
|= [pri=? zog=zong]
^- (list move)
%+ welp
(send /private %give %rush %zong zog)
(send /private %rush %zong zog)
%+ welp
(send /out %give %rush %tang (zong-to-tank pri zog) ~)
(print (zong-to-tank pri zog))
%+ murn (~(tap by sup.hid))
|= [ost=bone her=ship pax=path]
?~ pax ~

View File

@ -38,5 +38,6 @@
;div
;* (sing don)
==
:: ++ react psal
--
--

View File

@ -10,6 +10,7 @@
++ html (crip (poxo hymn)) :: convert to %html
++ mime [/text/html (taco html)] :: convert to %mime
--
++ garb [%react %snip ~]
++ grab |% :: convert from
++ noun manx :: clam from %noun
-- --

View File

@ -0,0 +1,62 @@
::
:::: /hoon/core/react-snip/mar
::
/? 314
/= react-elems
/; sa /~
:~ %a %abbr %address %area %article %aside %audio %b %base
%bdi %bdo %big %blockquote %body %br %button %canvas %caption
%cite %code %col %colgroup %data %datalist %dd %del %details
%dfn %dialog %div %dl %dt %em %embed %fieldset %figcaption
%figure %footer %form %h1 %h2 %h3 %h4 %h5 %h6 %head %header
%hr %html %i %iframe %img %input %ins %kbd %keygen %label
%legend %li %link %main %map %mark %menu %menuitem %meta
%meter %nav %noscript %object %ol %optgroup %option %output %p
%param %picture %pre %progress %q %rp %rt %ruby %s %samp
%script %section %select %small %source %span %strong %style
%sub %summary %sup %table %tbody %td %textarea %tfoot %th
%thead %time %title %tr %track %u %ul %var %video %wbr
%circle %defs %ellipse %g %line %linear-gradient %mask %path
%pattern %polygon %polyline %radial-gradient %rect %stop %svg
%text %tspan
==
!:
::::
::
|_ own=manx
::
++ vale ~(has in react-elems)
++ grow :: convert to
|%
++ tape
;: weld
"React.createElement("
=* tan n.g.own
?^ tan !! :: namespaces unsupported
?: (vale tan)
"'{(trip tan)}'"
(trip tan)
::
", "
=- (pojo (jobe (turn a.g.own -)))
|= [a=mane b=^tape]
=. a ?+(a a %class 'className')
?^(a !! [a (jape b)])
", "
::
=- ~(ram re %rose [", " "[" "]"] (turn c.own -))
|= a=manx
?: ?=(_:/(**) a)
leaf/(pojo (jape v.i.a.g.a))
leaf/tape(own a)
::
")"
==
++ react-snip-js (crip tape)
++ js react-snip-js :: convert to %js
++ mime [/text/javascript (taco js)] :: convert to %mime
--
++ grab |% :: convert from
++ noun manx :: clam from %noun
++ snip |= a=manx a
-- --

62
main/mar/react/door.hook Normal file
View File

@ -0,0 +1,62 @@
::
:::: /hoon/core/react/mar
::
/? 314
/= react-elems
/; sa /~
:~ %a %abbr %address %area %article %aside %audio %b %base
%bdi %bdo %big %blockquote %body %br %button %canvas %caption
%cite %code %col %colgroup %data %datalist %dd %del %details
%dfn %dialog %div %dl %dt %em %embed %fieldset %figcaption
%figure %footer %form %h1 %h2 %h3 %h4 %h5 %h6 %head %header
%hr %html %i %iframe %img %input %ins %kbd %keygen %label
%legend %li %link %main %map %mark %menu %menuitem %meta
%meter %nav %noscript %object %ol %optgroup %option %output %p
%param %picture %pre %progress %q %rp %rt %ruby %s %samp
%script %section %select %small %source %span %strong %style
%sub %summary %sup %table %tbody %td %textarea %tfoot %th
%thead %time %title %tr %track %u %ul %var %video %wbr
%circle %defs %ellipse %g %line %linear-gradient %mask %path
%pattern %polygon %polyline %radial-gradient %rect %stop %svg
%text %tspan
==
!:
::::
::
|_ own=manx
::
++ vale ~(has in react-elems)
++ grow :: convert to
|%
++ tape
;: weld
"React.createElement("
=* tan n.g.own
?^ tan !! :: namespaces unsupported
?: (vale tan)
"'{(trip tan)}'"
(trip tan)
::
", "
=- (pojo (jobe (turn a.g.own -)))
|= [a=mane b=^tape]
=. a ?+(a a %class 'className')
?^(a !! [a (jape b)])
", "
::
=- ~(ram re %rose [", " "[" "]"] (turn c.own -))
|= a=manx
?: ?=(_:/(**) a)
leaf/(pojo (jape v.i.a.g.a))
leaf/tape(own a)
::
")"
==
++ react-js (crip tape)
++ js react-js :: convert to %js
++ mime [/text/javascript (taco js)] :: convert to %mime
--
++ grab |% :: convert from
++ noun manx :: clam from %noun
++ psal |= a=manx a
-- --

65
main/mar/snip/door.hook Normal file
View File

@ -0,0 +1,65 @@
::
:::: /hoon/core/psal/mar
::
/? 314
!:
|%
++ words 10
++ hedtal
|= a=marl ^- [hed=tape tal=marl]
?~ a [~ ~]
?. ?=(%h1 n.g.i.a)
=+ had=$(a c.i.a)
?^ -.had had
$(a t.a)
[(extract c.i.a) (limit words t.a)]
::
++ extract
|= a=marl ^- tape
?~ a ~
%- weld :_ $(a t.a)
?. ?=(_:/(**) i.a)
$(a c.i.a)
v.i.a.g.i.a
::
++ limit
|= [lim=@u mal=marl]
=< res
|- ^- [rem=@u res=marl]
?~ mal [lim ~]
?~ lim [0 ~]
=+ ^- [lam=@u hed=manx]
?: ?=(_:/(**) i.mal)
[lim :/(tay)]:(deword lim v.i.a.g.i.mal)
[rem ele(c res)]:[ele=i.mal $(mal c.i.mal)]
[rem - res]:[hed $(lim lam, mal t.mal)]
::
++ deword
|= [lim=@u tay=tape] ^- [lim=@u tay=tape]
?~ tay [lim tay]
?~ lim [0 ~]
=+ wer=((plus alp) 1^1 tay)
?~ q.wer
[lim - tay]:[i.tay $(tay t.tay)]
=+ nex=$(lim (dec lim), tay q.q.u.q.wer)
[-.nex (welp (wonk wer) +.nex)]
--
::
!:
|_ own=manx
::
++ grow :: convert to
|%
++ psal own
++ hymn ;html:(head:title:"snip" body:"+{psal}") :: convert to %hymn
++ html (crip (poxo hymn)) :: convert to %html
++ mime [/text/html (taco html)] :: convert to %mime
--
++ garb [%react-snip ~]
++ grab |% :: convert from
++ noun manx :: clam from %noun
++ psal
|= a=manx
=+ (hedtal +.a)
;div:(h1:"{hed}" div:"*{tal}")
-- --