Paste: trim-keep
Author: | hsuh |
Mode: | factor |
Date: | Thu, 29 Oct 2009 15:39:00 |
Plain Text |
: find-idx find drop ; inline
: find-last-idx find-last drop ; inline
: trim-idx
[ not ] compose
[ find-idx ]
[ find-last-idx ] 2bi ; inline
:: (trim-keep)
a b 1 + seq subseq
seq a head
seq b 1 + tail ;
: trim-keep
dupd trim-idx (trim-keep) ; inline
Author: | blei |
Mode: | factor |
Date: | Thu, 29 Oct 2009 21:09:16 |
Plain Text |
: cut-slice-head
dupd [ not ] compose find drop over length or cut-slice ;
inline
: cut-slice-tail
dupd [ not ] compose find-last drop 0 or 1 + cut-slice ;
inline
: trim-keep-slice
[ cut-slice-head ] keep cut-slice-tail swapd ; inline
: trim-keep
over [ trim-keep-slice ] dip [ like ] curry tri@ ; inline
New Annotation