[PATCH] doc: Use the term "Procedure" for definitions.

  • Done
  • quality assurance status badge
Details
One participant
  • Ludovic Courtès
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal
L
L
Ludovic Courtès wrote on 2 Jun 2023 17:55
(address . guix-patches@gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
f96b56b25e4ff920d3e76543befe9b527aac8379.1685721273.git.ludo@gnu.org
In an effort to homogenize things, commit
3c40dfe2851dd4ef48d2711f9f3531c06afbe1f2 replaced:

@deffn {Scheme Procedure}

with:

@defun

However, the latter prints "Function" when all existing material about
Scheme uses the term "procedure".

Thus, for consistency, this commit switches to:

@deffn {Procedure}

* doc/guix.texi, doc/contributing.texi: Use "@deffn {Procedure}"
consistently rather than "@defun" or similar.
---
doc/contributing.texi | 12 +-
doc/guix.texi | 492 +++++++++++++++++++++---------------------
2 files changed, 252 insertions(+), 252 deletions(-)

Toggle diff (481 lines)
diff --git a/doc/contributing.texi b/doc/contributing.texi
index f692872c04..958fc44cbd 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -617,7 +617,7 @@ Version Numbers
)))
@end lisp
-@deffn {Scheme Procedure} git-version @var{VERSION} @var{REVISION} @var{COMMIT}
+@deffn {Procedure} git-version @var{VERSION} @var{REVISION} @var{COMMIT}
Return the version string for packages using @code{git-fetch}.
@lisp
@@ -626,7 +626,7 @@ Version Numbers
@end lisp
@end deffn
-@deffn {Scheme Procedure} hg-version @var{VERSION} @var{REVISION} @var{CHANGESET}
+@deffn {Procedure} hg-version @var{VERSION} @var{REVISION} @var{CHANGESET}
Return the version string for packages using @code{hg-fetch}. It works
in the same way as @code{git-version}.
@end deffn
@@ -970,7 +970,7 @@ Elm Packages
The module @code{(guix build-system elm)} provides the following utilities for
working with names and related conventions:
-@deffn {Scheme procedure} elm-package-origin @var{elm-name} @var{version} @
+@deffn {Procedure} elm-package-origin @var{elm-name} @var{version} @
@var{hash}
Returns a Git origin using the repository naming and tagging regime required
for a published Elm package with the upstream name @var{elm-name} at version
@@ -990,7 +990,7 @@ Elm Packages
@end lisp
@end deffn
-@deffn {Scheme procedure} elm->package-name @var{elm-name}
+@deffn {Procedure} elm->package-name @var{elm-name}
Returns the Guix-style package name for an Elm package with upstream name
@var{elm-name}.
@@ -998,13 +998,13 @@ Elm Packages
@code{elm->package-name} will produce a given result.
@end deffn
-@deffn {Scheme procedure} guix-package->elm-name @var{package}
+@deffn {Procedure} guix-package->elm-name @var{package}
Given an Elm @var{package}, returns the possibly-inferred upstream name, or
@code{#f} the upstream name is not specified via the @code{'upstream-name}
property and can not be inferred by @code{infer-elm-package-name}.
@end deffn
-@deffn {Scheme procedure} infer-elm-package-name @var{guix-name}
+@deffn {Procedure} infer-elm-package-name @var{guix-name}
Given the @var{guix-name} of an Elm package, returns the inferred upstream
name, or @code{#f} if the upstream name can't be inferred. If the result is
not @code{#f}, supplying it to @code{elm->package-name} would produce
diff --git a/doc/guix.texi b/doc/guix.texi
index 7f8d8d66e9..b194d4128a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5038,57 +5038,57 @@ Inferiors
The @code{(guix inferior)} module provides the following procedures to open an
inferior:
-@defun inferior-for-channels channels [#:cache-directory] [#:ttl]
+@deffn {Procedure} inferior-for-channels channels [#:cache-directory] [#:ttl]
Return an inferior for @var{channels}, a list of channels. Use the cache at
@var{cache-directory}, where entries can be reclaimed after @var{ttl} seconds.
This procedure opens a new connection to the build daemon.
As a side effect, this procedure may build or substitute binaries for
@var{channels}, which can take time.
-@end defun
+@end deffn
-@defun open-inferior directory [#:command "bin/guix"]
+@deffn {Procedure} open-inferior directory [#:command "bin/guix"]
Open the inferior Guix in @var{directory}, running
@code{@var{directory}/@var{command} repl} or equivalent. Return @code{#f} if
the inferior could not be launched.
-@end defun
+@end deffn
@cindex inferior packages
The procedures listed below allow you to obtain and manipulate inferior
packages.
-@defun inferior-packages inferior
+@deffn {Procedure} inferior-packages inferior
Return the list of packages known to @var{inferior}.
-@end defun
+@end deffn
-@defun lookup-inferior-packages inferior name [version]
+@deffn {Procedure} lookup-inferior-packages inferior name [version]
Return the sorted list of inferior packages matching @var{name} in
@var{inferior}, with highest version numbers first. If @var{version} is true,
return only packages with a version number prefixed by @var{version}.
-@end defun
+@end deffn
-@defun inferior-package? obj
+@deffn {Procedure} inferior-package? obj
Return true if @var{obj} is an inferior package.
-@end defun
+@end deffn
-@defun inferior-package-name package
-@defunx inferior-package-version package
-@defunx inferior-package-synopsis package
-@defunx inferior-package-description package
-@defunx inferior-package-home-page package
-@defunx inferior-package-location package
-@defunx inferior-package-inputs package
-@defunx inferior-package-native-inputs package
-@defunx inferior-package-propagated-inputs package
-@defunx inferior-package-transitive-propagated-inputs package
-@defunx inferior-package-native-search-paths package
-@defunx inferior-package-transitive-native-search-paths package
-@defunx inferior-package-search-paths package
+@deffn {Procedure} inferior-package-name package
+@deffnx {Procedure} inferior-package-version package
+@deffnx {Procedure} inferior-package-synopsis package
+@deffnx {Procedure} inferior-package-description package
+@deffnx {Procedure} inferior-package-home-page package
+@deffnx {Procedure} inferior-package-location package
+@deffnx {Procedure} inferior-package-inputs package
+@deffnx {Procedure} inferior-package-native-inputs package
+@deffnx {Procedure} inferior-package-propagated-inputs package
+@deffnx {Procedure} inferior-package-transitive-propagated-inputs package
+@deffnx {Procedure} inferior-package-native-search-paths package
+@deffnx {Procedure} inferior-package-transitive-native-search-paths package
+@deffnx {Procedure} inferior-package-search-paths package
These procedures are the counterpart of package record accessors
(@pxref{package Reference}). Most of them work by querying the inferior
@var{package} comes from, so the inferior must still be live when you call
these procedures.
-@end defun
+@end deffn
Inferior packages can be used transparently like any other package or
file-like object in G-expressions (@pxref{G-Expressions}). They are also
@@ -7719,7 +7719,7 @@ Defining Packages
The build actions it prescribes may then be realized by using the
@code{build-derivations} procedure (@pxref{The Store}).
-@defun package-derivation store package [system]
+@deffn {Procedure} package-derivation store package [system]
Return the @code{<derivation>} object of @var{package} for @var{system}
(@pxref{Derivations}).
@@ -7728,21 +7728,21 @@ Defining Packages
@code{"x86_64-linux"} for an x86_64 Linux-based GNU system. @var{store}
must be a connection to the daemon, which operates on the store
(@pxref{The Store}).
-@end defun
+@end deffn
@noindent
@cindex cross-compilation
Similarly, it is possible to compute a derivation that cross-builds a
package for some other system:
-@defun package-cross-derivation store package target [system]
+@deffn {Procedure} package-cross-derivation store package target [system]
Return the @code{<derivation>} object of @var{package} cross-built from
@var{system} to @var{target}.
@var{target} must be a valid GNU triplet denoting the target hardware
and operating system, such as @code{"aarch64-linux-gnu"}
(@pxref{Specifying Target Triplets,,, autoconf, Autoconf}).
-@end defun
+@end deffn
Once you have package definitions, you can easily define @emph{variants}
of those packages. @xref{Defining Package Variants}, for more on that.
@@ -7971,10 +7971,10 @@ package Reference
The following helper procedures are provided to help deal with package
inputs.
-@defun lookup-package-input package name
-@defunx lookup-package-native-input package name
-@defunx lookup-package-propagated-input package name
-@defunx lookup-package-direct-input package name
+@deffn {Procedure} lookup-package-input package name
+@deffnx {Procedure} lookup-package-native-input package name
+@deffnx {Procedure} lookup-package-propagated-input package name
+@deffnx {Procedure} lookup-package-direct-input package name
Look up @var{name} among @var{package}'s inputs (or native, propagated,
or direct inputs). Return it if found, @code{#f} otherwise.
@@ -7990,7 +7990,7 @@ package Reference
In this example we obtain the @code{gmp} package that is among the
direct inputs of @code{coreutils}.
-@end defun
+@end deffn
@cindex development inputs, of a package
@cindex implicit inputs, of a package
@@ -7999,7 +7999,7 @@ package Reference
package is compiled. This is what the @code{package-development-inputs}
procedure returns.
-@defun package-development-inputs package [system] [#:target #f]
+@deffn {Procedure} package-development-inputs package [system] [#:target #f]
Return the list of inputs required by @var{package} for development
purposes on @var{system}. When @var{target} is true, return the inputs
needed to cross-compile @var{package} from @var{system} to
@@ -8030,7 +8030,7 @@ package Reference
gzip, GCC, libc, Bash, and more. To visualize it, @command{guix graph
hello} would show you explicit inputs, whereas @command{guix graph -t
bag hello} would include implicit inputs (@pxref{Invoking guix graph}).
-@end defun
+@end deffn
Because packages are regular Scheme objects that capture a complete
dependency graph and associated build procedures, it is often useful to
@@ -8038,7 +8038,7 @@ package Reference
thereof according to some parameters. Below are a few examples.
@cindex tool chain, choosing a package's tool chain
-@defun package-with-c-toolchain package toolchain
+@deffn {Procedure} package-with-c-toolchain package toolchain
Return a variant of @var{package} that uses @var{toolchain} instead of
the default GNU C/C++ toolchain. @var{toolchain} must be a list of
inputs (label/package tuples) providing equivalent functionality, such
@@ -8059,7 +8059,7 @@ package Reference
procedure works by changing the build system of @var{package} so that it
pulls in @var{toolchain} instead of the defaults. @ref{Build Systems},
for more on build systems.
-@end defun
+@end deffn
@node origin Reference
@subsection @code{origin} Reference
@@ -8176,7 +8176,7 @@ origin Reference
download)} module provides the most common method, @code{url-fetch},
described below.
-@defun url-fetch url hash-algo hash [name] [#:executable? #f]
+@deffn {Procedure} url-fetch url hash-algo hash [name] [#:executable? #f]
Return a fixed-output derivation that fetches data from @var{url} (a
string, or a list of strings denoting alternate URLs), which is expected
to have hash @var{hash} of type @var{hash-algo} (a symbol). By default,
@@ -8189,19 +8189,19 @@ origin Reference
Alternatively, when URL starts with @code{file://}, return the
corresponding file name in the store.
-@end defun
+@end deffn
Likewise, the @code{(guix git-download)} module defines the
@code{git-fetch} origin method, which fetches data from a Git version
control repository, and the @code{git-reference} data type to describe
the repository and revision to fetch.
-@defun git-fetch ref hash-algo hash
+@deffn {Procedure} git-fetch ref hash-algo hash
Return a fixed-output derivation that fetches @var{ref}, a
@code{<git-reference>} object. The output is expected to have recursive
hash @var{hash} of type @var{hash-algo} (a symbol). Use @var{name} as
the file name, or a generic name if @code{#f}.
-@end defun
+@end deffn
@deftp {Data Type} git-reference
This data type represents a Git reference for @code{git-fetch} to
@@ -8244,12 +8244,12 @@ origin Reference
the @code{hg-fetch} origin method and @code{hg-reference} data type for
support of the Mercurial version control system.
-@defun hg-fetch ref hash-algo hash [name]
+@deffn {Procedure} hg-fetch ref hash-algo hash [name]
Return a fixed-output derivation that fetches @var{ref}, a
@code{<hg-reference>} object. The output is expected to have recursive
hash @var{hash} of type @var{hash-algo} (a symbol). Use @var{name} as
the file name, or a generic name if @code{#false}.
-@end defun
+@end deffn
@node Defining Package Variants
@section Defining Package Variants
@@ -8403,7 +8403,7 @@ Defining Package Variants
that directly maps to the more sophisticated package transformation
options (@pxref{Package Transformation Options}):
-@defun options->transformation opts
+@deffn {Procedure} options->transformation opts
Return a procedure that, when passed an object to build (package,
derivation, etc.), applies the transformations specified by @var{opts} and returns
the resulting objects. @var{opts} must be a list of symbol/string pairs such as:
@@ -8415,7 +8415,7 @@ Defining Package Variants
Each symbol names a transformation and the corresponding string is an argument
to that transformation.
-@end defun
+@end deffn
For instance, a manifest equivalent to this command:
@@ -8454,7 +8454,7 @@ Defining Package Variants
graph, is what the @code{package-input-rewriting} procedure in
@code{(guix packages)} implements.
-@defun package-input-rewriting replacements [rewrite-name] [#:deep? #t]
+@deffn {Procedure} package-input-rewriting replacements [rewrite-name] [#:deep? #t]
Return a procedure that, when passed a package, replaces its direct and
indirect dependencies, including implicit inputs when @var{deep?} is
true, according to @var{replacements}. @var{replacements} is a list of
@@ -8463,7 +8463,7 @@ Defining Package Variants
Optionally, @var{rewrite-name} is a one-argument procedure that takes
the name of a package and returns its new name after rewrite.
-@end defun
+@end deffn
@noindent
Consider this example:
@@ -8488,7 +8488,7 @@ Defining Package Variants
The following variant of @code{package-input-rewriting} can match packages to
be replaced by name rather than by identity.
-@deffn {Scheme Procedure} package-input-rewriting/spec @var{replacements} [#:deep? #t]
+@deffn {Procedure} package-input-rewriting/spec @var{replacements} [#:deep? #t]
Return a procedure that, given a package, applies the given
@var{replacements} to all the package graph, including implicit inputs
unless @var{deep?} is false.
@@ -8516,12 +8516,12 @@ Defining Package Variants
@code{package-mapping}: it supports arbitrary changes to nodes in the
graph.
-@defun package-mapping proc [cut?] [#:deep? #f]
+@deffn {Procedure} package-mapping proc [cut?] [#:deep? #f]
Return a procedure that, given a package, applies @var{proc} to all the packages
depended on and returns the resulting package. The procedure stops recursion
when @var{cut?} returns true for a given package. When @var{deep?} is true, @var{proc} is
applied to implicit inputs as well.
-@end defun
+@end deffn
@node Writing Manifests
@section Writing Manifests
@@ -8726,14 +8726,14 @@ Writing Manifests
@end table
@end deftp
-@defun concatenate-manifests lst
+@deffn {Procedure} concatenate-manifests lst
Concatenate the manifests listed in @var{lst} and return the resulting
manifest.
-@end defun
+@end deffn
@c TODO: <manifest-pattern>, manifest-lookup, manifest-remove, etc.
-@defun package->manifest-entry package [output] [#:properties]
+@deffn {Procedure} package->manifest-entry package [output] [#:properties]
Return a manifest entry for the @var{output} of package @var{package},
where @var{output} defaults to @code{"out"}, and with the given
@var{properties}. By default @var{properties} is the empty list or, if
@@ -8751,9 +8751,9 @@ Writing Manifests
(manifest (list (package->manifest-entry git)
(package->manifest-entry git "send-email")))
@end lisp
-@end defun
+@end deffn
-@defun packages->manifest packages
+@deffn {Procedure} packages->manifest packages
Return a list of manifest entries, one for each item listed in
@var{packages}. Elements of @var{packages} can be either package
objects or package/string tuples denoting a specific output of a
@@ -8767,10 +8767,10 @@ Writing Manifests
(packages->manifest (list git `(,git "send-email")))
@end lisp
-@end defun
+@end deffn
@anchor{package-development-manifest}
-@defun package->development-manifest package [system] [#:target]
+@deffn {Procedure} package->development-manifest package [system] [#:target]
Return a manifest for the @dfn{development inputs} of @var{package} for
@var{system}, optionally when cross-compiling to @var{target}.
Development inputs include both explicit and implicit inputs of
@@ -8798,7 +8798,7 @@ Writing Manifests
(GCC), the many supporting libraries (Boost, GLib, GTK, etc.), and a
couple of additional development tools---these are the dependencies
@command{guix show inkscape} lists.
-@end defun
+@end deffn
@c TODO: Move (gnu packages) interface to a section of its own.
@@ -8806,7 +8806,7 @@ Writing Manifests
to build manifests. In particular, it lets you look up packages by
name---see below.
-@defun specifications->manifest specs
+@deffn {Procedure} specifications->manifest specs
Given @var{specs}, a list of specifications such as @code{"emacs@@25.2"}
or @code{"guile:debug"}, return a manifest. Specs have the format that
command-line tools such as @command{guix install} and @command{guix
@@ -8823,7 +8823,7 @@ Writing Manifests
the right set of modules, and referring to the right variables.
Instead, we directly refer to packages in the same way as on the command
line, which can often be more convenient.
-@end defun
+@end deffn
@c TODO: specifications->package, etc.
@@ -10292,54 +10292,54 @@ Build Utilities
This section documents procedures that deal with store file names.
-@defun %store-directory
+@deffn {Procedure} %store-directory
Return the directory name of the store.
-@end defun
+@end deffn
-@defun store-file-name? file
+@deffn {Procedure} store-file-name? file
Return true if @var{file} is in the store.
-@end defun
+@end deffn
-@defun strip-store-file-name file
+@deffn {Procedure} strip-store-file-name file
Strip the @file{/gnu/store} and hash from @var{file}, a store file name.
The result is typically a @code{"@var{package}-@var{version}"} string.
-@end defun
+@end deffn
-@defun package-name->name+version name
+@deffn {Procedure} package-name->name+version name
Given @var{name}, a package name like @code{"foo-0.9.1b"}, return two
values: @code{"foo"} and @code{"0.9.1b"}. When the version part is
unavailable, @var{name} and @code{#f} are returned. The first hyphen
followed by a digit is considered to introduce the version part.
-@end defun
+@end deffn
@subsection File Types
The procedures below deal with files and file types.
-@defun directory-exists? dir
+@deffn {Procedure} directory-exists? dir
Return @code{#t} if @var{dir} exists and is a directory.
-@end defun
+@end deffn
-@defun executable-file? file
+@deffn {Procedure} executable-file? file
Return @code{#t} if @var{file} exists and is executable.
-@end defun
+@end deffn
-@defun symbolic-link? file
+@deffn {Procedure} symbolic-link? file
Return @code{#t} if @var{file} is a symbolic link (aka. a ``symlink'').
-@end defun
+@end deffn
-@defun elf-file? file
-@defunx ar-file? file
-@defunx gzip-file? file
+@deffn {Procedure} elf-file? file
+@deffnx {Procedure} ar-file? file
+@deffnx {Procedure} gzip-file? file
Return @code{#t} if @var{file} is, respectively, an ELF file, an
@code{ar} archive (such as a @file{.a} static library), or a gzip file.
-@end defun
+@end deffn
-@defun reset-gzip-timestamp file [#:keep-mtime? #t]
+@deffn {Procedure} reset-gzip-timestamp file [#:keep-mtime? #t]
If @var{file} is a gzip file, reset its
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 8 Jun 2023 23:48
(address . 63851-done@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
87pm65y6ao.fsf@gnu.org
Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (19 lines)
> In an effort to homogenize things, commit
> 3c40dfe2851dd4ef48d2711f9f3531c06afbe1f2 replaced:
>
> @deffn {Scheme Procedure}
>
> with:
>
> @defun
>
> However, the latter prints "Function" when all existing material about
> Scheme uses the term "procedure".
>
> Thus, for consistency, this commit switches to:
>
> @deffn {Procedure}
>
> * doc/guix.texi, doc/contributing.texi: Use "@deffn {Procedure}"
> consistently rather than "@defun" or similar.

Pushed as aceb150d29832e824446b29fab821acda50531ff.

As discussed on IRC, Texinfo macros are too limited: we can’t have a
‘@defproc’ macro. So be it…

Ludo’.
Closed
?