commit 14c07143c6fd1c0d94f8f594a74d4ee8e3282e75
parent a9b31cb838bb07231758bb493f29126fbe458ad8
Author: lou woell <lou@repetitions.de>
Date:   Sun,  6 Sep 2026 10:10:14 +0200

reorder some functions

Diffstat:
Mlisp/ethics.lisp | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/lisp/ethics.lisp b/lisp/ethics.lisp @@ -22,6 +22,18 @@ :meta-data #p"../data/meta.json" :data-dir #p"../data")) +(defun read-version (key dir tbl) + (loop :with meta := nil + :for path :in (uiop:directory-files dir) + :as ftype := (pathname-type path) + :as fname := (pathname-name path) + :when (string= ftype "md") + :do (setf (gethash key (gethash fname tbl)) + (uiop:read-file-string path)) + :when (string= ftype "json") + :do (setf meta (jzon:parse path)) + :finally (return meta))) + (defun import-versions (config tbl) (loop :for path :in (uiop:subdirectories (getf config :data-dir)) :as fname := (car (last (pathname-directory path))) @@ -38,18 +50,6 @@ :into versions :finally (return (cons tbl versions)))) -(defun read-version (key dir tbl) - (loop :with meta := nil - :for path :in (uiop:directory-files dir) - :as ftype := (pathname-type path) - :as fname := (pathname-name path) - :when (string= ftype "md") - :do (setf (gethash key (gethash fname tbl)) - (uiop:read-file-string path)) - :when (string= ftype "json") - :do (setf meta (jzon:parse path)) - :finally (return meta))) - (defun get-nodes (tbl nodes) (when nodes (loop :with res := (make-array (length nodes) :fill-pointer 0)