diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-10 06:46:40 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-10 06:46:40 -0700 |
commit | e046e1890f4655478a99fa7c1cb078eefdc54e00 (patch) | |
tree | 29f3aec8a500b6113534457fbf593577389bfb8b /txr.1 | |
parent | 0f55e4b727694c0c926ef0979f11b438edccc675 (diff) | |
download | txr-e046e1890f4655478a99fa7c1cb078eefdc54e00.tar.gz txr-e046e1890f4655478a99fa7c1cb078eefdc54e00.tar.bz2 txr-e046e1890f4655478a99fa7c1cb078eefdc54e00.zip |
Bugfix: make self-path visible to Lisp.
The self-path variable is not bound in TXR Lisp scripts
or the command line.
* txr.c (txr_main): Set self-path to "cmdline-expr" before
command line Lisp evaluations. (For TXR pattern language
syntax invoked in a -c, it continues to be "cmdline").
Set self-path to the file name when reading a Lisp file.
Also, the legacy, undocumented *self-path* is only set
for TXR scripts, and is reverted to being a special variable,
not a global lexical.
* txr.1: Documented self-path in more detail.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -33101,6 +33101,27 @@ processing; they will be processed in a later garbage collection pass. .coNP Variable @ self-path .desc This variable holds the invocation path name of the \*(TX program. +The value of +.code self-path +when \*(TL expressions are being evaluated in command line arguments +is the string +.strn cmdline-expr . +The value of +.code self-path +when a \*(TX query is supplied on the command line via the +.code -c +command line option is the string +.strn cmdline . + +Note that for programs read from a file, +.code self-path +holds the resolved name, and not the invocation name. For instance if +.code foo.tl +is invoked using the name +.codn foo , +whereby \*(TX infers the suffix, then +.code self-path +holds the suffixed name. .coNP Variable @ stdlib The |