manual: refresh moduleref macro (#8508)
parent
2cc1ea26b9
commit
798dc35c9e
3
Changes
3
Changes
|
@ -607,6 +607,9 @@ OCaml 4.08.0
|
|||
- GPR#2187: document "exception A | pat" patterns
|
||||
(Florian Angeletti, review by Perry E. Metzger and Jeremy Yallop)
|
||||
|
||||
- GPR#8508: refresh \moduleref macro
|
||||
(Florian Angeletti, review by Gabriel Scherer)
|
||||
|
||||
### Compiler distribution build system:
|
||||
|
||||
- GPR#1776: add -no-install-bytecode-programs and related configure options to
|
||||
|
|
|
@ -1797,7 +1797,7 @@ default comparison function simply raises "Failure".
|
|||
|
||||
\item "intnat (*hash)(value v)" \\
|
||||
The "hash" field contains a pointer to a C function that is called
|
||||
whenever OCaml's generic hash operator (see module "Hashtbl") is
|
||||
whenever OCaml's generic hash operator (see module \stdmoduleref{Hashtbl}) is
|
||||
applied to a custom block. The C function can return an arbitrary
|
||||
integer representing the hash value of the data contained in the
|
||||
given custom block. The hash value must be compatible with the
|
||||
|
|
|
@ -104,7 +104,7 @@ type int32
|
|||
\begin{ocamldocdescription}
|
||||
The type of signed 32-bit integers.
|
||||
Literals for 32-bit integers are suffixed by l.
|
||||
See the "Int32"[\moduleref{Int32}] module.
|
||||
See the \stdmoduleref{Int32} module.
|
||||
\end{ocamldocdescription}
|
||||
|
||||
\begin{ocamldoccode}
|
||||
|
@ -114,7 +114,7 @@ type int64
|
|||
\begin{ocamldocdescription}
|
||||
The type of signed 64-bit integers.
|
||||
Literals for 64-bit integers are suffixed by L.
|
||||
See the "Int64"[\moduleref{Int64}] module.
|
||||
See the \stdmoduleref{Int64} module.
|
||||
\end{ocamldocdescription}
|
||||
|
||||
\begin{ocamldoccode}
|
||||
|
@ -125,7 +125,7 @@ type nativeint
|
|||
The type of signed, platform-native integers (32 bits on 32-bit
|
||||
processors, 64 bits on 64-bit processors).
|
||||
Literals for native integers are suffixed by n.
|
||||
See the "Nativeint"[\moduleref{Nativeint}] module.
|
||||
See the \stdmoduleref{Nativeint} module.
|
||||
\end{ocamldocdescription}
|
||||
|
||||
\begin{ocamldoccode}
|
||||
|
@ -136,13 +136,12 @@ type ('a, 'b, 'c, 'd, 'e, 'f) format6
|
|||
The type of format strings. "'a" is the type of the parameters of
|
||||
the format, "'f" is the result type for the "printf"-style
|
||||
functions, "'b" is the type of the first argument given to "%a" and
|
||||
"%t" printing functions (see module "Printf"[\moduleref{Printf}]),
|
||||
"%t" printing functions (see module \stdmoduleref{Printf}),
|
||||
"'c" is the result type of these functions, and also the type of the
|
||||
argument transmitted to the first argument of "kprintf"-style
|
||||
functions, "'d" is the result type for the "scanf"-style functions
|
||||
(see module "Scanf"[\moduleref{Scanf}]),
|
||||
and "'e" is the type of the receiver function for the "scanf"-style
|
||||
functions.
|
||||
(see module \stdmoduleref{Scanf}), and "'e" is the type of the receiver function
|
||||
for the "scanf"-style functions.
|
||||
\end{ocamldocdescription}
|
||||
|
||||
\begin{ocamldoccode}
|
||||
|
@ -150,7 +149,7 @@ type 'a lazy_t
|
|||
\end{ocamldoccode}
|
||||
\index{lazyt@\verb`lazy_t`}
|
||||
\begin{ocamldocdescription}
|
||||
This type is used to implement the "Lazy"[\moduleref{Lazy}] module.
|
||||
This type is used to implement the \stdmoduleref{Lazy} module.
|
||||
It should not be used directly.
|
||||
\end{ocamldocdescription}
|
||||
|
||||
|
|
|
@ -198,3 +198,6 @@
|
|||
{\enditemize}
|
||||
|
||||
\newenvironment{maintitle}{\@open{div}{class="maintitle"}}{\@close{div}}
|
||||
|
||||
%%% References to modules in the standard library
|
||||
\newcommand{\stdmoduleref}[1]{\ahref{libref/#1.html}{\texttt{#1}}}
|
|
@ -200,9 +200,8 @@
|
|||
\addcontentsline{toc}{chapter}{#2}
|
||||
\@input{#1.ind}}
|
||||
|
||||
%%% Pour les references des modules
|
||||
\newcommand{\moduleref}[1]{\ref{#1}}
|
||||
%%% Fin des hacks
|
||||
%%% References to modules in the standard library
|
||||
\newcommand{\stdmoduleref}[1]{\hyperref[#1]{\texttt{#1}}[\ref{#1}]}
|
||||
|
||||
\newenvironment{maintitle}{\begin{center}}{\end{center}}
|
||||
|
||||
|
|
|
@ -820,9 +820,7 @@ variable @inst-var-name@, which must be mutable. The whole expression
|
|||
\subsubsection*{Object duplication}
|
||||
|
||||
An object can be duplicated using the library function "Oo.copy"
|
||||
(see
|
||||
\ifouthtml \ahref{libref/Oo.html}{Module \texttt{Oo}}\else
|
||||
section~\ref{Oo}\fi). Inside a method, the expression
|
||||
(see module \stdmoduleref{Oo}). Inside a method, the expression
|
||||
@ '{<' [inst-var-name ['=' expr] { ';' inst-var-name ['=' expr] }] '>}'@
|
||||
returns a copy of self with the given instance variables replaced by
|
||||
the values of the associated expressions. A single instance variable
|
||||
|
|
|
@ -1313,8 +1313,7 @@ expr:
|
|||
\end{syntax}
|
||||
|
||||
This extension provides syntactic sugar for getting and setting
|
||||
elements in the arrays provided by the
|
||||
"Bigarray"[\moduleref{Bigarray}] library.
|
||||
elements in the arrays provided by the \stdmoduleref{Bigarray} module.
|
||||
|
||||
The short expressions are translated into calls to functions of the
|
||||
"Bigarray" module as described in the following table.
|
||||
|
|
|
@ -197,9 +197,7 @@ contain @"lazy"@ sub-patterns may imply forcing parts of the value,
|
|||
even when the pattern selected in the end has no @"lazy"@ sub-pattern.
|
||||
|
||||
For more information, see the description of module "Lazy" in the
|
||||
standard library (
|
||||
\ifouthtml
|
||||
\ahref{libref/Lazy.html}{Module \texttt{Lazy}}\else section~\ref{Lazy}\fi).
|
||||
standard library (module \stdmoduleref{Lazy}).
|
||||
%
|
||||
\index{Lazy (module)\@\verb`Lazy` (module)}%
|
||||
\index{force\@\verb`force`}%
|
||||
|
|
|
@ -604,8 +604,7 @@ internal type name, so the type "'a Lazy.t" should be preferred when possible.
|
|||
|
||||
When we finally need the result of a lazy expression, we can call "Lazy.force"
|
||||
on that expression to force its evaluation. The function "force" comes from
|
||||
standard-library module
|
||||
\href{https://caml.inria.fr/pub/docs/manual-ocaml/libref/Lazy.html}{"Lazy"}.
|
||||
standard-library module \stdmoduleref{Lazy}.
|
||||
|
||||
\begin{caml_example}{toplevel}
|
||||
Lazy.force lazy_two;;
|
||||
|
@ -753,9 +752,8 @@ print_expr (deriv e "x"); print_newline ();;
|
|||
|
||||
\section{Printf formats}
|
||||
|
||||
There is a "printf" function in
|
||||
\href{https://caml.inria.fr/pub/docs/manual-ocaml/libref/Printf.html}{Printf}
|
||||
module (see chapter~\ref{c:moduleexamples}) that allows you to make formatted
|
||||
There is a "printf" function in the \stdmoduleref{Printf} module
|
||||
(see chapter~\ref{c:moduleexamples}) that allows you to make formatted
|
||||
output more concisely.
|
||||
It follows the behavior of the "printf" function from the C standard library.
|
||||
The "printf" function takes a format string that describes the desired output
|
||||
|
|
|
@ -14,7 +14,5 @@
|
|||
{\endocamldocindent
|
||||
\noindent\quad\texttt{end}\medskip}
|
||||
|
||||
\newcommand{\moduleref}[1]{\ifhtml\ahref{libref/#1.html}{\texttt{#1}}\fi}
|
||||
|
||||
# For processing .tex generated by ocamldoc (for text manual)
|
||||
\newcommand{\ocamldocvspace}[1]{\vspace{#1}}
|
Loading…
Reference in New Issue