summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/txr/stdlib/compiler.tl5
-rw-r--r--txr.16
2 files changed, 9 insertions, 2 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 441f2c5e..233ef129 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -1662,7 +1662,10 @@
(out (new list-builder)))
(iflet ((line (get-line in-stream))
((starts-with "#!" line)))
- (put-line line out-stream)
+ (progn
+ (set line `@line `)
+ (upd line (regsub #/--lisp[^\-]/ (ret `--compiled@[@1 -1]`)))
+ (put-line (butlast line) out-stream))
(seek-stream in-stream 0 :from-start))
(labels ((compile-form (unex-form)
(let ((form (macroexpand unex-form)))
diff --git a/txr.1 b/txr.1
index 51c0f39f..72cbdbce 100644
--- a/txr.1
+++ b/txr.1
@@ -65461,7 +65461,11 @@ circular structures are reproduced.
When a source file begins with the
.code #!
("hash-bang") character sequence, the file compiler propagates that
-line to the compiled file, verbatim.
+line (all characters up to and including the terminating newline) to the
+compiled file, subject to the following transformation: occurrences of
+.str --lisp
+which are not followed by a dash are replaced with
+.strn --compiled .
\*(TX supports the hash bang mechanism in compiled
.code .tlo