aboutsummaryrefslogtreecommitdiffstats
path: root/cppawk-fun.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-21 19:21:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-21 19:21:21 -0700
commit2a17e1010bb973323601346456db227bc5475d5f (patch)
treed5427c976932bc1c1fc5e8f4d71ec16c5e77813d /cppawk-fun.1
parent6d53169644fb83f367f01369ec01f0ccf297b4cd (diff)
downloadcppawk-2a17e1010bb973323601346456db227bc5475d5f.tar.gz
cppawk-2a17e1010bb973323601346456db227bc5475d5f.tar.bz2
cppawk-2a17e1010bb973323601346456db227bc5475d5f.zip
cppawk-fun man page: ITER in header, missing example.
Diffstat (limited to 'cppawk-fun.1')
-rw-r--r--cppawk-fun.128
1 files changed, 25 insertions, 3 deletions
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 <fun.h>
+
+ 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)