Anonymous user
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 _ = ]
: first-subseq ( separators seq -- n separator )
|