Thank for the answers.
Trying to recur with '(recur (.read bfr))' resulted in a:
Syntax error (UnsupportedOperationException) compiling recur at
(*cider-repl ~:localhost:41097(clj)*:237:9).
Can only recur from tail position
So I changed the code (see below).
And now it complains that a previous form that was working '(.append
etc..') doesn't and the same error remains.
user> (pt5 myfile)
Execution error (IllegalArgumentException) at java.lang.Character/toChars
(Character.java:8572).
Not a valid Unicode code point: 0xFFFFFFFF
(defn pt5 [file]
(let [afr (FileReader. file); instances of FileReader, BufferedReader,
StringBuffer
bfr (BufferedReader. afr)
ct (StringBuilder.)
this-list (list afr bfr ct)]
; (apply println this-list)
(loop [val (.read bfr)]
(when (not (= val -1))
(.append ct (Character/toChars (.read bfr))))
(recur val))
; when finished...
(.toString ct)))
Harder then it seemed at first sight...
-- Hank
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/clojure/17bab821-c47d-4791-b3ad-c56df51757a1n%40googlegroups.com.