]> gitweb.factorcode.org Git - factor.git/commitdiff
io.files: quot effects in change-file-lines and change-file-contents.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 Jan 2020 21:26:19 +0000 (13:26 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 Jan 2020 21:26:19 +0000 (13:26 -0800)
core/io/files/files.factor

index 7ba3f9e82c5e6dcf7f0b16eb49829363eb800bc9..e96dbc8ab5a791a7c2c3027ee188f211f12daff7 100644 (file)
@@ -56,14 +56,14 @@ HOOK: (file-appender) io-backend ( path -- stream )
 : set-file-lines ( seq path encoding -- )
     [ [ print ] each ] with-file-writer ;
 
-: change-file-lines ( path encoding quot -- )
+: change-file-lines ( ..a path encoding quot: ( ..a seq -- ..b seq' ) -- ..b )
     [ [ file-lines ] dip call ]
     [ drop set-file-lines ] 3bi ; inline
 
 : set-file-contents ( seq path encoding -- )
     [ write ] with-file-writer ;
 
-: change-file-contents ( path encoding quot -- )
+: change-file-contents ( ..a path encoding quot: ( ..a seq -- ..b seq' ) -- ..b )
     [ [ file-contents ] dip call ]
     [ drop set-file-contents ] 3bi ; inline