rebellion
rebellion copied to clipboard
Trimming transducer
Like string-trim
, but as a transducer and generalized via a predicate instead of a regular expression. Should be kind of like a combination of taking-while
, dropping-while
, and deduplicating-consecutive
. Signature:
(trimming-where [trimmable-element? predicate/c]) -> transducer?
Example:
> (transduce " Hello \n \n world! \n"
(trimming-where char-whitespace?)
#:into into-string)
"Hello world!"
Open questions:
- What about regular expression-based trimming?
- What about the various keyword arguments on
string-trim
? - Should this be encapsulated in some sort of
trimmer?
object? - What's the relationship to #328 and to #353?