mirror of
https://github.com/urbit/shrub.git
synced 2025-01-05 19:46:50 +03:00
historical .^
This commit is contained in:
parent
c246a061ad
commit
21e3d981d4
@ -197,12 +197,13 @@
|
||||
::
|
||||
++ aver :: read
|
||||
|= mun=mood
|
||||
^- (unit (unit cage))
|
||||
^- (unit (unit (each cage silk)))
|
||||
?: &(=(p.mun %u) !=(p.q.mun now)) :: prevent bad things
|
||||
~& [%clay-fail p.q.mun %now now]
|
||||
!!
|
||||
=+ ezy=?~(ref ~ (~(get by haw.u.ref) mun))
|
||||
?^ ezy ezy
|
||||
?^ ezy
|
||||
`(bind u.ezy (cury same %&))
|
||||
=+ nao=(case-to-aeon:ze q.mun)
|
||||
:: ~& [%aver-mun nao [%from syd lim q.mun]]
|
||||
?~(nao ~ (read-at-aeon:ze u.nao mun))
|
||||
@ -229,7 +230,7 @@
|
||||
[?^(q.i.p.tab !! q.i.p.tab) (slot 5 q.tab)]
|
||||
::
|
||||
++ balk :: read and send
|
||||
|= [hen=duct cay=(unit cage) mun=mood]
|
||||
|= [hen=duct cay=(unit (each cage silk)) mun=mood]
|
||||
^+ +>
|
||||
?~ cay (blub hen)
|
||||
(blab hen mun u.cay)
|
||||
@ -243,14 +244,20 @@
|
||||
%_(+> tag :_(tag [hen /tyme %t %rest tym]))
|
||||
::
|
||||
++ blab :: ship result
|
||||
|= [hen=duct mun=mood dat=cage]
|
||||
|= [hen=duct mun=mood dat=(each cage silk)]
|
||||
^+ +>
|
||||
+>(byn [[hen ~ [p.mun q.mun syd] r.mun dat] byn])
|
||||
?: ?=(%& -.dat)
|
||||
+>.$(byn [[hen ~ [p.mun q.mun syd] r.mun p.dat] byn])
|
||||
=- +>.$(tag [- tag])
|
||||
:* hen [%blab p.mun (scot q.mun) syd r.mun]
|
||||
%f %exec who [who syd q.mun] ~ p.dat
|
||||
==
|
||||
::
|
||||
++ bleb :: ship sequence
|
||||
|= [hen=duct ins=@ud hip=(unit (pair aeon aeon))]
|
||||
^+ +>
|
||||
%^ blab hen [%w [%ud ins] ~]
|
||||
:- %&
|
||||
?~ hip
|
||||
[%null [%atom %n] ~]
|
||||
[%nako !>((make-nako:ze u.hip))]
|
||||
@ -888,7 +895,7 @@
|
||||
%= $
|
||||
xiq t.xiq
|
||||
..wake ?~ u.cas (blub p.i.xiq)
|
||||
(blab p.i.xiq p.q.i.xiq u.u.cas)
|
||||
(blab p.i.xiq p.q.i.xiq %& u.u.cas)
|
||||
==
|
||||
=+ nao=(case-to-aeon:ze q.p.q.i.xiq)
|
||||
?~ nao $(xiq t.xiq, xaq [i.xiq xaq])
|
||||
@ -904,7 +911,6 @@
|
||||
?~ nab
|
||||
$(xiq t.xiq, xaq [i.xiq xaq])
|
||||
=+ huy=(case-to-aeon:ze q.mot)
|
||||
~& >> [%shipping p.i.xiq [p q r]:mot]
|
||||
?~ huy
|
||||
=+ ptr=[%ud +(let.dom)]
|
||||
%= $
|
||||
@ -948,7 +954,9 @@
|
||||
=+ bol=(~(get by hat) pax)
|
||||
|- ^- silk
|
||||
?: =([~ lob] bol)
|
||||
[%done ~ (need (read %x [%ud let.dom] pax))]
|
||||
=+ (need (need (read-x let.dom pax)))
|
||||
?> ?=(%& -<)
|
||||
[%done ~ p.-]
|
||||
=+ bol=(~(got by lat.ran) lob)
|
||||
?- -.bol
|
||||
%direct [%volt ~ q.bol]
|
||||
@ -1243,19 +1251,21 @@
|
||||
::
|
||||
++ read-x
|
||||
|= [yon=aeon pax=path]
|
||||
^- (unit (unit cage))
|
||||
^- (unit (unit (each cage silk)))
|
||||
=+ tak=(~(get by hit.dom) yon)
|
||||
?~ tak
|
||||
~
|
||||
?: =(yon let.dom)
|
||||
`(bind q.ank:(descend-path:(zu ank.dom) pax) (corl (cury same %&) tail))
|
||||
=+ yak=(tako-to-yaki u.tak)
|
||||
=+ lob=(~(get by q.yak) pax)
|
||||
?~ lob
|
||||
[~ ~]
|
||||
=+ mar=(lobe-to-mark u.lob)
|
||||
?. ?=(?(%hoon %hook) mar)
|
||||
~
|
||||
:^ ~ ~ mar
|
||||
:- [%atom %t]
|
||||
[~ ~ %| (lobe-to-silk pax u.lob)]
|
||||
:^ ~ %& ~
|
||||
:+ mar [%atom %t]
|
||||
|- ^- @t :: (urge cord) would be faster
|
||||
=+ bol=(lobe-to-blob u.lob)
|
||||
?: ?=(%direct -.bol)
|
||||
@ -1293,20 +1303,20 @@
|
||||
::
|
||||
++ read-at-aeon :: read-at-aeon:ze
|
||||
|= [yon=aeon mun=mood] :: seek and read
|
||||
^- (unit (unit cage))
|
||||
^- (unit (unit (each cage silk)))
|
||||
?: &(?=(%w p.mun) !?=(%ud -.q.mun)) :: NB only for speed
|
||||
?^(r.mun [~ ~] [~ ~ %aeon !>(yon)])
|
||||
?^(r.mun [~ ~] [~ ~ %& %aeon !>(yon)])
|
||||
?: ?=(%x p.mun)
|
||||
(read-x yon r.mun)
|
||||
?: ?=(%y p.mun)
|
||||
(read-y yon r.mun)
|
||||
%+ biff
|
||||
(bind (read-y yon r.mun) (curr bind (cury same %&)))
|
||||
%+ bind
|
||||
(rewind yon)
|
||||
|= a=(unit ,_+>.$)
|
||||
^- (unit (unit cage))
|
||||
^- (unit (each cage silk))
|
||||
?~ a
|
||||
[~ ~]
|
||||
`(read:u.a mun)
|
||||
~
|
||||
`(unit (each cage silk))`(bind (read:u.a mun) (cury same %&))
|
||||
::
|
||||
++ rewind :: rewind:ze
|
||||
|= yon=aeon :: rewind to aeon
|
||||
@ -1877,8 +1887,8 @@
|
||||
:- [%done ~ %path !>(a)]
|
||||
?. b
|
||||
[%done ~ %null !>(~)]
|
||||
:^ %cast %mime %done
|
||||
`(need (read:zez %x [%ud let.dom] a))
|
||||
:+ %cast %mime
|
||||
(lobe-to-silk:zez a (~(got by q.new.dat) a))
|
||||
==
|
||||
::
|
||||
++ ergoed
|
||||
@ -2194,11 +2204,15 @@
|
||||
[~ ~]
|
||||
=+ run=((soft care) ren)
|
||||
?~ run [~ ~]
|
||||
%. [u.run u.luk tyl]
|
||||
=< aver
|
||||
?: got
|
||||
(di:(un his now ~ ruf) syd)
|
||||
(do now ~ [his his] syd ruf)
|
||||
=+ %. [u.run u.luk tyl]
|
||||
=< aver
|
||||
?: got
|
||||
(di:(un his now ~ ruf) syd)
|
||||
(do now ~ [his his] syd ruf)
|
||||
?~ - -
|
||||
?~ u.- -
|
||||
?: ?=(%& -.u.u.-) ``p.u.u.-
|
||||
~
|
||||
::
|
||||
++ stay [%0 ruf]
|
||||
++ take :: accept response
|
||||
@ -2240,6 +2254,19 @@
|
||||
=+ nex=let:(~(got by sor.ruf) our syd her sud)
|
||||
[[hen %pass tea %c %merg our syd her sud %mate]~ ..^$]
|
||||
==
|
||||
?: ?=([%blab care @ @ *] tea)
|
||||
?> ?=(%made +<.q.hin)
|
||||
?: ?=(%| -.p.q.hin)
|
||||
~| %blab-fail
|
||||
~> %mean.|.(p.p.q.hin) :: interpolate ford fail into stack trace
|
||||
!!
|
||||
?^ p.q.p.p.q.hin
|
||||
~|(%bad-marc !!)
|
||||
:_ ..^$ :_ ~
|
||||
:* hen %give %writ ~
|
||||
`[care case @tas]`[i.t.tea ((hard case) +>:(slay i.t.t.tea)) i.t.t.t.tea]
|
||||
`path`t.t.t.t.tea `cage`q.p.p.q.hin
|
||||
==
|
||||
?- -.+.q.hin
|
||||
%crud
|
||||
[[[hen %slip %d %flog +.q.hin] ~] ..^$]
|
||||
|
@ -126,6 +126,7 @@
|
||||
++ task :: problem in progress
|
||||
$: nah=duct :: cause
|
||||
kas=silk :: problem
|
||||
keg=(map (pair term beam) cage) :: block results
|
||||
kig=[p=@ud q=(map ,@ud ,[p=care q=beam])] :: blocks
|
||||
== ::
|
||||
-- ::
|
||||
@ -226,13 +227,13 @@
|
||||
=: p.tad.bay +(p.tad.bay)
|
||||
dym.bay (~(put by dym.bay) hen num)
|
||||
==
|
||||
~(exec zo [num `task`[hen u.kus 0 ~]])
|
||||
~(exec zo [num `task`[hen u.kus ~ 0 ~]])
|
||||
::
|
||||
++ apel :: stateless
|
||||
|= [hen=duct kus=silk]
|
||||
^- (unit gift)
|
||||
=+ num=0 :: XX
|
||||
~(exit zo [num `task`[hen kus 0 ~]])
|
||||
~(exit zo [num `task`[hen kus ~ 0 ~]])
|
||||
::
|
||||
++ axon :: take
|
||||
|= [num=@ud tik=@ud sih=sign]
|
||||
@ -956,7 +957,7 @@
|
||||
^- (bolt vase)
|
||||
%+ cope (mail cof p.vax gen)
|
||||
|= [cof=cafe typ=type fol=nock]
|
||||
%+ (coup cof) (mock [q.vax fol] (mole (slod ska)))
|
||||
%+ (coup cof) (mock [q.vax fol] (mole (slod (save ska))))
|
||||
|=(val=* `vase`[typ val])
|
||||
::
|
||||
++ make :: reduce silk
|
||||
@ -1114,7 +1115,7 @@
|
||||
^- (bolt vase)
|
||||
%+ cope (malt cof p.gat p.sam)
|
||||
|= [cof=cafe typ=type]
|
||||
%+ (coup cof) (mong [q.gat q.sam] (mole (slod ska)))
|
||||
%+ (coup cof) (mong [q.gat q.sam] (mole (slod (save ska))))
|
||||
|=(val=* `vase`[typ val])
|
||||
::
|
||||
++ meow :: assemble
|
||||
@ -1474,10 +1475,21 @@
|
||||
|= [tik=@ud rot=riot]
|
||||
^+ ..zo
|
||||
?> (~(has by q.kig) tik)
|
||||
=+ `[ren=care bem=beam]`(~(got by q.kig) tik)
|
||||
?~ rot
|
||||
=+ `[ren=care bem=beam]`(~(got by q.kig) tik)
|
||||
amok:(expo [%made %| (smyt ren (tope bem)) ~])
|
||||
exec(q.kig (~(del by q.kig) tik))
|
||||
=+ (cat 3 'c' ren)
|
||||
exec(q.kig (~(del by q.kig) tik), keg (~(put by keg) [- bem] r.u.rot))
|
||||
::
|
||||
++ save
|
||||
|= sky=sled
|
||||
^- sled
|
||||
|= [(unit (set monk)) tem=term bem=beam]
|
||||
^- (unit (unit cage))
|
||||
=+ (~(get by keg) tem bem)
|
||||
?^ -
|
||||
``u.-
|
||||
(sky +<.$)
|
||||
--
|
||||
--
|
||||
::
|
||||
|
@ -1764,6 +1764,16 @@
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 2cI, almost macros ::
|
||||
::
|
||||
++ same |*(* +<) :: identity
|
||||
++ head |*(^ +<-) :: get head
|
||||
++ tail |*(^ +<+) :: get head
|
||||
++ cork |*([a=_,* b=gate] (corl b a)) :: compose forward
|
||||
++ corl :: compose backwards
|
||||
|* [a=gate b=_,*]
|
||||
=< +:|.((a (b))) :: type check
|
||||
|* c=_+<.b
|
||||
(a (b c))
|
||||
::
|
||||
++ cury :: curry left
|
||||
|* [a=_|=(^ **) b=*]
|
||||
|* c=_+<+.a
|
||||
@ -1774,14 +1784,6 @@
|
||||
|* b=_+<+.a
|
||||
(a b c)
|
||||
::
|
||||
++ cork |*([a=_,* b=gate] (corl b a)) :: compose forward
|
||||
::
|
||||
++ corl :: compose backwards
|
||||
|* [a=gate b=_,*]
|
||||
=< +:|.((a (b))) :: type check
|
||||
|* c=_+<.b
|
||||
(a (b c))
|
||||
::
|
||||
++ hard :: force coerce to type
|
||||
|* han=$+(* *)
|
||||
|= fud=* ^- han
|
||||
|
Loading…
Reference in New Issue
Block a user