Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \* read a string from stream (EOF and #10 are delimitters) *\
- (define read-string
- {(stream in)--> string}
- Stream -> (let Byte (read-byte Stream)
- (if (or (= Byte -1) (= Byte 10))
- ""
- (cn (n->string Byte) (read-string-from-file Stream)))))
- \* read list of strings from stream *\
- (define read-strings-from-stream
- {(stream in) --> (list string)}
- Stream -> (let Str (read-string-from-file Stream)
- (if (= Str "")
- []
- [ Str | (read-text-stream Stream) ])))
- \* read list of strings from file *\
- (define read-text-file
- {string --> (list string)}
- Path -> (read-strings-from-stream (open file Path in)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement