Conflicts:
	urb/zod/arvo/hoon.hoon
This commit is contained in:
Anton Dyudin 2014-06-30 13:09:16 -07:00 committed by Anton Dyudin
commit 2c2ce8767e
6 changed files with 339 additions and 80 deletions

View File

@ -39,8 +39,9 @@
$% [%kick p=@da] ::
== == ::
$: %g :: to %gall
[%muss p=hasp q=ship r=logo s=*] ::
==
$% [%rote p=sack q=term r=*] ::
[%roth p=sack q=term r=*] ::
== == ::
$: @tas :: to any
$% [%init p=@p] ::
[%want p=sock q=path r=*] ::
@ -470,7 +471,7 @@
::
|%
++ go :: go
|_ ton=toun :: ames state
|_ ton=town :: ames state
++ as :: as:go
|_ [our=ship saf=sufi] :: per server
++ born :: born:as:go
@ -741,7 +742,7 @@
::
++ ha !: :: adopt new license
|= [our=ship mac=mace wil=will]
^- toun
^- town
?> !=(~ mac)
?> ?=(^ wil)
:: ?> =(our r.p.q.i.wil)
@ -765,12 +766,12 @@
::
++ su :: install safe
|= new=_as
^- toun
^- town
ton(urb (~(put by urb.ton) our.new saf.new))
::
++ ti :: expire by time
|= [now=@da]
^- toun
^- town
!!
::
++ us :: produce safe
@ -993,9 +994,9 @@
::
|%
++ am :: am
|_ [now=@da fox=furt] :: protocol engine
|_ [now=@da fox=fort] :: protocol engine
++ boot :: boot:am
^- furt :: restore from noun
^- fort :: restore from noun
%= fox
urb.ton
%- ~(gas by *(map ship sufi))
@ -1010,7 +1011,7 @@
==
++ come :: come:am
|= [ges=(unit ,@t) wid=@ bur=@ fak=?] :: instantiate pawn
^- [p=[p=ship q=@uvG] q=furt]
^- [p=[p=ship q=@uvG] q=fort]
=+ loy=(bruw wid bur)
=+ rig=sec:ex:loy
=+ our=`@p`fig:ex:loy
@ -1028,7 +1029,7 @@
::
++ czar !: :: czar:am
|= [our=ship ger=@uw fak=?] :: instantiate emperor
^- [p=(list boon) q=furt]
^- [p=(list boon) q=fort]
=+ loy=?:(fak (bruw 2.048 our) (bruw 2.048 ger)) :: fake uses carrier #
=+ fim==(fig:ex:loy (zeno our))
?: &(!fak !fim) !! :: not fake & bad fig
@ -1044,7 +1045,7 @@
::
++ gnaw :: gnaw:am
|= [kay=cape ryn=lane pac=rock] :: process packet
^- [p=(list boon) q=furt]
^- [p=(list boon) q=fort]
?. =(1 (end 0 3 pac)) [~ fox]
=+ kec=(bite pac)
?: (goop p.p.kec) [~ fox]
@ -1075,7 +1076,7 @@
::
++ have :: have:am
|= [our=ship buq=buck] :: acquire license
^- [p=(list boon) q=furt]
^- [p=(list boon) q=fort]
=: ton.fox (~(ha go ton.fox) our buq)
zac.fox (~(put by zac.fox) our *corn)
==
@ -1084,7 +1085,7 @@
++ kick :: kick:am
|= hen=duct :: refresh net
=+ aks=(turn (~(tap by urb.ton.fox) ~) |=([p=ship q=sufi] p))
|- ^- [p=(list boon) q=furt]
|- ^- [p=(list boon) q=fort]
?~ aks [~ fox]
=^ buz fox zork:(kick:(um i.aks) hen)
=^ biz fox $(aks t.aks)
@ -1092,10 +1093,10 @@
::
++ wake :: wake:am
|= hen=duct :: harvest packets
^- [p=(list boon) q=furt]
^- [p=(list boon) q=fort]
=+ sox=hall
=| bin=(list boon)
|- ^- [p=(list boon) q=furt]
|- ^- [p=(list boon) q=fort]
?~ sox
=^ ban fox (kick hen)
[(weld bin p.ban) fox]
@ -1104,12 +1105,12 @@
::
++ wash :: wash:am
|= [soq=sock sup=soap ham=meal] :: dispatch and send
^- [p=(list boon) q=furt]
^- [p=(list boon) q=fort]
zork:zank:(wind:(ho:(um p.soq) q.soq) [q.sup r.sup] ham)
::
++ wise :: wise:am
|= [soq=sock hen=duct cha=path val=*] :: send a statement
^- [p=(list boon) q=furt]
^- [p=(list boon) q=fort]
zork:zank:(wool:(ho:(um p.soq) q.soq) hen cha val)
::
++ um :: per server
@ -1476,7 +1477,7 @@
zank:(pong:(ho her) hen)
::
++ zork :: zork:um:am
^- [p=(list boon) q=furt] :: resolve
^- [p=(list boon) q=fort] :: resolve
:- (flop bin)
%_ fox
ton (~(su go ton.fox) gus)
@ -1489,7 +1490,7 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 4aH, protocol vane ::
::
=| $: fox=furt :: kernel state
=| $: fox=fort :: kernel state
== ::
|= [now=@da eny=@ ski=sled] :: current invocation
^? :: opaque core
@ -1529,7 +1530,7 @@
(hunt doz rtn.sop.bah)
::
++ load
|= old=furt
|= old=fort
^+ ..^$
..^$(fox old)
::
@ -1568,7 +1569,7 @@
++ claw |=(our=ship ^-(duct hen:(need (~(get by zac.fox) our))))
++ clop
|= [now=@da hen=duct bon=boon]
^- [(list move) furt]
^- [(list move) fort]
?- -.bon
%beer
:_ fox(zac (~(put by zac.fox) p.bon `corn`[hen ~ ~ ~]))
@ -1616,13 +1617,15 @@
[%sick %wart p.bon i.t.q.q.bon t.t.q.q.bon r.bon]
==
::
%gm :: general message
?> ?=([@ @ *] t.t.q.q.bon)
%ge :: gall request
?> ?=([@ ~] t.t.q.q.bon)
=+ app=`term`(need ((sand %tas) i.t.t.q.q.bon))
=+ for=`logo`(need ((sand %tas) i.t.t.t.q.q.bon))
:_ fox
:~ [hen [%pass ~ %g %muss [p.p.bon app] q.p.bon for r.bon]]
==
:_(fox [hen %pass ~ %g %roth p.bon app r.bon]~)
::
%gh :: gall response
?> ?=([@ ~] t.t.q.q.bon)
=+ app=`term`(need ((sand %tas) i.t.t.q.q.bon))
:_(fox [hen %pass ~ %g %rote p.bon app r.bon]~)
::
%pi :: ping
$(bon [%wine p.bon " sent a ping at {(scow %da now)}"])
@ -1697,7 +1700,7 @@
?: ?=([%crud *] kyz)
[[[hen [%slip %d %flog kyz]] ~] +>]
=+ ^= fuy
^- [p=(list boon) q=furt]
^- [p=(list boon) q=fort]
?- -.kyz
%cash
(~(have am [now fox]) p.kyz q.kyz)

View File

@ -1,4 +1,4 @@
:: :: %ford, new execution control
!: :: %ford, new execution control
!? 164
::::
|= pit=vase
@ -403,14 +403,20 @@
^- (bolt (unit vase))
?: ?=(?(%gate %core %hoon %hook) for)
(fine cof ~ sam)
~& [%lake for bek]
%+ cope (make cof %boil %gate bek /ref/[for]/sys)
|= [cof=cafe cay=cage]
~& %lake-a
%+ cope (lane cof p.q.cay [%cnzy %$])
|= [cof=cafe ref=type]
~& %lake-b
?: (~(nest ut ref) | p.sam)
~& %lake-c
(fine cof ~ sam)
~& %lake-d
%+ cope (maul cof q.cay sam)
|= [cof=cafe pro=vase]
~& %lake-e
(fine cof ~ pro)
::
++ lave :: validate
@ -419,6 +425,7 @@
=+ ^= own ^- ship
=+ von=(ska %cy (tope [[p.sax %main lok] /core/ref/[for]/sys]))
?~(von q.sax p.sax)
~& [%lave for sax som]
((lake for [own %main lok]) cof [%noun som])
::
++ lair :: metaload

View File

@ -1,4 +1,4 @@
!: :: %gall, user-level applications
:: :: %gall, user-level applications
!? 164
::::
|= pit=vase
@ -23,30 +23,39 @@
[%show p=hasp q=ship r=path] :: subscribe
:: [%cuff p=(unit cuff) q=kiss] :: controlled kiss
[%mess p=hasp q=ship r=cage] :: typed message
[%muss p=hasp q=ship r=logo s=*] :: untyped message
[%nuke p=hasp] :: clear duct
[%nuke p=hasp q=ship] :: clear duct
[%rote p=sack q=term r=*] :: remote request
[%roth p=sack q=term r=*] :: remote response
== ::
++ knob :: pending action
$% [%boot ~] :: begin boot
[%crud p=@tas q=(list tank)] :: error
[%load p=cage] :: continue boot
[%mess p=ship q=cage] :: typed message
[%muss p=ship q=logo r=*] :: untyped message
[%show p=ship q=path] :: subscribe
[%nuke ~] :: clear duct
[%nuke p=ship] :: clear duct
[%take p=path q=vase] :: user result
== ::
++ mast :: apps by ship
$: hun=duct :: control duct
sap=(map ship scad) :: foreign contacts
bum=(map ,@ta seat) :: apps by name
== ::
++ move ,[p=duct q=(mold note gift)] :: typed move
++ note :: out request $->
$? $: %c :: to %clay
$? $: %a :: to %ames
$% [%want p=sock q=path r=*] ::
== == ::
$: %c :: to %clay
$% [%warp p=sock q=riff] ::
== == ::
$: %f :: to %ford
$% [%exec p=@p q=(unit silk)] ::
== == ::
$: %g :: to %gall
$% [%show p=hasp q=ship r=path] ::
[%mess p=hasp q=ship r=cage] ::
[%nuke p=hasp q=ship] ::
== == ::
$: @tas :: to any
$% [%meta p=vase] ::
@ -57,11 +66,28 @@
[| p=moat] :: change range
== ::
++ riff ,[p=desk q=(unit rave)] :: see %clay
++ scad :: opaque for foreign
$: p=@ud :: index
q=(map duct ,@ud) :: by duct
r=(map ,@ud duct) :: by index
== ::
++ scar :: opaque duct system
$: p=@ud :: bone sequence
q=(map duct ,[p=bone q=(unit cuff)]) :: by duct
r=(map bone duct) :: by bone
== ::
++ roon :: foreign response
$% [%d p=logo q=*] :: diff
[%e p=(list tank)] :: error
[%f p=logo q=*] :: full refresh
[%n ~] :: cancel subscription
[%r p=(unit (pair logo noun))] :: message response
== ::
++ rook :: foreign request
$% [%m p=logo q=*] :: message
[%s p=path] :: subscribe
[%u ~] :: cancel/unsubscribe
== ::
++ seat :: the living app
$: huv=(unit vase) :: application vase
qic=(unit toil) :: current project
@ -78,9 +104,16 @@
zam=scar :: opaque ducts
== ::
++ sign :: in result $-<
$? [?(%a %b %c %d %e %g) @tas *]
[%f %made p=(each bead (list tank))]
==
$? [?(%a %b %c %d %e) @tas *] ::
$: %g :: by %gall
$% [%dumb ~] ::
[%rasp p=(unit (pair logo noun))] ::
[%rush p=logo q=*] ::
[%rust p=logo q=*] ::
== == ::
$: %f :: by %ford
$% [%made p=(each bead (list tank))] ::
== == == ::
++ toil (pair duct knob) :: work in progress
-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: functions
@ -148,7 +181,11 @@
|= [hen=duct hic=(hypo (hobo kiss))]
=> .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic)))
?: ?=(%init -.q.hic)
[p=~ q=..^$(pol.all (~(put by pol.all) p.q.hic hen ~))]
[p=~ q=..^$(pol.all (~(put by pol.all) p.q.hic hen ~ ~))]
?: ?=(%rote -.q.hic) :: remote layer
(gawk hen p.q.hic q.q.hic ((hard ,[@ud rook]) r.q.hic))
?: ?=(%roth -.q.hic)
(gawd hen p.q.hic q.q.hic ((hard ,[@ud roon]) r.q.hic))
|- ^- [p=(list move) q=_..^^$]
=+ =| law=(unit cuff)
|- ^- $: law=(unit cuff)
@ -158,18 +195,22 @@
?- -.q.hic
:: %cuff $(q.hic q.q.hic, law (limp p.q.hic law))
%mess [law p.q.hic %mess q.q.hic r.q.hic]
%muss [law p.q.hic %muss q.q.hic r.q.hic s.q.hic]
%show [law p.q.hic %show q.q.hic r.q.hic]
%nuke [law p.q.hic %nuke ~]
%nuke [law p.q.hic %nuke q.q.hic]
==
abet:work:(quem:(boar:(goat hap) hen law) kon)
::
++ take :: accept response
|= [pax=path hen=duct hin=(hypo sign)] ::
^- [p=(list move) q=_..^$]
=+ lum=(lump pax)
?: ?=([%r *] pax)
(gave hen t.pax q.hin)
?: ?=([%x *] pax)
(gasp hen t.pax q.hin)
?> ?=([%a *] pax)
=+ lum=(lump t.pax)
=< abet =< work
(more:(bear:(gaur p.lum) hen) q.lum hin)
(more:(bear:(gaff p.lum) hen) q.lum hin)
::
++ scry
|= $: use=(unit (set monk))
@ -187,7 +228,7 @@
|= $: use=(unit (set monk)) :: observers
bid=beam :: position
== ::
(beef:(gaur p.bid q.bid) use r.bid s.bid)
(beef:(gaff p.bid q.bid) use r.bid s.bid)
%+ bind
?+ ren ~
%u u.vew
@ -212,12 +253,190 @@
++ stay `axle`+>-.$
--
|% :: inner core
++ gaur :: take and go
::
++ best :: cage to gift
|= [sem=?(%rush %rust) cay=cage]
^- gift
:- %meta
^- vase
:- :+ %cell [%cube %rust %atom %tas]
[%cell [%atom %tas] p.q.cay]
[sem p.cay q.q.cay]
::
++ besp :: best for rasp grr
|= cuy=(unit cage)
^- gift
?~ cuy [%rasp ~]
:- %meta
^- vase
:- :+ %cell [%cube %rasp %atom %tas]
:+ %cell [%cube 0 [%atom %n]]
[%cell [%atom %tas] p.q.u.cuy]
[%rasp ~ p.u.cuy q.q.u.cuy]
::
++ gaff :: take and go
|= [our=@p app=@tas]
=+ mat=(need (~(get by pol.all) our))
=+ sat=(need (~(get by bum.mat) app))
~(. go [our app] mat sat)
::
++ gape :: %r send query
|= [hen=duct law=(unit cuff)]
|= [our=@p app=@tas kon=knob]
^- [(list move) _..^^$]
?> ?=(?(%mess %show %nuke) -.kon)
=+ you=`ship`?-(-.kon %mess p.kon, %nuke p.kon, %show p.kon)
=+ mat=(need (~(get by pol.all) you))
=+ sad==+(sad=(~(get by sap.mat) our) ?^(sad u.sad *scad))
=^ num sad
=+ nym=(~(get by q.sad) hen)
?^ nym [u.nym sad]
:- p.sad
:+ +(p.sad)
(~(put by q.sad) hen p.sad)
(~(put by r.sad) p.sad hen)
:- =+ ^= roc ^- rook
?- -.kon
%mess [%m p.q.kon q.q.q.kon]
%nuke [%u ~]
%show [%s q.kon]
==
^- (list move)
:~ :- hen
:+ %pass
~[%x -.roc (scot %p you) app (scot %p our) (scot %ud num)]
`note`[%a [%want [you our] [%q %gq app ~] [num roc]]]
==
%= ..^^$
pol.all
%+ ~(put by pol.all)
you
mat(sap (~(put by sap.mat) our sad))
==
::
++ gasp :: %x take
|= [hen=duct pax=path sih=sign]
^- [(list move) _..^$]
:_ ..^$
:_ ~
:- hen
?> ?=(%f -.sih)
?- -.p.+.sih
%|
[%give %crud %gasp-crud p.p.+.sih]
::
%&
=+ cay=`cage`q.p.p.+.sih
?+ -.pax !!
%d [%give (best %rush cay)]
%f [%give (best %rust cay)]
%r [%give (besp ~ cay)]
==
==
::
++ gave :: %r take
|= [hen=duct pax=path sih=sign]
^- [(list move) _..^$]
?> ?=([@ @ @ @ @ ~] pax)
=+ :* our=`ship`(slav %p i.t.pax)
app=`term`i.t.t.pax
you=`ship`(slav %p i.t.t.t.pax)
num=(scot %ud i.t.t.t.t.pax)
==
:_ ..^$ :_ ~ :- hen
:+ %pass [%r pax]
^- note
=+ rod=|=(ron=roon `note`[%a %want [you our] /q/gr/[app] num ron])
?+ -.pax !!
%m ?+ -.sih !!
%f
?- -.p.+.sih
%& [%g %mess [our app] you `cage`q.p.p.+.sih]
%| (rod %e p.p.+.sih)
==
::
%g
?- -.+.sih
%dumb !!
%rasp (rod %r p.+.sih)
%rush !!
%rust !!
==
==
%s ?+ -.sih !!
%g
?- -.+.sih
%dumb !!
%rasp !!
%rush (rod %d p.+.sih q.+.sih)
%rust (rod %f p.+.sih q.+.sih)
==
==
%u !!
==
::
++ gawd :: %r handle response
|= [hen=duct saq=sack app=term num=@ud ron=roon]
^- [p=(list move) q=_..^$]
=+ mat=(need (~(get by pol.all) p.saq))
=+ sad=(need (~(get by sap.mat) q.saq))
=+ neh=(need (~(get by r.sad) num))
:_ ..^$ :_ ~
^- move :- neh
?- -.ron
%d [%pass /x/d `note`[%f %exec p.saq ~ %vale p.ron saq q.ron]]
%e !!
%f [%pass /x/f `note`[%f %exec p.saq ~ %vale p.ron saq q.ron]]
%n !!
%r ?~ p.ron
[%give %rasp ~]
[%pass /x/r `note`[%f %exec p.saq ~ %vale p.u.p.ron saq q.u.p.ron]]
==
::
++ gawk :: %r call/request
|= [hen=duct saq=sack app=term num=@ud rok=rook]
^- [p=(list move) q=_..^$]
~& [%gawk hen saq num -.rok]
:_ ..^$ :_ ~
^- move :- hen
:+ %pass
:~ %r
-.rok
(scot %p p.saq)
app
(scot %p q.saq)
(scot %ud num)
==
^- note
?- -.rok
%m [%f %exec p.saq ~ %vale p.rok saq q.rok]
%s [%g %show [p.saq app] q.saq p.rok]
%u [%g %nuke [p.saq app] q.saq]
==
::
++ gent :: seat in mast
|= [our=@p app=@tas mat=mast]
=+ ^= sat ^- seat
=+ syt=(~(get by bum.mat) app)
?^ syt u.syt
%* . *seat
zam
^- scar
:+ 1
[[hun.mat 0 ~] ~ ~]
[[0 hun.mat] ~ ~]
==
~(. go [our app] mat sat)
::
++ goad :: handle request
|= [hen=duct law=(unit cuff)]
|= [our=@p app=@tas kon=knob]
^- [(list move) _..^^$]
=+ mut=(~(get by pol.all) our)
?^ mut
abet:work:(quem:(boar:(gent our app u.mut) hen law) kon)
((gape hen law) our app kon)
::
++ goat :: call and go
|= [our=@p app=@tas]
=+ mat=(need (~(get by pol.all) our))
@ -248,9 +467,10 @@
mat(bum (~(put by bum.mat) app sat))
==
==
::
++ away :: application path
|= pax=path ^- path
[(scot %p our) app pax]
[%a (scot %p our) app pax]
::
++ bear :: write backward
|= hen=duct
@ -471,7 +691,14 @@
| [~ (give %crud %made p.p.+.sih)]
==
::
++ more :: accept result
++ moar :: foreign take
|= $: pax=path
sih=sign
==
^+ +>
!!
::
++ more :: domestic take
|= $: pax=path :: internal position
hin=(hypo sign) :: typed event
==
@ -486,14 +713,6 @@
qic.sat ~
==
?+ i.t.pax !!
%muss
?> ?=([@ ~] t.t.pax)
=+ you=(need (slaw %p i.t.t.pax))
?> ?=(%f -.q.hin)
?- -.p.+.q.hin
| (give:(give %rasp ~) [%crud %vale p.p.+.q.hin])
& (quen %mess you q.p.p.+.q.hin)
==
::
%park
=^ gyd +>.$ (murk q.hin)
@ -515,11 +734,7 @@
peq.sat (~(put by peq.sat) ost ash)
sup.sat (~(put by sup.sat) ost kee)
==
:- %meta
^- vase
:- :+ %cell [%cube %rust %atom %tas]
[%cell [%atom %tas] p.q.u.gyd]
[%rust p.u.gyd q.q.u.gyd]
(best %rust u.gyd)
::
%peer
?> ?=([@ *] t.t.pax)
@ -624,9 +839,6 @@
|= [you=ship pax=path] :: subscription
%_(+> vey.sat (~(put to vey.sat) hen %show you pax))
::
++ nuke :: end
%_(. vey.sat (~(put to vey.sat) hen %nuke ~))
::
++ sumo :: standard gift
|= vig=vase
^- gift
@ -718,10 +930,6 @@
:: ~& [%mess-poke cog]
%+ ford /s/poke
[%call (harm cog (conf (core u.huv.sat))) (cove %$ sam)]
::
%muss
%+ ford /s/muss/[(scot %p p.kon)]
[%vale q.kon [our p.kon] r.kon]
::
%show
?: (warm %peer)

View File

@ -154,6 +154,7 @@
++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule
++ span ,@ta :: text-atom (ASCII)
++ spot ,[p=path q=pint] :: range in file
++ tang (list tank) :: general error
++ tank $% [%leaf p=tape] :: printing formats
[%palm p=[p=tape q=tape r=tape s=tape] q=(list tank)]
[%rose p=[p=tape q=tape r=tape] q=(list tank)]
@ -1140,6 +1141,21 @@
(new | (add +.c +.d))
++ sun |=(a=@u (mul 2 a)) :: @u to @s
++ syn |=(a=@s =(0 (end 0 1 a))) :: sign test
++ cmp |= [a=@s b=@s] :: compare
^- @s
?: =(a b)
--0
?: (syn a)
?: (syn b)
?: (gth a b)
--1
-1
--1
?: (syn b)
-1
?: (gth a b)
-1
--1
--
++ fe :: modulo bloq
|_ a=bloq
@ -1344,7 +1360,7 @@
++ te
|%
++ zer |= [b=@u p=@u n=[s=? e=@s a=@u]]
&(=(e.n (dec (^mul b 2))) =(0 (ira a.n)))
=(e.n (dec (^mul b 2)))
++ nan |= [b=@u n=[s=? e=@s a=@u]]
&(=(e.n (^mul 2 +(b))) !=(0 (ira a.n)))
@ -1397,7 +1413,7 @@
[s=%.n e=e.r a=a.r]
?. &(s.n s.m) :: if not both positive
(sub b p n [s=!s.m e=e.m a=a.m]) :: is actually sub
?. (^gte e.n e.m) :: guarantee e.n > e.m
?: =(-1 (cmp:si e.n e.m)) :: guarantee e.n > e.m
$(n m, m n)
=+ dif=(abs:si (dif:si e.n e.m)) :: always pos
=+ a2=(lsh 0 dif a.n) :: p+1+dif bits
@ -1411,12 +1427,12 @@
?: ?=(^ g)
u.g
?: |((zer:te:fl b p n) (zer:te:fl b p m))
(add b p n m) :: why not
(add b p n m(s !s.m)) :: why not
?: &(!s.n s.m) :: -a-b
(add b p m [s=%.n e.m a.m]) :: add handles negative case
(add b p n [s=%.n e.m a.m]) :: add handles negative case
?: &(s.n !s.m) :: a+b
(add b p m [s=%.y e.m a.m]) :: is actually add
?. |((^gth e.n e.m) &(=(e.n e.m) (^gte a.n a.m))) :: n > m
(add b p n [s=%.y e.m a.m]) :: is actually add
?. |(=(--1 (cmp:si e.n e.m)) &(=(e.n e.m) (^gte a.n a.m))) :: n > m
$(n m(s !s.m), m n(s !s.n))
=+ dif=(abs:si (dif:si e.n e.m))
=+ a2=(lsh 0 dif a.n) :: p+1+dif bits
@ -1446,10 +1462,10 @@
(szer:vl:fl b p =(s.n s.m))
?: (zer:te:fl b p m)
(inft:vl:fl b p =(s.n s.m))
=+ b=(lia p (^div (lsh 0 (^mul p 3) a.n) a.m))
=+ c=(lia p (^div (lsh 0 (^mul p 3) a.n) a.m))
?: (^gte a.n a.m)
(pro:te:fl b p [s==(s.n s.m) e=(dif:si e.n e.m) a=b])
(pro:te:fl b p [s=|(s.n s.m) e=(dif:si (dif:si e.n e.m) (sun:si 1)) a=b])
(pro:te:fl b p [s==(s.n s.m) e=(dif:si e.n e.m) a=c])
(pro:te:fl b p [s==(s.n s.m) e=(dif:si (dif:si e.n e.m) (sun:si 1)) a=c])
++ lte |= [n=[s=? e=@s a=@u] m=[s=? e=@s a=@u]] ^- ?
?: (^lte e.n e.m)
@ -1497,7 +1513,7 @@
(hol:fl 52 (sea a))
:: Convert to sign/exp/ari form
++ sea |= a=@rd ^- [s=? e=@s a=@u]
[s=(sig a) e=(exp a) a=(ari:fl 52 (end 0 52 a))]
(pro:te:fl 1.023 52 [s=(sig a) e=(exp a) a=(ari:fl 52 (end 0 52 a))])
++ err |= a=@rd ^- (unit tape)
(err:te:fl 1.023 52 (sea a))

