From 847520da96836aaff641c4c82b87511fc65770c9 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 20 Mar 2021 14:03:34 -0700 Subject: add and export WITH-PRESERVE-HOSTATTRS Signed-off-by: Sean Whitton --- src/host.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/host.lisp') diff --git a/src/host.lisp b/src/host.lisp index 1eae634..b58c023 100644 --- a/src/host.lisp +++ b/src/host.lisp @@ -48,6 +48,14 @@ :hostattrs (copy-list (hostattrs host)) :propspec (host-propspec host))) +(defmacro with-preserve-hostattrs (&body forms) + "Evaluate FORMS then throw away any newly added hostattrs. +Useful in property combinators when you need to run some :HOSTATTRS +subroutines but ignore any new hostattrs they may push. Shouldn't be used in +properties." + `(let ((*host* (shallow-copy-host *host*))) + ,@forms)) + (defgeneric preprocess-host (host) (:documentation "Convert a host into a fresh preprocessed host if necessary, and -- cgit v1.2.3