refactors ++ta-ser to use ++find

This commit is contained in:
Joseph Bryan 2016-09-01 22:39:24 -04:00
parent 81945e4a0c
commit 450f0b2301

View File

@ -793,20 +793,15 @@
++ ta-ser :: reverse search
|= ext/(list @c)
^+ +>
?: |(?=($~ ris) =(0 pos.u.ris)) ta-bel
?: |(?=($~ ris) =(0 pos.u.ris))
ta-bel
=+ sop=?~(ext (dec pos.u.ris) pos.u.ris)
=+ tot=(weld str.u.ris ext)
=+ dol=(slag (sub num.hit sop) old.hit)
=+ ^= ser
=+ ^= beg
|= {a/(list @c) b/(list @c)} ^- ?
?~(a & ?~(b | &(=(i.a i.b) $(a t.a, b t.b))))
|= {a/(list @c) b/(list @c)} ^- ?
?~(a & ?~(b | |((beg a b) $(b t.b))))
=+ ^= sup
=/ sup
|- ^- (unit @ud)
?~ dol ~
?: (ser tot i.dol)
?^ (find tot i.dol)
`sop
$(sop (dec sop), dol t.dol)
?~ sup ta-bel