From 2a17e1010bb973323601346456db227bc5475d5f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 21 Apr 2022 19:21:21 -0700 Subject: cppawk-fun man page: ITER in header, missing example. --- cppawk-fun.1 | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'cppawk-fun.1') diff --git a/cppawk-fun.1 b/cppawk-fun.1 index a1a143c..47ad4ca 100644 --- a/cppawk-fun.1 +++ b/cppawk-fun.1 @@ -28,7 +28,7 @@ .IP " " .PP .. -.TH CPPAWK-ITER 1 "19 April 2022" "cppawk Libraries" "Indirect Functions" +.TH CPPAWK-FUN 1 "19 April 2022" "cppawk Libraries" "Indirect Functions" .SH NAME fun \- indirect function macros for cppawk (requiring GNU Awk) @@ -85,9 +85,31 @@ will be the remaining arguments. .B Example .ft B - - + #include + + function add(\fIx\fB, \fIy\fB) + { + return \fIx\fB + \fIy\fB + } + + BEGIN { + \fIfn\fB = bind(3, add) + + print call(\fIfn\fB, 4) \fI// prints 7\fB + } .ft R + +See the documentation for +.B mapcar +and +.B mappend +in the +.I cppawk-cons +manual page for more examples of +.B bind +as well as +.BR fun . + .SH "SEE ALSO" cppawk(1), cppawk-cons(1) -- cgit v1.2.3