aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)