hoon: refactors +r-co:co, modernizing syntax

This commit is contained in:
Joe Bryan 2020-10-02 11:25:48 -07:00
parent ebb76c1c5a
commit ce9bdb8b73

View File

@ -5992,20 +5992,21 @@
++ c-co (em-co [58 1] |=({? b/@ c/tape} [~(c ne b) c])) ++ c-co (em-co [58 1] |=({? b/@ c/tape} [~(c ne b) c]))
++ d-co |=(min/@ (em-co [10 min] |=({? b/@ c/tape} [~(d ne b) c]))) ++ d-co |=(min/@ (em-co [10 min] |=({? b/@ c/tape} [~(d ne b) c])))
++ r-co ++ r-co
|= a/dn |= a=dn
?: ?=({$i *} a) (weld ?:(s.a "inf" "-inf") rep) ?: ?=([%i *] a) (weld ?:(s.a "inf" "-inf") rep)
?: ?=({$n *} a) (weld "nan" rep) ?: ?=([%n *] a) (weld "nan" rep)
=+ ^= e %+ ed-co [10 1] =/ f=(pair tape @)
|= {a/? b/@ c/tape} %. a.a
?: a [~(d ne b) '.' c] %+ ed-co(rep ~) [10 1]
[~(d ne b) c] |=([a=? b=@ c=tape] [~(d ne b) ?.(a c ['.' c])])
=+ ^= f =. e.a (sum:si e.a (sun:si (dec q.f)))
=>(.(rep ~) (e a.a)) =/ res
=. e.a (sum:si e.a (sun:si (dec +.f))) %+ weld p.f
=+ b=?:((syn:si e.a) "e" "e-") ?~ e.a
=> .(rep ?~(e.a rep (weld b ((d-co 1) (abs:si e.a))))) rep
=> .(rep (weld -.f rep)) %+ weld ?:((syn:si e.a) "e" "e-")
?:(s.a rep ['-' rep]) ((d-co 1) (abs:si e.a))
?:(s.a res ['-' res])
:: ::
++ s-co ++ s-co
|= esc/(list @) ^- tape |= esc/(list @) ^- tape