Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (import (java.io BufferedReader FileReader))
- (defn get-line
- [file-name line]
- (let [r (BufferedReader. (FileReader. file-name)) eof (Object.)]
- (nth (take-while #(not= eof %) (repeatedly #(read r false eof))) line))
- ; I want this function to take in a filen name and a line number and output the text in the file at that line.
- ; It has to be on Clojure 1.1.0 right now.
- ; Here's the error I am getting when I run it
- ;ClassCastException java.io.BufferedReader cannot be cast to java.io.PushbackReader clojure.core/read (core.clj:3346)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement