Changes for clojure.core/with-open

zkim on Sun, 26 Sep 2010
;; Opens the file 'myfile.txt' and prints out the contents.  The 
;; 'with-open' ensures that the reader is closed at the end of the 
;; form.  
;; 
;; Please note that reading a file a character at a time is not 
;; very efficient.

user=> (with-open [r (java.io.FileReader. "myfile.txt")] 
         (loop [c (.read r)] 
           (if (not= c -1)
             (do 
               (print (char c)) 
               (recur (.read r))))))
zkim on Sun, 26 Sep 2010
;; Opens the file 'myfile.txt' and prints out the contents.  The 
;; 'with-open' ensures that the reader is closed at the end of the 
;; form.  
;; 
;; Please note that reading a file a character at a time is not 
;; very efficient.

(with-open [r (java.io.FileReader. "myfile.txt")] 
	(loop [c (.read r)] 
		(if (not= c -1)
			(do 
				(print (char c)) 
				(recur (.read r))))))
gstamp on Mon, 16 Aug 2010
Opens the file 'myfile.txt' and prints out the contents.  The with-open ensures that the reader is closed at the end of the form.  Please note that reading a file a character at a time is not very efficient.

(with-open [r (java.io.FileReader. "myfile.txt")] 
	(loop [c (.read r)] 
		(if (not= c -1)
			(do 
				(print (char c)) 
				(recur (.read r))))))