From edbba484918f6de83680a5b29e561fba981e05e9 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 29 May 2021 15:12:54 -0700 Subject: factor out ENSURE-HOST & call it in hostattrs accessors Signed-off-by: Sean Whitton --- src/host.lisp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/host.lisp') diff --git a/src/host.lisp b/src/host.lisp index a449d3c..50155c8 100644 --- a/src/host.lisp +++ b/src/host.lisp @@ -49,6 +49,13 @@ (:documentation "A host whose :PREPROCESS and :HOSTATTRS subroutines have not been run.")) +(defgeneric ensure-host (host) + (:documentation "Return the HOST value designated by HOST.") + (:method ((host host)) + host) + (:method ((hostname string)) + (make-host :hostattrs `(:hostname (,hostname))))) + (defmethod shallow-copy-host ((host host)) (make-instance (type-of host) :hostattrs (copy-list (hostattrs host)) -- cgit v1.2.3