diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-04-14 21:04:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-04-14 21:04:00 -0700 |
commit | 8e5bc6f8e7cdd2ece0a5da310fd4c3118eec3cf0 (patch) | |
tree | 875c2b8a434f7688d4049effd48d19864756f1a8 /cppawk-cons.1 | |
parent | 186a378870e2ceaad4cb167d0d24d4d0a3a9bb8e (diff) | |
download | cppawk-8e5bc6f8e7cdd2ece0a5da310fd4c3118eec3cf0.tar.gz cppawk-8e5bc6f8e7cdd2ece0a5da310fd4c3118eec3cf0.tar.bz2 cppawk-8e5bc6f8e7cdd2ece0a5da310fd4c3118eec3cf0.zip |
cons: document member function and add tests.
Diffstat (limited to 'cppawk-cons.1')
-rw-r--r-- | cppawk-cons.1 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/cppawk-cons.1 b/cppawk-cons.1 index a39b563..23302e0 100644 --- a/cppawk-cons.1 +++ b/cppawk-cons.1 @@ -1292,6 +1292,44 @@ and so forth. listar(1, 2, 3, list(4, 5, 6)) -> (1 2 3 4 5 6) .ft R +.SS Function \fImember\fP +.bk +.B Syntax: + +.ftB + member(y, x) +.ft R + +.B Description + +The +.B member +function returns the longest suffix of list +.I x +whose first element is +.B equal +to +.IR y . + +If +.I x +does not contain an item +.B equal +to +.IR y , +then +.B member +returns +.BR nil . + +.B Examples: + +.ft B + member(2, list(1, 2, 3)) -> (2 3) + member("a", list("a", "b", "c")) -> ("a" "b" "c") + member("a", list("c", "d")) -> nil +.ft R + .SH "SEE ALSO" cppawk(1) |