From b26b6b3fe00b94a2d4370b1afd2644034947b6b8 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 7 Jun 2022 10:02:14 +0100 Subject: Tweaks to MULTI_FUNC_DEF Output multiple function definitions using "function" form. Note exceptions to errors with NO_MULTI_FUNC_DEF --- Test/C04funcdef.ztst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Test') diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst index af469c527..b8509b25c 100644 --- a/Test/C04funcdef.ztst +++ b/Test/C04funcdef.ztst @@ -53,6 +53,26 @@ >b: redirection >a: redirection + define_multiple() { + fn1 fn2 fn3() { + print This is $0 + } + } + which -x2 define_multiple + define_multiple + fn1 + fn2 + fn3 +0: Safe output of multiple function definitions +>define_multiple () { +> function fn1 fn2 fn3 { +> print This is $0 +> } +>} +>This is fn1 +>This is fn2 +>This is fn3 + functions -M m1 m1() { (( $# )) } print $(( m1() )) -- cgit 1.4.1