]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/sequences/extras/extras.factor
sequences: Add 1surround which is dup surround
[factor.git] / extra / sequences / extras / extras.factor
index 9259b64a1dce7485f52d7af2a651bc99ab4e112c..2c9a2d7ce02678ff13bc6d5e5a49fe5602518853 100644 (file)
@@ -351,6 +351,9 @@ PRIVATE>
 : unsurround ( newseq seq2 seq3 -- seq1 )
    [ ?head drop ] [ ?tail drop ] bi* ;
 
+: >string-list ( seq -- seq' )
+    [ "\"" 1surround ] map "," join ;
+
 : one? ( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
     [ find ] 2keep rot [
         [ 1 + ] 2dip find-from drop not