summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-04 07:34:57 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-04 07:34:57 -0700
commit6145de93b37a2366c509161a953448d36ef32266 (patch)
tree4b01be3f55eee017614a7f4b20e09bff388ba3d4
parentef9ffd26a24c4fe61f7960a00126c1d0cb16f355 (diff)
downloadtxr-6145de93b37a2366c509161a953448d36ef32266.tar.gz
txr-6145de93b37a2366c509161a953448d36ef32266.tar.bz2
txr-6145de93b37a2366c509161a953448d36ef32266.zip
awk: relax restriction on :name.
* share/txr/stdlib/awk.tl (sys:awk-expander): Do not impose stricter restrictions on :name than the block mechanism itself. * txr.1: Documentation updated.
-rw-r--r--share/txr/stdlib/awk.tl4
-rw-r--r--txr.115
2 files changed, 9 insertions, 10 deletions
diff --git a/share/txr/stdlib/awk.tl b/share/txr/stdlib/awk.tl
index d92bfea8..6c85cb77 100644
--- a/share/txr/stdlib/awk.tl
+++ b/share/txr/stdlib/awk.tl
@@ -314,10 +314,6 @@
(awk-error "duplicate :name clauses"))
(when (or (atom actions) (cdr actions))
(awk-error "bad :name syntax"))
- (unless (car actions)
- (awk-error "null :name not permitted"))
- (unless (symbolp (car actions))
- (awk-error ":name must be a symbol"))
(set awc.name (car actions)))
(:let (push actions awc.lets))
(:begin (push actions awc.begin-actions))
diff --git a/txr.1 b/txr.1
index 0a7a365b..e3d7c364 100644
--- a/txr.1
+++ b/txr.1
@@ -58969,17 +58969,20 @@ and
The following is a description of the special clauses:
.RS
-.meIP (:name << sym )
+.meIP (:name << obj )
The
.code :name
clause establishes the name of the implicit block contained
within the expansion of the
.code awk
-macro. Forms enclosed in the macro can use
+macro to be the object
+.metn obj ,
+usually a symbol.
+Forms enclosed in the macro can use
.code return-from
to abandon the
.code awk
-form, specifying this symbol as the argument.
+form, specifying the same object as the argument.
If the
.code :name
@@ -58990,10 +58993,10 @@ It is an error for two or more
.code :name
forms to appear.
-The
+Note: in \*(TX 255 and older, the
.code :name
-clause must have an argument which is a symbol;
-the symbol
+clause must have an argument which is a symbol.
+The symbol
.code nil
is not permitted.