From d697931dcc4cf2f3888f54d01cd88f0aab21e41b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 4 Apr 2021 07:34:57 -0700 Subject: 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. --- share/txr/stdlib/awk.tl | 4 ---- txr.1 | 15 +++++++++------ 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. -- cgit v1.2.3