factor/extra/benchmark/sum-file/sum-file.factor

15 lines
353 B
Factor
Raw Normal View History

2008-02-27 20:24:50 -05:00
USING: io io.files math math.parser kernel prettyprint
benchmark.random io.encodings.ascii ;
2007-09-20 18:09:08 -04:00
IN: benchmark.sum-file
: sum-file-loop ( n -- n' )
readln [ string>number + sum-file-loop ] when* ;
2007-11-25 00:50:12 -05:00
: sum-file ( file -- )
ascii [ 0 sum-file-loop ] with-file-reader . ;
2007-09-20 18:09:08 -04:00
: sum-file-main ( -- )
2008-02-27 20:24:50 -05:00
random-numbers-path sum-file ;
2007-09-20 18:09:08 -04:00
MAIN: sum-file-main