(load "modules")

(flet ((load-module (name)
         (dolist (type '(:q :n))
           (load (format nil "my-class-lists/~(~A/~A~)-names" name type))))
       (append-module-classes (module type)
         (let ((var (intern (format nil "*~A-NAMES*" type))))
           (setf (symbol-value var)
                 (append (symbol-value (intern (format nil "*~A-~A-NAMES*" module type)))
                         (symbol-value var)))))
       (sort-names (names)
         (sort (remove-duplicates names :test 'string=)
               'string<
               :key (lambda (str) (string-trim "=/" str)))))
  (dolist (module (cons :gui *modules*))
    (load-module module))
  (dolist (module *modules*)
    (dolist (type '(:q :n))
      (append-module-classes module type)))
  (setf *q-names* (sort-names *q-names*)
        *n-names* (sort-names *n-names*)))
