X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/1dd7dba9fd7f420f82fe6dec068f8925c87debd3..7d8d3a165fa725b686d1c89b78179a4d5705d11a:/doc/misc.tex?ds=inline

diff --git a/doc/misc.tex b/doc/misc.tex
index 51767f6..859ec51 100644
--- a/doc/misc.tex
+++ b/doc/misc.tex
@@ -505,6 +505,15 @@ be implemented fairly easily using @|merge-lists| below.
   the partial order.
 \end{describe}
 
+\begin{describe}{fun}{cross-product \&rest @<pieces>}
+  Return the cross product of the @<pieces>.
+
+  Each arguments may be a list, or a (non-nil) atom, which is equivalent to a
+  singleton list containing just that atom.  Return a list of all possible
+  lists which can be constructed by taking one item from each argument list
+  in turn, in an arbitrary order.
+\end{describe}
+
 \begin{describe}{fun}
     {find-duplicates @<report> @<sequence> \&key :key :test}
   Call @<report> on each pair of duplicate items in a @<sequence>.
@@ -513,9 +522,14 @@ be implemented fairly easily using @|merge-lists| below.
   and $y$ are considered equal if and only if @|(funcall @<test> (funcall
   @<key> $x$) (funcall @<key> $y$))| returns non-nil.
 
+  The @<report> function is called as @|(funcall @<report> @<duplicate>
+  @<previous>)|.  Duplicates are reported in order; the @<previous> item is
+  always the first matching item in the sequence.
+
   This function will work for arbitrary @<test> functions, but it will run
-  much more efficiently if @<test> is @|eq|, @|eql|, @|equal|, or @|equalp|
-  (because it can use hash-tables).
+  much more efficiently if @<test> is @|eq|, @|eql|, @|equal|, or @|equalp|,
+  because it can use hash-tables.  (The generic implementation for lists is
+  especially inefficient.)
 \end{describe}
 
 