View File

@ -2119,10 +2119,10 @@
$: rtt=@dr :: decaying avg rtt
wid=@ud :: logical wdow msgs
== ::
++ furt :: formal state
++ fort :: formal state
$: %0 :: version
hop=@da :: network boot date
ton=toun :: security
ton=town :: security
zac=(map ship corn) :: flows by server
== ::
++ frog ,[p=@da q=nori] :: time and change
@ -2444,7 +2444,7 @@
++ taxi ,[p=lane q=rock] :: routed packet
++ tick ,@ud :: process id
++ toro ,[p=@ta q=nori] :: general change
++ toun :: all security state
++ town :: all security state
$: lit=@ud :: imperial modulus
any=@ :: entropy
urb=(map ship sufi) :: all keys and routes

25
try/bin/fptest.hoon Normal file
View File

@ -0,0 +1,25 @@
::
:: /=try=/bin/aestest/hoon
::
|= [est=time eny=@uw]
|= ~
:_ ~ :_ ~
=+ i=0
:- %$
!>
|- ^- @
?: =(1.000.000 i) 0
=+ n=`@rd`(end 6 1 (en:aesc eny i))
=+ m=`@rd`(rsh 6 1 (en:aesc +(eny) i))
~& [%try `@ux`n `@ux`m]
=+ a=(add:rd n m)
=+ b=(sub:rd n m)
=+ c=(mul:rd n m)
=+ d=(div:rd n m)
=+ suc=%.y
?. suc
~| [%fail i `@ux`n `@ux`m]
!!
?: &(!=(0 i) =(0 (mod i 1.000)))
$(i +(i))
$(i +(i))