-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
root.lisp
27 lines (20 loc) · 944 Bytes
/
root.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(in-package #:definitions-systems)
(defclass defsys:root-system (defsys:system) ())
(defclass defsys:location-mixin ()
((%location :initarg :location
:initform nil)))
(defgeneric defsys:location (system &key)
(:method :around (system &key (errorp t))
(or (call-next-method)
(when errorp
(error "There is no ~S for system ~S." 'defsys:location system))))
(:method ((system defsys:location-mixin) &key)
(slot-value system '%location)))
(defmethod make-load-form ((mixin defsys:location-mixin) &optional environment)
(declare (ignore environment))
(or (defsys:location mixin :errorp nil)
(call-next-method)))
(defclass defsys:standard-root-system (defsys:location-mixin defsys:root-system defsys:standard-system) ())
(defvar *root-system* (make-instance 'defsys:standard-root-system :name 'defsys:system :location '(defsys:root-system)))
(defun defsys:root-system ()
*root-system*)