From 873f9fd2771a59c1f24d37b389d2e98107fd109d Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sat, 27 Jun 2015 13:34:36 +0200 Subject: [PATCH] Issue 4474/5: Provide with-location macro --- scm/lily.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scm/lily.scm b/scm/lily.scm index 90e85c8db1..ff5d66dfed 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -51,6 +51,9 @@ ;; No public setters: should not get overwritten in action (define-public (*parser*) (fluid-ref %parser)) (define-public (*location*) (fluid-ref %location)) +;; but properly scoped location should be fine +(defmacro-public with-location (loc . body) + `(with-fluids ((,%location ,loc)) ,@body)) ;; It would be nice to convert occurences of parser/location to ;; (*parser*)/(*location*) using the syncase module but it is utterly -- 2.39.5