io.files: quot effects in change-file-lines and change-file-contents.
parent
7a933a5af0
commit
dfac484e00
|
@ -56,14 +56,14 @@ HOOK: (file-appender) io-backend ( path -- stream )
|
||||||
: set-file-lines ( seq path encoding -- )
|
: set-file-lines ( seq path encoding -- )
|
||||||
[ [ print ] each ] with-file-writer ;
|
[ [ 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 ]
|
[ [ file-lines ] dip call ]
|
||||||
[ drop set-file-lines ] 3bi ; inline
|
[ drop set-file-lines ] 3bi ; inline
|
||||||
|
|
||||||
: set-file-contents ( seq path encoding -- )
|
: set-file-contents ( seq path encoding -- )
|
||||||
[ write ] with-file-writer ;
|
[ 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 ]
|
[ [ file-contents ] dip call ]
|
||||||
[ drop set-file-contents ] 3bi ; inline
|
[ drop set-file-contents ] 3bi ; inline
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue