summaryrefslogtreecommitdiff
path: root/doc/ref/api-debug.texi
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-01-30 18:52:46 +0100
committerAndy Wingo <wingo@pobox.com>2012-01-30 18:52:46 +0100
commit252acfe8e70ac4c7d325588ffea1905fcf6f86b2 (patch)
treee31cae9d145548b86cba6764d0943329a4ef64d1 /doc/ref/api-debug.texi
parent855db1905d56efcdf91ae51a9e80990f79030eae (diff)
parent3d51e57cfb0404db568a6adfde2a346d3fd9907e (diff)
downloadguile-252acfe8e70ac4c7d325588ffea1905fcf6f86b2.tar.gz
Merge commit '3d51e57cfb0404db568a6adfde2a346d3fd9907e'
Conflicts: libguile/foreign.c libguile/hashtab.c module/ice-9/psyntax-pp.scm module/language/tree-il/compile-glil.scm
Diffstat (limited to 'doc/ref/api-debug.texi')
-rw-r--r--doc/ref/api-debug.texi21
1 files changed, 20 insertions, 1 deletions
diff --git a/doc/ref/api-debug.texi b/doc/ref/api-debug.texi
index bdb616656..2083daab6 100644
--- a/doc/ref/api-debug.texi
+++ b/doc/ref/api-debug.texi
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2010, 2011
+@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2010, 2011, 2012
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@@ -292,6 +292,25 @@ If the @code{positions} reader option is enabled, each parenthesized
expression will have values set for the @code{filename}, @code{line} and
@code{column} properties.
+Source properties are also associated with syntax objects. Procedural
+macros can get at the source location of their input using the
+@code{syntax-source} accessor. @xref{Syntax Transformer Helpers}, for
+more.
+
+Guile also defines a couple of convenience macros built on
+@code{syntax-source}:
+
+@deffn {Scheme Syntax} current-source-location
+Expands to the source properties corresponding to the location of the
+@code{(current-source-location)} form.
+@end deffn
+
+@deffn {Scheme Syntax} current-filename
+Expands to the current filename: the filename that the
+@code{(current-filename)} form appears in. Expands to @code{#f} if this
+information is unavailable.
+@end deffn
+
If you're stuck with defmacros (@pxref{Defmacros}), and want to preserve
source information, the following helper function might be useful to
you: