diff options
author | Andy Wingo <wingo@pobox.com> | 2012-01-21 00:08:17 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-01-21 00:08:17 +0100 |
commit | 925172cf529a89f0c5fd81720718971f9059fcfd (patch) | |
tree | 82b9cdcb48b543d4fe4c900f15ac482402b908c2 /doc/ref/api-debug.texi | |
parent | fb01fd87729256ac9740a275ced1dd83dafadfdf (diff) | |
download | guile-925172cf529a89f0c5fd81720718971f9059fcfd.tar.gz |
add current-filename, add-to-path, add-to-load-path
* module/ice-9/boot-9.scm (current-filename, add-to-path)
(add-to-load-path): New syntaxen.
* doc/ref/api-evaluation.texi (Loading): Move load-path related
procedures to a new section:
(Load Paths): Hither. Document add-to-path and add-to-load-path.
* doc/ref/api-debug.texi (Source Properties): Document
current-source-location and current-filename.
* doc/ref/api-modules.texi:
* doc/ref/guile-invoke.texi:
* doc/ref/scheme-using.texi: Update @ref for Load Paths change.
Diffstat (limited to 'doc/ref/api-debug.texi')
-rw-r--r-- | doc/ref/api-debug.texi | 21 |
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: |