mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-04 02:49:42 +03:00
Various fixes and improvements.
This commit is contained in:
parent
55e1f24999
commit
68ea2917ae
@ -1154,7 +1154,7 @@
|
|||||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
:: section 2cF, signed and modular ints ::
|
:: section 2cF, signed and modular ints ::
|
||||||
::
|
::
|
||||||
++ si :: signed integer
|
++ si !: :: signed integer
|
||||||
|%
|
|%
|
||||||
++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
|
++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
|
||||||
++ dif |= [a=@s b=@s] :: subtraction
|
++ dif |= [a=@s b=@s] :: subtraction
|
||||||
@ -2502,9 +2502,7 @@
|
|||||||
[zac [~ i.q.tub [zac t.q.tub]]]
|
[zac [~ i.q.tub [zac t.q.tub]]]
|
||||||
::
|
::
|
||||||
++ sear :: conditional cook
|
++ sear :: conditional cook
|
||||||
~/ %sear
|
|
||||||
|* [pyq=_|=(* *(unit)) sef=_rule]
|
|* [pyq=_|=(* *(unit)) sef=_rule]
|
||||||
~/ %fun
|
|
||||||
|= tub=nail
|
|= tub=nail
|
||||||
=+ vex=(sef tub)
|
=+ vex=(sef tub)
|
||||||
?~ q.vex
|
?~ q.vex
|
||||||
@ -2601,9 +2599,7 @@
|
|||||||
[(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
|
[(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
|
||||||
::
|
::
|
||||||
++ stun :: parse several times
|
++ stun :: parse several times
|
||||||
~/ %stun
|
|
||||||
|* [[les=@ mos=@] fel=_rule]
|
|* [[les=@ mos=@] fel=_rule]
|
||||||
~/ %fun
|
|
||||||
|= tub=nail
|
|= tub=nail
|
||||||
^- (like (list ,_(wonk (fel))))
|
^- (like (list ,_(wonk (fel))))
|
||||||
?: =(0 mos)
|
?: =(0 mos)
|
||||||
@ -2946,8 +2942,7 @@
|
|||||||
?: =(inx len) &
|
?: =(inx len) &
|
||||||
=+ cur=(cut 3 [inx 1] b)
|
=+ cur=(cut 3 [inx 1] b)
|
||||||
?& ?| &((gte cur 'a') (lte cur 'z'))
|
?& ?| &((gte cur 'a') (lte cur 'z'))
|
||||||
&((gte cur 'A') (lte cur 'Z'))
|
&((gte cur '0') (lte cur '9'))
|
||||||
&(&((gte cur '0') (lte cur '9')) !=(0 inx))
|
|
||||||
|(=('-' cur) =('~' cur) =('_' cur) =('.' cur))
|
|(=('-' cur) =('~' cur) =('_' cur) =('.' cur))
|
||||||
==
|
==
|
||||||
$(inx +(inx))
|
$(inx +(inx))
|
||||||
@ -4727,7 +4722,7 @@
|
|||||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
:: section 2eW, lite number theory ::
|
:: section 2eW, lite number theory ::
|
||||||
::
|
::
|
||||||
++ egcd :: schneier's egcd
|
++ egcd !: :: schneier's egcd
|
||||||
|= [a=@ b=@]
|
|= [a=@ b=@]
|
||||||
=+ si
|
=+ si
|
||||||
=+ [c=(sun a) d=(sun b)]
|
=+ [c=(sun a) d=(sun b)]
|
||||||
@ -8468,28 +8463,36 @@
|
|||||||
;~(plug (star low) (star hig))
|
;~(plug (star low) (star hig))
|
||||||
::
|
::
|
||||||
++ plex
|
++ plex
|
||||||
|= gen=twig ~| [%plex gen] ^- path
|
|= gen=twig ^- (unit path)
|
||||||
?: ?=([%zpcb *] gen)
|
?: ?=([%zpcb *] gen)
|
||||||
$(gen q.gen)
|
$(gen q.gen)
|
||||||
?> ?=([%clsg *] gen)
|
?. ?=([%clsg *] gen) ~
|
||||||
(turn p.gen |=(a=twig ?>(?=(%dtzy -.a) q.a)))
|
%+ reel p.gen
|
||||||
|
|= [a=twig b=_`(unit path)`[~ u=/]]
|
||||||
|
?~ b ~
|
||||||
|
?. ?=(%dtzy -.a) ~
|
||||||
|
`[q.a u.b]
|
||||||
::
|
::
|
||||||
++ pray
|
++ pray
|
||||||
|= gen=twig ~| %pray ^- twig
|
|= gen=twig ~| %pray ^- (unit twig)
|
||||||
=+ rev=(plex gen)
|
=+ rev=(plex gen)
|
||||||
?: (~(has in was) rev)
|
?~ rev ~
|
||||||
|
:- ~
|
||||||
|
?: (~(has in was) u.rev)
|
||||||
~|(%pray-loop !!)
|
~|(%pray-loop !!)
|
||||||
=+ ruv=`path`(weld rev `path`[%hoon ~])
|
=+ ruv=`path`(weld u.rev `path`[%hoon ~])
|
||||||
=+ txt=(,@ta .^(%cx ruv))
|
=+ txt=(,@ta .^(%cx ruv))
|
||||||
~| ruv
|
~| ruv
|
||||||
%+ rash txt
|
%+ rash txt
|
||||||
(ifix [gay gay] tall(was (~(put in was) rev), wer rev))
|
(ifix [gay gay] tall(was (~(put in was) u.rev), wer u.rev))
|
||||||
::
|
::
|
||||||
++ prey
|
++ prey
|
||||||
|= gun=(list twig) ^- twig
|
|= gun=(list twig) ^- (unit twig)
|
||||||
?~ gun [~ 1]
|
?~ gun `[~ 1]
|
||||||
?~ t.gun (pray i.gun)
|
=+ gup=(pray i.gun)
|
||||||
[%tsgr (pray i.gun) $(gun t.gun)]
|
?~ gup ~
|
||||||
|
?~ t.gun gup
|
||||||
|
(bind $(gun t.gun) |=(a=twig [%tsgr u.gup a]))
|
||||||
::
|
::
|
||||||
++ phax
|
++ phax
|
||||||
|= ruw=(list (list beer))
|
|= ruw=(list (list beer))
|
||||||
@ -8911,7 +8914,7 @@
|
|||||||
[%dtkt %dtzz %$ %cx rev]
|
[%dtkt %dtzz %$ %cx rev]
|
||||||
;~(plug hill rood)
|
;~(plug hill rood)
|
||||||
==
|
==
|
||||||
(cook prey (most ket rood))
|
(sear prey (most ket rood))
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
(stag %cnzz rope)
|
(stag %cnzz rope)
|
||||||
@ -9203,7 +9206,7 @@
|
|||||||
:~ [':' ;~(pfix col (toad expz))]
|
:~ [':' ;~(pfix col (toad expz))]
|
||||||
[',' (rune com %zpcm expb)]
|
[',' (rune com %zpcm expb)]
|
||||||
[';' (rune sem %zpsm expb)]
|
[';' (rune sem %zpsm expb)]
|
||||||
['^' ;~(pfix ket (cook prey (toad exps)))]
|
['^' ;~(pfix ket (sear prey (toad exps)))]
|
||||||
['>' (rune gar %zpgr expa)]
|
['>' (rune gar %zpgr expa)]
|
||||||
['=' (rune tis %zpts expa)]
|
['=' (rune tis %zpts expa)]
|
||||||
['?' (rune wut %zpwt hinh)]
|
['?' (rune wut %zpwt hinh)]
|
||||||
|
Loading…
Reference in New Issue
Block a user