X-Git-Url: http://git.kpe.io/?p=lml.git;a=blobdiff_plain;f=files.lisp;h=fe3c4261a85004f4cd08d6245e728127ed979af5;hp=cf1633f736eb1d63a2811f00989bb92d3d4bf285;hb=b9f59638a12167ca983c8989e48d162cc9f48772;hpb=fdc89fb00113b41b9fcee574184278b8f8e4a962 diff --git a/files.lisp b/files.lisp index cf1633f..fe3c426 100644 --- a/files.lisp +++ b/files.lisp @@ -23,24 +23,23 @@ (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))