From 41147ee732158df937f871a37814ec3208e105ae Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 6 Jun 2010 23:21:24 +0200 Subject: [PATCH] add current-source-location * module/ice-9/boot-9.scm (current-source-location): New macro, returns the, um, current source location. --- module/ice-9/boot-9.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index 4cad4bbb0..638111112 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -461,6 +461,14 @@ If there is no handler at all, Guile prints an error and then exits." (include-from-path "ice-9/quasisyntax") +(define-syntax current-source-location + (lambda (x) + (syntax-case x () + ((_) + (with-syntax ((s (datum->syntax x (syntax-source x)))) + #''s))))) + + ;;; {Defmacros}