Commit 50a37142cf7a9c388b9ddd2bcfeb8f354cf1ca97

Thomas de Grivel 2020-04-13T03:07:17

fail with error if include file not found

diff --git a/core/include.lisp b/core/include.lisp
index 0b1ae78..9690eac 100644
--- a/core/include.lisp
+++ b/core/include.lisp
@@ -26,12 +26,17 @@
     (try spec)
     (try spec ".adams")))
 
+(defun include/resolve-filename! (spec)
+  (or (include/resolve-filename spec)
+      (error "(include ~S) => file not found.~%
+Current directory : ~S" source *default-pathname-defaults*)))
+
 (defun include (&rest sources)
   (let* ((head (cons 'list nil))
          (tail head)
          (eof (gensym "EOF")))
     (dolist (source sources)
-      (let ((path (include/resolve-filename source)))
+      (let ((path (include/resolve-filename! source)))
         (with-open-file (in path
                             :element-type 'character
                             :external-format :utf-8)