Commit 44b673e70f9ae9269bf858b993ccad9e3aa5f3d7

Thomas de Grivel 2020-04-14T15:00:50

allow path parts using str in read-file

diff --git a/core/helpers.lisp b/core/helpers.lisp
index d4f6527..f72ac9b 100644
--- a/core/helpers.lisp
+++ b/core/helpers.lisp
@@ -18,12 +18,13 @@
 
 (in-package :adams)
 
-(defun read-file (path)
-  (with-output-to-string (out)
-    (with-open-file (stream path :element-type 'character)
-      (let ((buf (make-string 4096)))
-        (loop
-           (let ((size (read-sequence buf stream)))
-             (when (zerop size)
-               (return))
-             (write-sequence buf out :end size)))))))
+(defun read-file (&rest path-parts)
+  (let ((path (str path-parts)))
+    (with-output-to-string (out)
+      (with-open-file (stream path :element-type 'character)
+        (let ((buf (make-string 4096)))
+          (loop
+             (let ((size (read-sequence buf stream)))
+               (when (zerop size)
+                 (return))
+               (write-sequence buf out :end size))))))))