mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 20:02:51 +03:00
Shell console.
This commit is contained in:
parent
4b26bd27d5
commit
b3a5c41491
@ -1149,11 +1149,6 @@
|
|||||||
|% :: poke/peek pattern
|
|% :: poke/peek pattern
|
||||||
++ beat :: process move
|
++ beat :: process move
|
||||||
|= [wru=(unit writ) tea=wire hen=duct fav=curd]
|
|= [wru=(unit writ) tea=wire hen=duct fav=curd]
|
||||||
=+ vaf=(card fav)
|
|
||||||
?. =(vaf fav)
|
|
||||||
~& [%fav fav]
|
|
||||||
~& [%vaf vaf]
|
|
||||||
!!
|
|
||||||
=> .(fav ((hard card) fav))
|
=> .(fav ((hard card) fav))
|
||||||
^- [p=(list move) q=vane]
|
^- [p=(list move) q=vane]
|
||||||
?: ?=([%crud *] fav)
|
?: ?=([%crud *] fav)
|
||||||
@ -1193,11 +1188,16 @@
|
|||||||
wam (weld p.yub wam)
|
wam (weld p.yub wam)
|
||||||
dez.^^$ (~(put by dez.^^$) p.i.fiy [[q.i.fiy +.q.yub] +.dos])
|
dez.^^$ (~(put by dez.^^$) p.i.fiy [[q.i.fiy +.q.yub] +.dos])
|
||||||
==
|
==
|
||||||
|
|- ^- [p=(list move) q=vane]
|
||||||
=+ dus=(~(get by dez) hen)
|
=+ dus=(~(get by dez) hen)
|
||||||
?~ dus
|
?~ dus
|
||||||
?+ -.fav
|
?+ -.fav
|
||||||
~& [%beat-none -.fav tea hen]
|
~& [%beat-none -.fav tea hen]
|
||||||
~|([%beat-none -.fav] !!)
|
~|([%beat-none -.fav] !!)
|
||||||
|
::
|
||||||
|
%hail
|
||||||
|
?~ wru !!
|
||||||
|
$(dez (~(put by dez) hen [[q.u.wru (bard q.u.wru)] ~]))
|
||||||
::
|
::
|
||||||
%init
|
%init
|
||||||
=+ bos=(sein p.fav)
|
=+ bos=(sein p.fav)
|
||||||
@ -1207,10 +1207,10 @@
|
|||||||
?: =(bos p.fav) ~
|
?: =(bos p.fav) ~
|
||||||
:_ ~
|
:_ ~
|
||||||
[wru [/b hen] [%line (rap 3 ":{(scow %p bos)}/main=/bin/update")]]
|
[wru [/b hen] [%line (rap 3 ":{(scow %p bos)}/main=/bin/update")]]
|
||||||
..^$(dez (~(put by dez) hen [[q.u.wru (bard q.u.wru)] ~]))
|
..^^$(dez (~(put by dez) hen [[q.u.wru (bard q.u.wru)] ~]))
|
||||||
::
|
::
|
||||||
?(%loin %make %sith)
|
?(%loin %make %sith)
|
||||||
[[[wru [/a [%b tea] hen] fav] ~] ..^$]
|
[[[wru [/a [%b tea] hen] fav] ~] ..^^$]
|
||||||
==
|
==
|
||||||
?> ?=(^ u.dus)
|
?> ?=(^ u.dus)
|
||||||
?+ -.fav
|
?+ -.fav
|
||||||
@ -1220,11 +1220,11 @@
|
|||||||
?~ wru
|
?~ wru
|
||||||
=+ ade=(adit hen)
|
=+ ade=(adit hen)
|
||||||
=+ hem=`helm`?-(ade %lead [%lead p.i.u.dus], %iron %iron, %gold %gold)
|
=+ hem=`helm`?-(ade %lead [%lead p.i.u.dus], %iron %iron, %gold %gold)
|
||||||
[[[[~ hem p.i.u.dus] [[%b tea] hen] fav] ~] ..^$]
|
[[[[~ hem p.i.u.dus] [[%b tea] hen] fav] ~] ..^^$]
|
||||||
=+ beg=`brat`[[p.i.u.dus bred] q.i.u.dus]
|
=+ beg=`brat`[[p.i.u.dus bred] q.i.u.dus]
|
||||||
=+ yub=(leap:((be beg) now eny sky) tea hen fav)
|
=+ yub=(leap:((be beg) now eny sky) tea hen fav)
|
||||||
:- p.yub
|
:- p.yub
|
||||||
..^$(dez (~(put by dez) hen [[p.i.u.dus +.q.yub] t.u.dus]))
|
..^^$(dez (~(put by dez) hen [[p.i.u.dus +.q.yub] t.u.dus]))
|
||||||
::
|
::
|
||||||
%init
|
%init
|
||||||
=+ bos=(sein p.fav)
|
=+ bos=(sein p.fav)
|
||||||
@ -1236,7 +1236,7 @@
|
|||||||
:_ ~
|
:_ ~
|
||||||
[wru [/b hen] [%line (rap 3 ":{(scow %p bos)}/main=/bin/update")]]
|
[wru [/b hen] [%line (rap 3 ":{(scow %p bos)}/main=/bin/update")]]
|
||||||
==
|
==
|
||||||
..^$(dez (~(put by dez) hen [[q.u.wru (bard q.u.wru)] u.dus]))
|
..^^$(dez (~(put by dez) hen [[q.u.wru (bard q.u.wru)] u.dus]))
|
||||||
::
|
::
|
||||||
%limn
|
%limn
|
||||||
$(fav [%hail ~], dez (~(put by dez) hen (weld t.u.dus `brim`[i.u.dus ~])))
|
$(fav [%hail ~], dez (~(put by dez) hen (weld t.u.dus `brim`[i.u.dus ~])))
|
||||||
|
102
arvo/eyre.hoon
102
arvo/eyre.hoon
@ -246,6 +246,12 @@
|
|||||||
+.$
|
+.$
|
||||||
?> ?=(^ wru)
|
?> ?=(^ wru)
|
||||||
(gout q.u.wru i.t.tea (need (slaw %ud i.t.t.tea)) p.fav)
|
(gout q.u.wru i.t.tea (need (slaw %ud i.t.t.tea)) p.fav)
|
||||||
|
::
|
||||||
|
?(%helo %tell %text %talk %warn)
|
||||||
|
?. ?=([%cons @ @ ~] tea)
|
||||||
|
+.$
|
||||||
|
?> ?=(^ wru)
|
||||||
|
(goat q.u.wru i.t.tea (need (slaw %ud i.t.t.tea)) fav)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ doss :: host to ship
|
++ doss :: host to ship
|
||||||
@ -264,6 +270,14 @@
|
|||||||
^- httr
|
^- httr
|
||||||
[sas ~[content-type/'text/plain'] [~ (tact str)]]
|
[sas ~[content-type/'text/plain'] [~ (tact str)]]
|
||||||
::
|
::
|
||||||
|
++ goat
|
||||||
|
|= [our=ship ses=hole num=@ud fav=card]
|
||||||
|
=+ suf=(~(get by own) our)
|
||||||
|
?~ suf +>.$
|
||||||
|
=+ cuz=(~(get by wup.u.suf) ses)
|
||||||
|
?~ cuz +>.$
|
||||||
|
abet:work:(~(dodo ya [our ses] u.suf u.cuz) num fav)
|
||||||
|
::
|
||||||
++ gosh :: receive %pr response
|
++ gosh :: receive %pr response
|
||||||
|= [him=ship num=@ud har=httr]
|
|= [him=ship num=@ud har=httr]
|
||||||
^+ +>
|
^+ +>
|
||||||
@ -558,7 +572,7 @@
|
|||||||
=. cow (~(put by cow) con cal)
|
=. cow (~(put by cow) con cal)
|
||||||
?~(yov +>.$ (dove ~[%a (jone ono.cal) (jone ino.cal) jon] yov))
|
?~(yov +>.$ (dove ~[%a (jone ono.cal) (jone ino.cal) jon] yov))
|
||||||
::
|
::
|
||||||
++ dove :: console waiters
|
++ dove :: console waiting
|
||||||
|= [jon=json yov=(list ,@ud)]
|
|= [jon=json yov=(list ,@ud)]
|
||||||
^+ +>
|
^+ +>
|
||||||
=+ noz=`pest`[%fin %mid /text/json (tact (pojo jon))]
|
=+ noz=`pest`[%fin %mid /text/json (tact (pojo jon))]
|
||||||
@ -591,12 +605,10 @@
|
|||||||
?. &(?=(^ fee) ?=(^ fum)) ~
|
?. &(?=(^ fee) ?=(^ fum)) ~
|
||||||
?: |(?=(~ muh) ?=(~ r.u.muh))
|
?: |(?=(~ muh) ?=(~ r.u.muh))
|
||||||
[~ %cog u.fee u.fum]
|
[~ %cog u.fee u.fum]
|
||||||
?. =([~ 'text/json'] (~(get by q.u.muh) 'content-type'))
|
?. =([~ 'text/json' ~] (~(get by q.u.muh) 'content-type'))
|
||||||
~& %flub-type
|
|
||||||
~
|
~
|
||||||
=+ jun=`(unit json)`(rush q.u.r.u.muh apex:poja)
|
=+ jun=`(unit json)`(rush q.u.r.u.muh apex:poja)
|
||||||
?~ jun
|
?~ jun
|
||||||
~& %flub-json
|
|
||||||
~
|
~
|
||||||
[~ %cop u.fee u.fum u.jun]
|
[~ %cop u.fee u.fum u.jun]
|
||||||
::
|
::
|
||||||
@ -1075,7 +1087,12 @@
|
|||||||
%con
|
%con
|
||||||
:_ +>.$
|
:_ +>.$
|
||||||
=+ cal==+(cal=(~(get by cow) p.som.pip) ?^(cal u.cal *coal))
|
=+ cal==+(cal=(~(get by cow) p.som.pip) ?^(cal u.cal *coal))
|
||||||
=+ obj=(jobe ~[sent/(jone ino.cal) recv/(jone ono.cal)])
|
=+ ^= obj
|
||||||
|
%- jobe
|
||||||
|
:~ sent/(jone ino.cal)
|
||||||
|
recv/(jone ono.cal)
|
||||||
|
ownr/[%s (rsh 3 1 (scot %p our))]
|
||||||
|
==
|
||||||
=+ sez=:/("seq={(pojo obj)}")
|
=+ sez=:/("seq={(pojo obj)}")
|
||||||
=+ jqu="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
|
=+ jqu="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
|
||||||
=+ ^= sac
|
=+ ^= sac
|
||||||
@ -1095,9 +1112,10 @@
|
|||||||
; }
|
; }
|
||||||
; console.log('sending')
|
; console.log('sending')
|
||||||
; console.log(com)
|
; console.log(com)
|
||||||
; $.ajax('/toc/0/'+seq.sent, {
|
; $.ajax('/'+seq.ownr+'/toc/0/'+seq.sent, {
|
||||||
; type: 'PUT',
|
; type: 'PUT',
|
||||||
; data: com,
|
; contentType: 'text/json',
|
||||||
|
; data: JSON.stringify(com),
|
||||||
; success: function(data,status,xhr) {
|
; success: function(data,status,xhr) {
|
||||||
; seq.sent++
|
; seq.sent++
|
||||||
; },
|
; },
|
||||||
@ -1110,14 +1128,17 @@
|
|||||||
; }
|
; }
|
||||||
;
|
;
|
||||||
; recv = function() {
|
; recv = function() {
|
||||||
; $.ajax('/goc/0/'+(seq.recv+1), {
|
; $.ajax('/'+seq.ownr+'/goc/0/'+seq.recv, {
|
||||||
; type:'GET',
|
; type:'GET',
|
||||||
; success: function(data,status,xhr) {
|
; success: function(data,status,xhr) {
|
||||||
; if(data.lines !== undefined)
|
; console.log(data);
|
||||||
; addLines(data.lines)
|
; seq.recv = data[0];
|
||||||
; if(data.helo !== undefined)
|
; seq.send = data[1];
|
||||||
; changePrompt(data.helo)
|
; msg = data[2];
|
||||||
; seq.recv++
|
; if(msg.text !== undefined)
|
||||||
|
; addLines(msg.text)
|
||||||
|
; if(msg.helo !== undefined)
|
||||||
|
; changePrompt(msg.helo)
|
||||||
; recv()
|
; recv()
|
||||||
; },
|
; },
|
||||||
; error: function(data,status,xhr) {
|
; error: function(data,status,xhr) {
|
||||||
@ -1136,7 +1157,7 @@
|
|||||||
; }
|
; }
|
||||||
;
|
;
|
||||||
; changePrompt = function(helo) {
|
; changePrompt = function(helo) {
|
||||||
; $prompt.text(helo[1].q)
|
; $prompt.text(helo.prod[1]);
|
||||||
; }
|
; }
|
||||||
;
|
;
|
||||||
; ctrl = false
|
; ctrl = false
|
||||||
@ -1171,20 +1192,57 @@
|
|||||||
=+ ^= ham
|
=+ ^= ham
|
||||||
;html
|
;html
|
||||||
;head
|
;head
|
||||||
;title: Dogs fucked the Pope!
|
;title: urbit {<our>}/{<p.som.pip>}
|
||||||
;script(type "text/javascript", src jqu);
|
;script(type "text/javascript", src jqu);
|
||||||
|
;style
|
||||||
|
; body {
|
||||||
|
; margin: 60px 120px;
|
||||||
|
; font: normal 12px "Menlo" monospace;
|
||||||
|
; background-color: #000;
|
||||||
|
; color: #fff;
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; #output {
|
||||||
|
;
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; #input .prompt {
|
||||||
|
; display: inline-block;
|
||||||
|
; margin-right: 12px;
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; #input .line {
|
||||||
|
; outline: none;
|
||||||
|
; width: 80%;
|
||||||
|
; border: 0;
|
||||||
|
; background-color: transparent;
|
||||||
|
; color: #fff;
|
||||||
|
; font: normal 12px "Menlo" monospace;
|
||||||
|
; }
|
||||||
|
==
|
||||||
==
|
==
|
||||||
;body
|
;body
|
||||||
|
;div@output;
|
||||||
|
;div@input
|
||||||
|
;div/prompt;
|
||||||
|
;input/line(type "text");
|
||||||
|
==
|
||||||
;+ [-.sac `marl`[sez +.sac]]
|
;+ [-.sac `marl`[sez +.sac]]
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
[~ pip(pez [%fin %ham ham])]
|
[~ pip(pez [%fin %ham ham])]
|
||||||
::
|
::
|
||||||
%cog
|
%cog
|
||||||
:_ +>.$
|
|
||||||
=+ cal==+(cal=(~(get by cow) p.som.pip) ?^(cal u.cal *coal))
|
=+ cal==+(cal=(~(get by cow) p.som.pip) ?^(cal u.cal *coal))
|
||||||
?. (lth q.som.pip ono.cal)
|
?. (lth q.som.pip ono.cal)
|
||||||
[~ pip(pez %way)]
|
:- [~ pip(pez %way)]
|
||||||
|
%= +>.$ cow
|
||||||
|
%+ ~(put by cow)
|
||||||
|
p.som.pip
|
||||||
|
=+ val=(~(get by voy.cal) q.som.pip)
|
||||||
|
cal(voy (~(put by voy.cal) q.som.pip ?~(val [num ~] [num u.val])))
|
||||||
|
==
|
||||||
|
:_ +>.$
|
||||||
=+ ^= jon ^- json
|
=+ ^= jon ^- json
|
||||||
:~ %a
|
:~ %a
|
||||||
(jone ono.cal)
|
(jone ono.cal)
|
||||||
@ -1203,18 +1261,18 @@
|
|||||||
?. ?=(%o -.r.som.pip) ~
|
?. ?=(%o -.r.som.pip) ~
|
||||||
=+ lin=(~(get by p.r.som.pip) %line)
|
=+ lin=(~(get by p.r.som.pip) %line)
|
||||||
?^ lin ?.(?=(%s -.u.lin) ~ [~ %line p.u.lin])
|
?^ lin ?.(?=(%s -.u.lin) ~ [~ %line p.u.lin])
|
||||||
=+ syc=(~(get by p.r.som.pip) %sync)
|
=+ syc=(~(get by p.r.som.pip) %hail)
|
||||||
?^ syc [~ %hail ~]
|
?^ syc [~ %hail ~]
|
||||||
=+ lig=(~(get by p.r.som.pip) %ling)
|
=+ lig=(~(get by p.r.som.pip) %ling)
|
||||||
?^ lig [~ %ling ~]
|
?^ lig [~ %ling ~]
|
||||||
~
|
~
|
||||||
:_ %_ +>.$
|
:_ %_ +>.$
|
||||||
cow (~(put by cow) p.som.pip cal)
|
cow (~(put by cow) p.som.pip cal(ino +(ino.cal)))
|
||||||
mow
|
mow
|
||||||
?~ fuv mow
|
?~ fuv mow
|
||||||
:_ mow
|
:_ mow
|
||||||
:+ [~ %gold our]
|
:+ [~ %gold our]
|
||||||
[/b [%e %cons ses (scot %ud p.som.pip) ~] hen]
|
[/b [%e %cons ses (scot %ud p.som.pip) ~] ~ ~]
|
||||||
u.fuv
|
u.fuv
|
||||||
==
|
==
|
||||||
[~ `pimp`pip(pez `pest`[%fin %raw 200 ~ ~])]
|
[~ `pimp`pip(pez `pest`[%fin %raw 200 ~ ~])]
|
||||||
@ -1242,12 +1300,12 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
[%err *]
|
[%err *]
|
||||||
[~ +>.$(..ya (muff [%thou (loft `love`[%zap +.pez.pip])]))]
|
[~ +>.$(..ya (muff(hen hen.pip) [%thou (loft `love`[%zap +.pez.pip])]))]
|
||||||
::
|
::
|
||||||
[%fin *]
|
[%fin *]
|
||||||
=+ har=(loft p.pez.pip)
|
=+ har=(loft p.pez.pip)
|
||||||
=. q.har (weld (turn cug |=(a=@t ['set-cookie' a])) q.har)
|
=. q.har (weld (turn cug |=(a=@t ['set-cookie' a])) q.har)
|
||||||
[~ +>.$(..ya (muff [%thou har]))]
|
[~ +>.$(..ya (muff(hen hen.pip) [%thou har]))]
|
||||||
::
|
::
|
||||||
[%haz *]
|
[%haz *]
|
||||||
:_ +>.$
|
:_ +>.$
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
=+ foo=`manx`i/;"foobarz"
|
=+ foo=`manx`i/;"foobarz"
|
||||||
=+ lam=`(list manx)`[lim lum lom ~]
|
=+ lam=`(list manx)`[lim lum lom ~]
|
||||||
;=
|
;=
|
||||||
;title: Hi foo!
|
;title: Hi Galen!
|
||||||
;
|
;
|
||||||
;p: Hello, world. Goodbye! Hello! Typing... more typing...
|
;p: Hello, world. Goodbye! Hello! Typing... more typing...
|
||||||
;p:"Hello: pos is {<pos>}"
|
;p:"Hello: pos is {<pos>}"
|
||||||
|
Loading…
Reference in New Issue
Block a user