: map-from ( ... seq quot: ( ... elt -- ... newelt ) i -- ... newseq )
pick map-from-as ; inline
+: map-if ( ... seq if-quot: ( ... elt -- ... ? ) map-quot: ( ... elt -- ... newelt ) -- ... newseq )
+ '[ dup @ _ when ] map ; inline
+
<PRIVATE
: push-map-if ( ..a elt filter-quot: ( ..a elt -- ..b ? ) map-quot: ( ..a elt -- ..b newelt ) accum -- ..b )
: >string-list ( seq -- seq' )
[ "\"" 1surround ] map "," join ;
+: with-string-lines ( str quot -- str' )
+ [ string-lines ] dip map "\n" join ; inline
+
+: prepend-lines-with-spaces ( str -- str' )
+ [ " " prepend ] with-string-lines ;
+
: one? ( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
[ find ] 2keep rot [
[ 1 + ] 2dip find-from drop not