summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/txr/stdlib/awk.tl7
-rw-r--r--txr.114
2 files changed, 20 insertions, 1 deletions
diff --git a/share/txr/stdlib/awk.tl b/share/txr/stdlib/awk.tl
index bb1dec1e..77d47703 100644
--- a/share/txr/stdlib/awk.tl
+++ b/share/txr/stdlib/awk.tl
@@ -99,7 +99,12 @@
[end-file-func aws])))))
(defmeth sys:awk-state prn (self . args)
- (put-string `@{(if args args self.rec) self.ofs}@{self.ors}`))
+ (cond
+ (args (for ((a args) next) (a) ((set a next))
+ (put-string `@(car a)`)
+ (put-string (if (set next (cdr a)) self.ofs self.ors))))
+ (t (put-string self.rec)
+ (put-string self.ors))))
(defun sys:awk-expander (clauses)
(let ((awc (new sys:awk-compile-time)))
diff --git a/txr.1 b/txr.1
index 2d8e181d..02f62750 100644
--- a/txr.1
+++ b/txr.1
@@ -37778,6 +37778,20 @@ then a call to
.code prn
with no arguments is the default action.
+Each argument
+.meta form
+is printed by conversion to a string, as if by the expression
+.code `@val`
+where
+.code val
+is some variable which holds the value produced by the
+evaluation of
+.metn form .
+Thus if the value is
+.codn nil ,
+the output for that argument is an empty string, rather than the text
+.strn nil .
+
.coNP Macro @ next
.synb
.mets (next)