Jump to content

Multisplit: Difference between revisions

m
→‎{{header|Factor}}: A small optimization in best-separator: no need to filter if we only need to take the first element of the result, might as well just find the first matching one.
(→‎{{header|Python}}: Added a functionally composed draft (using reduce, without regexes))
m (→‎{{header|Factor}}: A small optimization in best-separator: no need to filter if we only need to take the first element of the result, might as well just find the first matching one.)
Line 522:
 
: best-separator ( seq -- pos index )
dup [ first ] map infimum '[ first _ = ] filterfind firstnip first2 ;
 
: first-subseq ( separators seq -- n separator )
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.