Compile with ECL, and compile time templates with SBCL

This commit is contained in:
2026-07-04 21:39:18 +03:00
parent 4b1c0b146c
commit c00d9947b7
6 changed files with 38 additions and 10 deletions
+18 -3
View File
@@ -135,9 +135,14 @@
`((format ,stream-sym "~&||#~%~%")))))))
(defmethod license-generate-writer ((license <license>) &optional commented)
(uiop:if-let (template (license-read-template license))
(setf (license-writer license)
(compile nil (template-generate-writer template commented)))))
(format *error-output* "~&Loading template ~S... " (license-find-template license))
(finish-output *error-output*)
(let ((template (license-read-template license)))
(unless (null template)
(setf (license-writer license)
(compile nil (template-generate-writer template commented)))
(format *error-output* "ok~%")
(license-writer license))))
(defmethod license-ensure-writer ((license <license>) &optional commented)
(with-slots (writer) license
@@ -145,3 +150,13 @@
writer
(license-generate-writer license commented))))
(defun templates-keywords-list ()
(loop :for key :being :the :hash-keys :of *licenses*
:collect key))
(defun load-templates (&optional (templates (templates-keywords-list)))
(loop :for key :in templates
:do (license-ensure-writer (get-license key))
(let ((notice (get-notice key)))
(unless (null notice)
(license-ensure-writer notice)))))
+2 -1
View File
@@ -2,4 +2,5 @@
(:use :cl)
(:export #:start
#:*default-author*
#:*default-license*))
#:*default-license*
#:load-templates))