X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/b9d79c4c07134738b826dd84c80e2431e2a0d3c8..6afec9101d5ea87e3df4bda2239ffd05f8154fa6:/doc/misc.tex diff --git a/doc/misc.tex b/doc/misc.tex index 05cda1f..b7ed6e5 100644 --- a/doc/misc.tex +++ b/doc/misc.tex @@ -184,7 +184,7 @@ refer to the same place; but that doesn't work for these locatives. An anaphoric macro implicitly binds a well-known name to a value of interest, in the course of doing something else. The concept was popularized by Paul -Graham \cite{FIXME:OnLisp}. +Graham \cite{graham-1993:on-lisp}. The macros described here all bind the variable @|it|. @@ -505,6 +505,15 @@ be implemented fairly easily using @|merge-lists| below. the partial order. \end{describe} +\begin{describe}{fun}{cross-product \&rest @} + Return the cross product of the @. + + 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 @ @ \&key :key :test} Call @ on each pair of duplicate items in a @. @@ -513,9 +522,14 @@ be implemented fairly easily using @|merge-lists| below. and $y$ are considered equal if and only if @|(funcall @ (funcall @ $x$) (funcall @ $y$))| returns non-nil. + The @ function is called as @|(funcall @ @ + @)|. Duplicates are reported in order; the @ item is + always the first matching item in the sequence. + This function will work for arbitrary @ functions, but it will run - much more efficiently if @ is @|eq|, @|eql|, @|equal|, or @|equalp| - (because it can use hash-tables). + much more efficiently if @ is @|eq|, @|eql|, @|equal|, or @|equalp|, + because it can use hash-tables. (The generic implementation for lists is + especially inefficient.) \end{describe} @@ -867,6 +881,19 @@ The following definitions are useful when working with conditions. Dijkstra. \end{describe} + +\subsection{Other exported symbols} + +\begin{describe}{sym}{int} + The symbol @|int| is exported by the @|sod-utilities| package, without + giving it any particular meaning. This is done because it's given + non-conflicting meanings by two different packages, and it's more + convenient for user code not to have to deal with an unnecessary symbol + conflict. Specifically, the @|sod| package wants to define it as a C type + specifier, see \descref{cls}{simple-c-type}; and @|optparse| wants to + define it as an option handler, see \descref{opt}{int}. +\end{describe} + %%%-------------------------------------------------------------------------- \section{Option parser} \label{sec:misc.optparse} @@ -918,8 +945,8 @@ Most of these symbols are defined in the @|optparse| package. \dhead{fun}{setf (opt-negated-tag @