PPT Slide
FILE I/O WITH ITERATION
( with--open--file
( < stream name >
< file specs >
:direction < :input or :output > )
< sequence of forms > )
( setf L NIL )
( with--open--file ( fi ''myinput.lsp''
:direction :input )
( dotimes ( i 10 )
( setf val ( read fi ) )
( setf L ( cons val L ) ) ) )
( with--open--file ( fo ''myoutput.lsp''
:direction :output )
( dolist ( q L ) ( print q fo ) ) )
1.46
Previous slide
Back to first slide
View graphic version