1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

doc: Use @deffn {Scheme Procedure}' in misc-modules.texi'.

* doc/ref/misc-modules.texi: Use `@deffn {Scheme Procedure}' instead of
  `@defun'.
This commit is contained in:
Ludovic Courtès 2011-12-18 21:25:24 +01:00
parent 1629429d63
commit 7948c5d9eb

View file

@ -1112,7 +1112,7 @@ GNU C Library Reference Manual}).
@end example @end example
@sp 1 @sp 1
@defun file-system-tree file-name [enter? [stat]] @deffn {Scheme Procedure} file-system-tree file-name [enter? [stat]]
Return a tree of the form @code{(@var{file-name} @var{stat} Return a tree of the form @code{(@var{file-name} @var{stat}
@var{children} ...)} where @var{stat} is the result of @code{(@var{stat} @var{children} ...)} where @var{stat} is the result of @code{(@var{stat}
@var{file-name})} and @var{children} are similar structures for each @var{file-name})} and @var{children} are similar structures for each
@ -1169,7 +1169,7 @@ tree, discarding their @code{stat} info:
@dots{})) @dots{}))
@dots{})) @dots{}))
@end example @end example
@end defun @end deffn
@cindex file system combinator @cindex file system combinator
@ -1180,7 +1180,7 @@ than building up a tree of entries in memory, like
directly as a directory tree is traversed; in fact, directly as a directory tree is traversed; in fact,
@code{file-system-tree} is implemented in terms of it. @code{file-system-tree} is implemented in terms of it.
@defun file-system-fold enter? leaf down up skip init file-name [stat] @deffn {Scheme Procedure} file-system-fold enter? leaf down up skip init file-name [stat]
Traverse the directory at @var{file-name}, recursively, and return the Traverse the directory at @var{file-name}, recursively, and return the
result of the successive applications of the @var{leaf}, @var{down}, result of the successive applications of the @var{leaf}, @var{down},
@var{up}, and @var{skip} procedures as described below. @var{up}, and @var{skip} procedures as described below.
@ -1245,11 +1245,11 @@ to `du --apparent-size' with GNU Coreutils.)"
(total-file-size "/dev/null") (total-file-size "/dev/null")
@result{} 0 @result{} 0
@end example @end example
@end defun @end deffn
The alternative C-like functions are described below. The alternative C-like functions are described below.
@defun scandir name [select? [entry<?]] @deffn {Scheme Procedure} scandir name [select? [entry<?]]
Return the list of the names of files contained in directory @var{name} Return the list of the names of files contained in directory @var{name}
that match predicate @var{select?} (by default, all files). The that match predicate @var{select?} (by default, all files). The
returned list of file names is sorted according to @var{entry<?}, which returned list of file names is sorted according to @var{entry<?}, which
@ -1259,9 +1259,9 @@ the locale's alphabetical order (@pxref{Text Collation}).
This procedure is modeled after the C library function of the same name This procedure is modeled after the C library function of the same name
(@pxref{Scanning Directory Content,,, libc, GNU C Library Reference (@pxref{Scanning Directory Content,,, libc, GNU C Library Reference
Manual}). Manual}).
@end defun @end deffn
@defun ftw startname proc ['hash-size n] @deffn {Scheme Procedure} ftw startname proc ['hash-size n]
Walk the file system tree descending from @var{startname}, calling Walk the file system tree descending from @var{startname}, calling
@var{proc} for each file and directory. @var{proc} for each file and directory.
@ -1314,10 +1314,10 @@ to set the size of the hash table used to track items already visited.
In the current implementation, returning non-@code{#t} from @var{proc} In the current implementation, returning non-@code{#t} from @var{proc}
is the only valid way to terminate @code{ftw}. @var{proc} must not is the only valid way to terminate @code{ftw}. @var{proc} must not
use @code{throw} or similar to escape. use @code{throw} or similar to escape.
@end defun @end deffn
@defun nftw startname proc ['chdir] ['depth] ['hash-size n] ['mount] ['physical] @deffn {Scheme Procedure} nftw startname proc ['chdir] ['depth] ['hash-size n] ['mount] ['physical]
Walk the file system tree starting at @var{startname}, calling Walk the file system tree starting at @var{startname}, calling
@var{proc} for each file and directory. @code{nftw} has extra @var{proc} for each file and directory. @code{nftw} has extra
features over the basic @code{ftw} described above. features over the basic @code{ftw} described above.
@ -1420,7 +1420,7 @@ caused the stop.
In the current implementation, returning non-@code{#t} from @var{proc} In the current implementation, returning non-@code{#t} from @var{proc}
is the only valid way to terminate @code{ftw}. @var{proc} must not is the only valid way to terminate @code{ftw}. @var{proc} must not
use @code{throw} or similar to escape. use @code{throw} or similar to escape.
@end defun @end deffn
@node Queues @node Queues
@ -1586,7 +1586,7 @@ a list, but they could be printed (infinitely) with for example
@end example @end example
@sp 1 @sp 1
@defun make-stream proc initial-state @deffn {Scheme Procedure} make-stream proc initial-state
Return a new stream, formed by calling @var{proc} successively. Return a new stream, formed by calling @var{proc} successively.
Each call is @code{(@var{proc} @var{state})}, it should return a pair, Each call is @code{(@var{proc} @var{state})}, it should return a pair,
@ -1594,32 +1594,32 @@ the @code{car} being the value for the stream, and the @code{cdr}
being the new @var{state} for the next call. For the first call being the new @var{state} for the next call. For the first call
@var{state} is the given @var{initial-state}. At the end of the @var{state} is the given @var{initial-state}. At the end of the
stream, @var{proc} should return some non-pair object. stream, @var{proc} should return some non-pair object.
@end defun @end deffn
@defun stream-car stream @deffn {Scheme Procedure} stream-car stream
Return the first element from @var{stream}. @var{stream} must not be Return the first element from @var{stream}. @var{stream} must not be
empty. empty.
@end defun @end deffn
@defun stream-cdr stream @deffn {Scheme Procedure} stream-cdr stream
Return a stream which is the second and subsequent elements of Return a stream which is the second and subsequent elements of
@var{stream}. @var{stream} must not be empty. @var{stream}. @var{stream} must not be empty.
@end defun @end deffn
@defun stream-null? stream @deffn {Scheme Procedure} stream-null? stream
Return true if @var{stream} is empty. Return true if @var{stream} is empty.
@end defun @end deffn
@defun list->stream list @deffn {Scheme Procedure} list->stream list
@defunx vector->stream vector @deffnx {Scheme Procedure} vector->stream vector
Return a stream with the contents of @var{list} or @var{vector}. Return a stream with the contents of @var{list} or @var{vector}.
@var{list} or @var{vector} should not be modified subsequently, since @var{list} or @var{vector} should not be modified subsequently, since
it's unspecified whether changes there will be reflected in the stream it's unspecified whether changes there will be reflected in the stream
returned. returned.
@end defun @end deffn
@defun port->stream port readproc @deffn {Scheme Procedure} port->stream port readproc
Return a stream which is the values obtained by reading from Return a stream which is the values obtained by reading from
@var{port} using @var{readproc}. Each read call is @var{port} using @var{readproc}. Each read call is
@code{(@var{readproc} @var{port})}, and it should return an EOF object @code{(@var{readproc} @var{port})}, and it should return an EOF object
@ -1630,34 +1630,34 @@ For example a stream of characters from a file,
@example @example
(port->stream (open-input-file "/foo/bar.txt") read-char) (port->stream (open-input-file "/foo/bar.txt") read-char)
@end example @end example
@end defun @end deffn
@defun stream->list stream @deffn {Scheme Procedure} stream->list stream
Return a list which is the entire contents of @var{stream}. Return a list which is the entire contents of @var{stream}.
@end defun @end deffn
@defun stream->reversed-list stream @deffn {Scheme Procedure} stream->reversed-list stream
Return a list which is the entire contents of @var{stream}, but in Return a list which is the entire contents of @var{stream}, but in
reverse order. reverse order.
@end defun @end deffn
@defun stream->list&length stream @deffn {Scheme Procedure} stream->list&length stream
Return two values (@pxref{Multiple Values}), being firstly a list Return two values (@pxref{Multiple Values}), being firstly a list
which is the entire contents of @var{stream}, and secondly the number which is the entire contents of @var{stream}, and secondly the number
of elements in that list. of elements in that list.
@end defun @end deffn
@defun stream->reversed-list&length stream @deffn {Scheme Procedure} stream->reversed-list&length stream
Return two values (@pxref{Multiple Values}) being firstly a list which Return two values (@pxref{Multiple Values}) being firstly a list which
is the entire contents of @var{stream}, but in reverse order, and is the entire contents of @var{stream}, but in reverse order, and
secondly the number of elements in that list. secondly the number of elements in that list.
@end defun @end deffn
@defun stream->vector stream @deffn {Scheme Procedure} stream->vector stream
Return a vector which is the entire contents of @var{stream}. Return a vector which is the entire contents of @var{stream}.
@end defun @end deffn
@defun stream-fold proc init stream0 @dots{} streamN @deffn {Scheme Procedure} stream-fold proc init stream0 @dots{} streamN
Apply @var{proc} successively over the elements of the given streams, Apply @var{proc} successively over the elements of the given streams,
from first to last until the end of the shortest stream is reached. from first to last until the end of the shortest stream is reached.
Return the result from the last @var{proc} call. Return the result from the last @var{proc} call.
@ -1666,9 +1666,9 @@ Each call is @code{(@var{proc} elem0 @dots{} elemN prev)}, where each
@var{elem} is from the corresponding @var{stream}. @var{prev} is the @var{elem} is from the corresponding @var{stream}. @var{prev} is the
return from the previous @var{proc} call, or the given @var{init} for return from the previous @var{proc} call, or the given @var{init} for
the first call. the first call.
@end defun @end deffn
@defun stream-for-each proc stream0 @dots{} streamN @deffn {Scheme Procedure} stream-for-each proc stream0 @dots{} streamN
Call @var{proc} on the elements from the given @var{stream}s. The Call @var{proc} on the elements from the given @var{stream}s. The
return value is unspecified. return value is unspecified.
@ -1676,16 +1676,16 @@ Each call is @code{(@var{proc} elem0 @dots{} elemN)}, where each
@var{elem} is from the corresponding @var{stream}. @var{elem} is from the corresponding @var{stream}.
@code{stream-for-each} stops when it reaches the end of the shortest @code{stream-for-each} stops when it reaches the end of the shortest
@var{stream}. @var{stream}.
@end defun @end deffn
@defun stream-map proc stream0 @dots{} streamN @deffn {Scheme Procedure} stream-map proc stream0 @dots{} streamN
Return a new stream which is the results of applying @var{proc} to the Return a new stream which is the results of applying @var{proc} to the
elements of the given @var{stream}s. elements of the given @var{stream}s.
Each call is @code{(@var{proc} elem0 @dots{} elemN)}, where each Each call is @code{(@var{proc} elem0 @dots{} elemN)}, where each
@var{elem} is from the corresponding @var{stream}. The new stream @var{elem} is from the corresponding @var{stream}. The new stream
ends when the end of the shortest given @var{stream} is reached. ends when the end of the shortest given @var{stream} is reached.
@end defun @end deffn
@node Buffered Input @node Buffered Input
@ -1704,7 +1704,7 @@ characters which are to be handed out on reading the port. A notion
of further input for an application level logical expression is of further input for an application level logical expression is
maintained too, and passed through to the reader. maintained too, and passed through to the reader.
@defun make-buffered-input-port reader @deffn {Scheme Procedure} make-buffered-input-port reader
Create an input port which returns characters obtained from the given Create an input port which returns characters obtained from the given
@var{reader} function. @var{reader} is called (@var{reader} cont), @var{reader} function. @var{reader} is called (@var{reader} cont),
and should return a string or an EOF object. and should return a string or an EOF object.
@ -1719,9 +1719,9 @@ application level notion, set with
@code{set-buffered-input-continuation?!} below. If the user has @code{set-buffered-input-continuation?!} below. If the user has
entered a partial expression then it allows @var{reader} for instance entered a partial expression then it allows @var{reader} for instance
to give a different prompt to show more is required. to give a different prompt to show more is required.
@end defun @end deffn
@defun make-line-buffered-input-port reader @deffn {Scheme Procedure} make-line-buffered-input-port reader
@cindex Line buffered input @cindex Line buffered input
Create an input port which returns characters obtained from the Create an input port which returns characters obtained from the
specified @var{reader} function, similar to specified @var{reader} function, similar to
@ -1731,9 +1731,9 @@ expected to be a line-oriented.
@var{reader} is called (@var{reader} cont), and should return a string @var{reader} is called (@var{reader} cont), and should return a string
or an EOF object as above. Each string is a line of input without a or an EOF object as above. Each string is a line of input without a
newline character, the port code inserts a newline after each string. newline character, the port code inserts a newline after each string.
@end defun @end deffn
@defun set-buffered-input-continuation?! port cont @deffn {Scheme Procedure} set-buffered-input-continuation?! port cont
Set the input continuation flag for a given buffered input Set the input continuation flag for a given buffered input
@var{port}. @var{port}.
@ -1748,7 +1748,7 @@ example with the Scheme @code{read} function (@pxref{Scheme Read}),
(let ((obj (read my-port))) (let ((obj (read my-port)))
... ...
@end example @end example
@end defun @end deffn
@c Local Variables: @c Local Variables: