r10297: Automated commit for Debian build of lml upstream-version-2.5.3
[lml.git] / files.lisp
index bdf4e96ca1481193fc621f30940f478e106f6173..fe3c4261a85004f4cd08d6245e728127ed979af5 100644 (file)
@@ -14,8 +14,7 @@
 ;;;; (http://www.gnu.org/licenses/gpl.html)
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :lml)
+(in-package #:lml)
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defvar *output-dir* nil)
 
 (defvar *html-output* *standard-output*)
 
-(defmacro lml-file-name (file &optional (type :source))
-  (let ((f file))
-    (when (and (consp f) (eql (car f) 'cl:quote))
-      (setq f (cadr f)))
-    (when (symbolp f)
-      (setq f (string-downcase (symbol-name f))))
-    (when (stringp f)
-      (unless (position #\. f)
-       (setq f (concatenate 'string f ".html"))))
-    (if *sources-dir*
-       (make-pathname :defaults (ecase type
-                                  (:source *sources-dir*)
-                                  (:output *output-dir*))
-                      :name `,(pathname-name f)
-                      :type `,(pathname-type f))
+(defun lml-file-name (f &optional (type :source))
+  (when (and (consp f) (eql (car f) 'cl:quote))
+    (setq f (cadr f)))
+  (when (symbolp f)
+    (setq f (string-downcase (symbol-name f))))
+  (when (stringp f)
+    (unless (position #\. f)
+      (setq f (concatenate 'string f ".html"))))
+  (if *sources-dir*
+      (make-pathname :defaults (ecase type
+                                (:source *sources-dir*)
+                                (:output *output-dir*))
+                    :name (pathname-name f)
+                    :type (pathname-type f))
       (if (stringp f)
-         (parse-namestring f)
-       f))))
+         (nth-value 0 (parse-namestring f))
+         f)))
 
 (defmacro with-dir ((output &key sources) &body body)
   (let ((output-dir (gensym))
@@ -61,8 +59,8 @@
 (defun lml-load-path (file)
   (if (probe-file file)
       (with-open-file (in file :direction :input)
-        (do ((form (read in nil 'lml::eof) (read in nil 'lml::eof)))
-           ((eq form 'lml::eof))
+        (do ((form (read in nil 'eof) (read in nil 'eof)))
+           ((eq form 'eof))
          (eval form)))
     (format *trace-output* "Warning: unable to load LML file ~S" file)))