r8595: changes for lml2 rework
[kmrcl.git] / io.lisp
diff --git a/io.lisp b/io.lisp
index 292af3c68382cc23da07f6603a1d89ee13a84c72..d4c50ef6b28a5e93c960558ffc18fbbcf3b4fc55 100644 (file)
--- a/io.lisp
+++ b/io.lisp
 (defun print-file-contents (file &optional (strm *standard-output*))
   "Opens a reads a file. Returns the contents as a single string"
   (when (probe-file file)
-    (with-open-file (in file :direction :input)
-      (let ((eof (gensym)))                
-       (do ((line (read-line in nil eof) 
-                  (read-line in nil eof)))
-           ((eq line eof))
-         (format strm "~A~%" line))))))
+    (let ((eof (cons 'eof nil)))
+      (with-open-file (in file :direction :input)
+        (do ((line (read-line in nil eof) 
+                   (read-line in nil eof)))
+            ((eq line eof))
+          (write-string line strm)
+          (write-char #\newline strm))))))
 
 (defun read-file-to-string (file)
   "Opens a reads a file. Returns the contents as a single string"