summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Jerram <neil@ossau.uklinux.net>2001-11-11 15:01:52 +0000
committerNeil Jerram <neil@ossau.uklinux.net>2001-11-11 15:01:52 +0000
commit9401323e63278a7053c54565e8d688f6cbe34f54 (patch)
tree01e0840bac67d78e974b03200f9cf16f894fea37
parenta0a9b9ad4263e129e46e31a8c0c2e7775b037ee9 (diff)
downloadguile-9401323e63278a7053c54565e8d688f6cbe34f54.tar.gz
* Documentation work.
-rw-r--r--doc/maint/ChangeLog10
-rw-r--r--doc/maint/docstring.el35
-rw-r--r--doc/maint/guile.texi5182
-rw-r--r--doc/ref/ChangeLog58
-rw-r--r--doc/ref/Makefile.am4
-rw-r--r--doc/ref/appendices.texi0
-rw-r--r--doc/ref/debugging.texi179
-rw-r--r--doc/ref/guile.texi115
-rw-r--r--doc/ref/indices.texi4
-rw-r--r--doc/ref/intro.texi113
-rw-r--r--doc/ref/new-docstrings.texi69
-rw-r--r--doc/ref/posix.texi39
-rw-r--r--doc/ref/preface.texi91
-rw-r--r--doc/ref/program.texi199
-rw-r--r--doc/ref/scheme-binding.texi2
-rw-r--r--doc/ref/scheme-control.texi138
-rwxr-xr-xdoc/ref/scheme-data.texi70
-rw-r--r--doc/ref/scheme-debug.texi4
-rw-r--r--doc/ref/scheme-indices.texi4
-rw-r--r--doc/ref/scheme-io.texi234
-rw-r--r--doc/ref/scheme-memory.texi2
-rw-r--r--doc/ref/scheme-options.texi4
-rw-r--r--doc/ref/scm.texi355
-rw-r--r--libguile/ChangeLog25
-rw-r--r--libguile/dynwind.c4
-rw-r--r--libguile/extensions.c64
-rw-r--r--libguile/filesys.c7
-rw-r--r--libguile/guardians.c2
-rw-r--r--libguile/hashtab.c2
-rw-r--r--libguile/modules.c2
-rw-r--r--libguile/ports.c6
-rw-r--r--libguile/posix.c2
-rw-r--r--libguile/random.c14
-rw-r--r--libguile/scmsigs.c8
-rw-r--r--libguile/strings.c2
-rw-r--r--libguile/strop.c2
-rw-r--r--libguile/struct.c4
-rw-r--r--libguile/unif.c2
-rw-r--r--libguile/variable.c10
-rw-r--r--srfi/ChangeLog6
-rw-r--r--srfi/srfi-13.c4
-rw-r--r--srfi/srfi-14.c8
42 files changed, 3879 insertions, 3206 deletions
diff --git a/doc/maint/ChangeLog b/doc/maint/ChangeLog
index 0572b38f3..44731b76b 100644
--- a/doc/maint/ChangeLog
+++ b/doc/maint/ChangeLog
@@ -1,3 +1,13 @@
+2001-11-07 Neil Jerram <neil@ossau.uklinux.net>
+
+ * guile.texi: Replaced by libguile version (after automatically
+ updating docstrings in the reference manual).
+
+ * docstring.el (docstring-manual-directory): Added "/ref" to end.
+ (docstring-manual-files): Now calculated automatically, since by
+ definition all the .texi files in doc/ref are reference manual
+ files.
+
2001-04-03 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* guile.texi: Automated docstring merging.
diff --git a/doc/maint/docstring.el b/doc/maint/docstring.el
index b346b96bd..731c62e90 100644
--- a/doc/maint/docstring.el
+++ b/doc/maint/docstring.el
@@ -57,7 +57,7 @@
;;; Code:
-(defvar docstring-manual-directory (expand-file-name "~/Guile/cvs/guile-core/doc")
+(defvar docstring-manual-directory (expand-file-name "~/Guile/cvs/guile-core/doc/ref")
"*The directory containing the Texinfo source for the Guile reference manual.")
(defvar docstring-tracking-root (expand-file-name "~/Guile/cvs/guile-core/doc/maint")
@@ -72,37 +72,8 @@ for module (a b c) is expected to be in the file
For each entry in this list, the snarfed docstring file for module (a
b c) is looked for in the file <entry>/a/b/c.texi.")
-(defvar docstring-manual-files '("appendices.texi"
- "deprecated.texi"
- "expect.texi"
- "gh.texi"
- "goops.texi"
- "guile.texi"
- "indices.texi"
- "intro.texi"
- "posix.texi"
- "scheme-binding.texi"
- "scheme-control.texi"
- "scheme-data.texi"
- "scheme-debug.texi"
- "scheme-evaluation.texi"
- "scheme-ideas.texi"
- "scheme-indices.texi"
- "scheme-intro.texi"
- "scheme-io.texi"
- "scheme-memory.texi"
- "scheme-modules.texi"
- "scheme-options.texi"
- "scheme-procedures.texi"
- "scheme-reading.texi"
- "scheme-scheduling.texi"
- "scheme-translation.texi"
- "scheme-utility.texi"
- "scm.texi"
- "scripts.texi"
- "scsh.texi"
- "slib.texi"
- "tcltk.texi")
+(defvar docstring-manual-files
+ (directory-files docstring-manual-directory nil "\\.texi$" t)
"List of Texinfo source files that comprise the Guile reference manual.")
(defvar docstring-new-docstrings-file "new-docstrings.texi"
diff --git a/doc/maint/guile.texi b/doc/maint/guile.texi
index 622fbba08..8b6b5efe5 100644
--- a/doc/maint/guile.texi
+++ b/doc/maint/guile.texi
@@ -1,7 +1,7 @@
@paragraphindent 0
acons
-@c snarfed from alist.c:60
+@c snarfed from alist.c:58
@deffn primitive acons key value alist
Adds a new key-value pair to @var{alist}. A new pair is
created whose car is @var{key} and whose cdr is @var{value}, and the
@@ -10,28 +10,28 @@ function is @emph{not} destructive; @var{alist} is not modified.
@end deffn
sloppy-assq
-@c snarfed from alist.c:83
+@c snarfed from alist.c:81
@deffn primitive sloppy-assq key alist
Behaves like @code{assq} but does not do any error checking.
Recommended only for use in Guile internals.
@end deffn
sloppy-assv
-@c snarfed from alist.c:101
+@c snarfed from alist.c:99
@deffn primitive sloppy-assv key alist
Behaves like @code{assv} but does not do any error checking.
Recommended only for use in Guile internals.
@end deffn
sloppy-assoc
-@c snarfed from alist.c:119
+@c snarfed from alist.c:117
@deffn primitive sloppy-assoc key alist
Behaves like @code{assoc} but does not do any error checking.
Recommended only for use in Guile internals.
@end deffn
assq
-@c snarfed from alist.c:146
+@c snarfed from alist.c:144
@deffn primitive assq key alist
@deffnx primitive assv key alist
@deffnx primitive assoc key alist
@@ -45,19 +45,19 @@ return the entire alist entry found (i.e. both the key and the value).
@end deffn
assv
-@c snarfed from alist.c:167
+@c snarfed from alist.c:165
@deffn primitive assv key alist
Behaves like @code{assq} but uses @code{eqv?} for key comparison.
@end deffn
assoc
-@c snarfed from alist.c:188
+@c snarfed from alist.c:186
@deffn primitive assoc key alist
Behaves like @code{assq} but uses @code{equal?} for key comparison.
@end deffn
assq-ref
-@c snarfed from alist.c:232
+@c snarfed from alist.c:230
@deffn primitive assq-ref alist key
@deffnx primitive assv-ref alist key
@deffnx primitive assoc-ref alist key
@@ -74,19 +74,19 @@ where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}.
@end deffn
assv-ref
-@c snarfed from alist.c:249
+@c snarfed from alist.c:247
@deffn primitive assv-ref alist key
Behaves like @code{assq-ref} but uses @code{eqv?} for key comparison.
@end deffn
assoc-ref
-@c snarfed from alist.c:266
+@c snarfed from alist.c:264
@deffn primitive assoc-ref alist key
Behaves like @code{assq-ref} but uses @code{equal?} for key comparison.
@end deffn
assq-set!
-@c snarfed from alist.c:295
+@c snarfed from alist.c:293
@deffn primitive assq-set! alist key val
@deffnx primitive assv-set! alist key value
@deffnx primitive assoc-set! alist key value
@@ -101,19 +101,19 @@ association list.
@end deffn
assv-set!
-@c snarfed from alist.c:313
+@c snarfed from alist.c:311
@deffn primitive assv-set! alist key val
Behaves like @code{assq-set!} but uses @code{eqv?} for key comparison.
@end deffn
assoc-set!
-@c snarfed from alist.c:331
+@c snarfed from alist.c:329
@deffn primitive assoc-set! alist key val
Behaves like @code{assq-set!} but uses @code{equal?} for key comparison.
@end deffn
assq-remove!
-@c snarfed from alist.c:355
+@c snarfed from alist.c:353
@deffn primitive assq-remove! alist key
@deffnx primitive assv-remove! alist key
@deffnx primitive assoc-remove! alist key
@@ -122,19 +122,19 @@ the resulting alist.
@end deffn
assv-remove!
-@c snarfed from alist.c:371
+@c snarfed from alist.c:369
@deffn primitive assv-remove! alist key
Behaves like @code{assq-remove!} but uses @code{eqv?} for key comparison.
@end deffn
assoc-remove!
-@c snarfed from alist.c:387
+@c snarfed from alist.c:385
@deffn primitive assoc-remove! alist key
Behaves like @code{assq-remove!} but uses @code{equal?} for key comparison.
@end deffn
make-arbiter
-@c snarfed from arbiters.c:84
+@c snarfed from arbiters.c:82
@deffn primitive make-arbiter name
Return an object of type arbiter and name @var{name}. Its
state is initially unlocked. Arbiters are a way to achieve
@@ -142,71 +142,71 @@ process synchronization.
@end deffn
try-arbiter
-@c snarfed from arbiters.c:94
+@c snarfed from arbiters.c:92
@deffn primitive try-arbiter arb
Return @code{#t} and lock the arbiter @var{arb} if the arbiter
was unlocked. Otherwise, return @code{#f}.
@end deffn
release-arbiter
-@c snarfed from arbiters.c:115
+@c snarfed from arbiters.c:113
@deffn primitive release-arbiter arb
Return @code{#t} and unlock the arbiter @var{arb} if the
arbiter was locked. Otherwise, return @code{#f}.
@end deffn
async
-@c snarfed from async.c:290
+@c snarfed from async.c:288
@deffn primitive async thunk
Create a new async for the procedure @var{thunk}.
@end deffn
system-async
-@c snarfed from async.c:300
+@c snarfed from async.c:298
@deffn primitive system-async thunk
Create a new async for the procedure @var{thunk}. Also
add it to the system's list of active async objects.
@end deffn
async-mark
-@c snarfed from async.c:311
+@c snarfed from async.c:309
@deffn primitive async-mark a
Mark the async @var{a} for future execution.
@end deffn
system-async-mark
-@c snarfed from async.c:327
+@c snarfed from async.c:325
@deffn primitive system-async-mark a
Mark the async @var{a} for future execution.
@end deffn
run-asyncs
-@c snarfed from async.c:347
+@c snarfed from async.c:345
@deffn primitive run-asyncs list_of_a
Execute all thunks from the asyncs of the list @var{list_of_a}.
@end deffn
noop
-@c snarfed from async.c:381
+@c snarfed from async.c:379
@deffn primitive noop . args
Do nothing. When called without arguments, return @code{#f},
otherwise return the first argument.
@end deffn
unmask-signals
-@c snarfed from async.c:433
+@c snarfed from async.c:431
@deffn primitive unmask-signals
Unmask signals. The returned value is not specified.
@end deffn
mask-signals
-@c snarfed from async.c:444
+@c snarfed from async.c:442
@deffn primitive mask-signals
Mask signals. The returned value is not specified.
@end deffn
display-error
-@c snarfed from backtrace.c:262
+@c snarfed from backtrace.c:265
@deffn primitive display-error stack port subr message args rest
Display an error message to the output port @var{port}.
@var{stack} is the saved stack for the error, @var{subr} is
@@ -218,7 +218,7 @@ ignored.
@end deffn
display-application
-@c snarfed from backtrace.c:399
+@c snarfed from backtrace.c:402
@deffn primitive display-application frame [port [indent]]
Display a procedure application @var{frame} to the output port
@var{port}. @var{indent} specifies the indentation of the
@@ -226,7 +226,7 @@ output.
@end deffn
display-backtrace
-@c snarfed from backtrace.c:619
+@c snarfed from backtrace.c:713
@deffn primitive display-backtrace stack port [first [depth]]
Display a backtrace to the output port @var{port}. @var{stack}
is the stack to take the backtrace from, @var{first} specifies
@@ -236,136 +236,136 @@ which means that default values will be used.
@end deffn
backtrace
-@c snarfed from backtrace.c:642
+@c snarfed from backtrace.c:736
@deffn primitive backtrace
Display a backtrace of the stack saved by the last error
to the current output port.
@end deffn
not
-@c snarfed from boolean.c:56
+@c snarfed from boolean.c:54
@deffn primitive not x
Return @code{#t} iff @var{x} is @code{#f}, else return @code{#f}.
@end deffn
boolean?
-@c snarfed from boolean.c:66
+@c snarfed from boolean.c:64
@deffn primitive boolean? obj
Return @code{#t} iff @var{obj} is either @code{#t} or @code{#f}.
@end deffn
char?
-@c snarfed from chars.c:56
+@c snarfed from chars.c:54
@deffn primitive char? x
Return @code{#t} iff @var{x} is a character, else @code{#f}.
@end deffn
char=?
-@c snarfed from chars.c:65
+@c snarfed from chars.c:63
@deffn primitive char=? x y
Return @code{#t} iff @var{x} is the same character as @var{y}, else @code{#f}.
@end deffn
char<?
-@c snarfed from chars.c:78
+@c snarfed from chars.c:76
@deffn primitive char<? x y
Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence,
else @code{#f}.
@end deffn
char<=?
-@c snarfed from chars.c:90
+@c snarfed from chars.c:88
@deffn primitive char<=? x y
Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
ASCII sequence, else @code{#f}.
@end deffn
char>?
-@c snarfed from chars.c:102
+@c snarfed from chars.c:100
@deffn primitive char>? x y
Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
sequence, else @code{#f}.
@end deffn
char>=?
-@c snarfed from chars.c:114
+@c snarfed from chars.c:112
@deffn primitive char>=? x y
Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
ASCII sequence, else @code{#f}.
@end deffn
char-ci=?
-@c snarfed from chars.c:126
+@c snarfed from chars.c:124
@deffn primitive char-ci=? x y
Return @code{#t} iff @var{x} is the same character as @var{y} ignoring
case, else @code{#f}.
@end deffn
char-ci<?
-@c snarfed from chars.c:138
+@c snarfed from chars.c:136
@deffn primitive char-ci<? x y
Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence
ignoring case, else @code{#f}.
@end deffn
char-ci<=?
-@c snarfed from chars.c:150
+@c snarfed from chars.c:148
@deffn primitive char-ci<=? x y
Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
ASCII sequence ignoring case, else @code{#f}.
@end deffn
char-ci>?
-@c snarfed from chars.c:162
+@c snarfed from chars.c:160
@deffn primitive char-ci>? x y
Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
sequence ignoring case, else @code{#f}.
@end deffn
char-ci>=?
-@c snarfed from chars.c:174
+@c snarfed from chars.c:172
@deffn primitive char-ci>=? x y
Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
ASCII sequence ignoring case, else @code{#f}.
@end deffn
char-alphabetic?
-@c snarfed from chars.c:187
+@c snarfed from chars.c:185
@deffn primitive char-alphabetic? chr
Return @code{#t} iff @var{chr} is alphabetic, else @code{#f}.
Alphabetic means the same thing as the isalpha C library function.
@end deffn
char-numeric?
-@c snarfed from chars.c:198
+@c snarfed from chars.c:196
@deffn primitive char-numeric? chr
Return @code{#t} iff @var{chr} is numeric, else @code{#f}.
Numeric means the same thing as the isdigit C library function.
@end deffn
char-whitespace?
-@c snarfed from chars.c:209
+@c snarfed from chars.c:207
@deffn primitive char-whitespace? chr
Return @code{#t} iff @var{chr} is whitespace, else @code{#f}.
Whitespace means the same thing as the isspace C library function.
@end deffn
char-upper-case?
-@c snarfed from chars.c:222
+@c snarfed from chars.c:220
@deffn primitive char-upper-case? chr
Return @code{#t} iff @var{chr} is uppercase, else @code{#f}.
Uppercase means the same thing as the isupper C library function.
@end deffn
char-lower-case?
-@c snarfed from chars.c:234
+@c snarfed from chars.c:232
@deffn primitive char-lower-case? chr
Return @code{#t} iff @var{chr} is lowercase, else @code{#f}.
Lowercase means the same thing as the islower C library function.
@end deffn
char-is-both?
-@c snarfed from chars.c:248
+@c snarfed from chars.c:246
@deffn primitive char-is-both? chr
Return @code{#t} iff @var{chr} is either uppercase or lowercase, else @code{#f}.
Uppercase and lowercase are as defined by the isupper and islower
@@ -373,32 +373,32 @@ C library functions.
@end deffn
char->integer
-@c snarfed from chars.c:262
+@c snarfed from chars.c:260
@deffn primitive char->integer chr
Return the number corresponding to ordinal position of @var{chr} in the
ASCII sequence.
@end deffn
integer->char
-@c snarfed from chars.c:274
+@c snarfed from chars.c:272
@deffn primitive integer->char n
Return the character at position @var{n} in the ASCII sequence.
@end deffn
char-upcase
-@c snarfed from chars.c:285
+@c snarfed from chars.c:283
@deffn primitive char-upcase chr
Return the uppercase character version of @var{chr}.
@end deffn
char-downcase
-@c snarfed from chars.c:296
+@c snarfed from chars.c:294
@deffn primitive char-downcase chr
Return the lowercase character version of @var{chr}.
@end deffn
debug-options-interface
-@c snarfed from debug.c:80
+@c snarfed from debug.c:79
@deffn primitive debug-options-interface [setting]
Option interface for the debug options. Instead of using
this procedure directly, use the procedures @code{debug-enable},
@@ -406,49 +406,49 @@ this procedure directly, use the procedures @code{debug-enable},
@end deffn
with-traps
-@c snarfed from debug.c:128
+@c snarfed from debug.c:127
@deffn primitive with-traps thunk
Call @var{thunk} with traps enabled.
@end deffn
memoized?
-@c snarfed from debug.c:170
+@c snarfed from debug.c:169
@deffn primitive memoized? obj
Return @code{#t} if @var{obj} is memoized.
@end deffn
unmemoize
-@c snarfed from debug.c:376
+@c snarfed from debug.c:333
@deffn primitive unmemoize m
Unmemoize the memoized expression @var{m},
@end deffn
memoized-environment
-@c snarfed from debug.c:386
+@c snarfed from debug.c:343
@deffn primitive memoized-environment m
Return the environment of the memoized expression @var{m}.
@end deffn
procedure-name
-@c snarfed from debug.c:396
+@c snarfed from debug.c:353
@deffn primitive procedure-name proc
Return the name of the procedure @var{proc}
@end deffn
procedure-source
-@c snarfed from debug.c:422
+@c snarfed from debug.c:379
@deffn primitive procedure-source proc
Return the source of the procedure @var{proc}.
@end deffn
procedure-environment
-@c snarfed from debug.c:455
+@c snarfed from debug.c:412
@deffn primitive procedure-environment proc
Return the environment of the procedure @var{proc}.
@end deffn
local-eval
-@c snarfed from debug.c:487
+@c snarfed from debug.c:444
@deffn primitive local-eval exp [env]
Evaluate @var{exp} in its environment. If @var{env} is supplied,
it is the environment in which to evaluate @var{exp}. Otherwise,
@@ -457,50 +457,13 @@ is implicit).
@end deffn
debug-object?
-@c snarfed from debug.c:574
+@c snarfed from debug.c:531
@deffn primitive debug-object? obj
Return @code{#t} if @var{obj} is a debug object.
@end deffn
- issue-deprecation-warning
-@c snarfed from deprecation.c:78
-@deffn primitive issue-deprecation-warning . msgs
-Output @var{msgs} to @code{(current-error-port)} when this
-is the first call to @code{issue-deprecation-warning} with
-this specific @var{msg}. Do nothing otherwise.
-The argument @var{msgs} should be a list of strings;
-they are printed in turn, each one followed by a newline.
-@end deffn
-
- include-deprecated-features
-@c snarfed from deprecation.c:120
-@deffn primitive include-deprecated-features
-Return @code{#t} iff deprecated features should be included
-in public interfaces.
-@end deffn
-
- c-registered-modules
-@c snarfed from dynl.c:183
-@deffn primitive c-registered-modules
-Return a list of the object code modules that have been imported into
-the current Guile process. Each element of the list is a pair whose
-car is the name of the module, and whose cdr is the function handle
-for that module's initializer function. The name is the string that
-has been passed to scm_register_module_xxx.
-@end deffn
-
- c-clear-registered-modules
-@c snarfed from dynl.c:204
-@deffn primitive c-clear-registered-modules
-Destroy the list of modules registered with the current Guile process.
-The return value is unspecified. @strong{Warning:} this function does
-not actually unlink or deallocate these modules, but only destroys the
-records of which modules have been loaded. It should therefore be used
-only by module bookkeeping operations.
-@end deffn
-
dynamic-link
-@c snarfed from dynl.c:357
+@c snarfed from dynl.c:264
@deffn primitive dynamic-link filename
Open the dynamic library called @var{filename}. A library
handle representing the opened library is returned; this handle
@@ -509,14 +472,14 @@ functions.
@end deffn
dynamic-object?
-@c snarfed from dynl.c:373
+@c snarfed from dynl.c:279
@deffn primitive dynamic-object? obj
Return @code{#t} if @var{obj} is a dynamic library handle, or @code{#f}
otherwise.
@end deffn
dynamic-unlink
-@c snarfed from dynl.c:386
+@c snarfed from dynl.c:292
@deffn primitive dynamic-unlink dobj
Unlink the indicated object file from the application. The
argument @var{dobj} must have been obtained by a call to
@@ -525,7 +488,7 @@ called on @var{dobj}, its content is no longer accessible.
@end deffn
dynamic-func
-@c snarfed from dynl.c:413
+@c snarfed from dynl.c:319
@deffn primitive dynamic-func name dobj
Search the dynamic object @var{dobj} for the C function
indicated by the string @var{name} and return some Scheme
@@ -539,7 +502,7 @@ needed or not and will add it when necessary.
@end deffn
dynamic-call
-@c snarfed from dynl.c:453
+@c snarfed from dynl.c:358
@deffn primitive dynamic-call func dobj
Call the C function indicated by @var{func} and @var{dobj}.
The function is passed no arguments and its return value is
@@ -556,7 +519,7 @@ Interrupts are deferred while the C function is executing (with
@end deffn
dynamic-args-call
-@c snarfed from dynl.c:481
+@c snarfed from dynl.c:386
@deffn primitive dynamic-args-call func dobj args
Call the C function indicated by @var{func} and @var{dobj},
just like @code{dynamic-call}, but pass it some arguments and
@@ -574,7 +537,7 @@ converted to a Scheme number and returned from the call to
@end deffn
dynamic-wind
-@c snarfed from dynwind.c:121
+@c snarfed from dynwind.c:119
@deffn primitive dynamic-wind in_guard thunk out_guard
All three arguments must be 0-argument procedures.
@var{in_guard} is called, then @var{thunk}, then
@@ -841,7 +804,7 @@ Change @var{env}'s imported environment to @var{imported}.
@end deffn
make-import-environment
-@c snarfed from environments.c:1846
+@c snarfed from environments.c:1850
@deffn primitive make-import-environment imports conflict_proc
Return a new environment @var{imp} whose bindings are the union
of the bindings from the environments in @var{imports};
@@ -871,28 +834,28 @@ if one of its imported environments changes.
@end deffn
import-environment?
-@c snarfed from environments.c:1875
+@c snarfed from environments.c:1879
@deffn primitive import-environment? object
Return @code{#t} if object is an import environment, or
@code{#f} otherwise.
@end deffn
import-environment-imports
-@c snarfed from environments.c:1886
+@c snarfed from environments.c:1890
@deffn primitive import-environment-imports env
Return the list of environments imported by the import
environment @var{env}.
@end deffn
import-environment-set-imports!
-@c snarfed from environments.c:1899
+@c snarfed from environments.c:1903
@deffn primitive import-environment-set-imports! env imports
Change @var{env}'s list of imported environments to
@var{imports}, and check for conflicts.
@end deffn
make-export-environment
-@c snarfed from environments.c:2164
+@c snarfed from environments.c:2171
@deffn primitive make-export-environment private signature
Return a new environment @var{exp} containing only those
bindings in private whose symbols are present in
@@ -941,38 +904,38 @@ if the bindings in private change.
@end deffn
export-environment?
-@c snarfed from environments.c:2199
+@c snarfed from environments.c:2206
@deffn primitive export-environment? object
Return @code{#t} if object is an export environment, or
@code{#f} otherwise.
@end deffn
export-environment-private
-@c snarfed from environments.c:2209
+@c snarfed from environments.c:2216
@deffn primitive export-environment-private env
Return the private environment of export environment @var{env}.
@end deffn
export-environment-set-private!
-@c snarfed from environments.c:2221
+@c snarfed from environments.c:2228
@deffn primitive export-environment-set-private! env private
Change the private environment of export environment @var{env}.
@end deffn
export-environment-signature
-@c snarfed from environments.c:2243
+@c snarfed from environments.c:2250
@deffn primitive export-environment-signature env
Return the signature of export environment @var{env}.
@end deffn
export-environment-set-signature!
-@c snarfed from environments.c:2317
+@c snarfed from environments.c:2324
@deffn primitive export-environment-set-signature! env signature
Change the signature of export environment @var{env}.
@end deffn
eq?
-@c snarfed from eq.c:64
+@c snarfed from eq.c:62
@deffn primitive eq? x y
Return @code{#t} iff @var{x} references the same object as @var{y}.
@code{eq?} is similar to @code{eqv?} except that in some cases it is
@@ -981,7 +944,7 @@ capable of discerning distinctions finer than those detectable by
@end deffn
eqv?
-@c snarfed from eq.c:78
+@c snarfed from eq.c:76
@deffn primitive eqv? x y
The @code{eqv?} procedure defines a useful equivalence relation on objects.
Briefly, it returns @code{#t} if @var{x} and @var{y} should normally be
@@ -991,7 +954,7 @@ and inexact numbers.
@end deffn
equal?
-@c snarfed from eq.c:127
+@c snarfed from eq.c:125
@deffn primitive equal? x y
Return @code{#t} iff @var{x} and @var{y} are recursively @code{eqv?} equivalent.
@code{equal?} recursively compares the contents of pairs,
@@ -1002,7 +965,7 @@ terminate if its arguments are circular data structures.
@end deffn
scm-error
-@c snarfed from error.c:114
+@c snarfed from error.c:117
@deffn primitive scm-error key subr message args data
Raise an error with key @var{key}. @var{subr} can be a string
naming the procedure associated with the error, or @code{#f}.
@@ -1020,14 +983,14 @@ it will usually be @code{#f}.
@end deffn
strerror
-@c snarfed from error.c:156
+@c snarfed from error.c:157
@deffn primitive strerror err
Return the Unix error message corresponding to @var{err}, which
must be an integer value.
@end deffn
apply:nconc2last
-@c snarfed from eval.c:3256
+@c snarfed from eval.c:3326
@deffn primitive apply:nconc2last lst
Given a list (@var{arg1} @dots{} @var{args}), this function
conses the @var{arg1} @dots{} arguments onto the front of
@@ -1039,7 +1002,7 @@ destroys its argument, so use with care.
@end deffn
force
-@c snarfed from eval.c:3789
+@c snarfed from eval.c:3861
@deffn primitive force x
If the promise @var{x} has not been computed yet, compute and
return @var{x}, otherwise just return the previously computed
@@ -1047,14 +1010,14 @@ value.
@end deffn
promise?
-@c snarfed from eval.c:3812
+@c snarfed from eval.c:3884
@deffn primitive promise? obj
Return true if @var{obj} is a promise, i.e. a delayed computation
-(@pxref{Delayed evaluation,,,r4rs.info,The Revised^4 Report on Scheme}).
+(@pxref{Delayed evaluation,,,r5rs.info,The Revised^5 Report on Scheme}).
@end deffn
cons-source
-@c snarfed from eval.c:3824
+@c snarfed from eval.c:3896
@deffn primitive cons-source xorig x y
Create and return a new pair whose car and cdr are @var{x} and @var{y}.
Any source properties associated with @var{xorig} are also associated
@@ -1062,7 +1025,7 @@ with the new pair.
@end deffn
copy-tree
-@c snarfed from eval.c:3846
+@c snarfed from eval.c:3918
@deffn primitive copy-tree obj
Recursively copy the data tree that is bound to @var{obj}, and return a
pointer to the new data structure. @code{copy-tree} recurses down the
@@ -1072,14 +1035,14 @@ any other object.
@end deffn
primitive-eval
-@c snarfed from eval.c:3938
+@c snarfed from eval.c:4011
@deffn primitive primitive-eval exp
Evaluate @var{exp} in the top-level environment specified by
the current module.
@end deffn
eval
-@c snarfed from eval.c:4007
+@c snarfed from eval.c:4080
@deffn primitive eval exp module
Evaluate @var{exp}, a list representing a Scheme expression,
in the top-level environment specified by @var{module}.
@@ -1088,18 +1051,8 @@ While @var{exp} is evaluated (using @var{primitive-eval}),
is reset to its previous value when @var{eval} returns.
@end deffn
- eval2
-@c snarfed from eval.c:4051
-@deffn primitive eval2 obj env_thunk
-Evaluate @var{exp}, a Scheme expression, in the environment
-designated by @var{lookup}, a symbol-lookup function.
-Do not use this version of eval, it does not play well
-with the module system. Use @code{eval} or
-@code{primitive-eval} instead.
-@end deffn
-
eval-options-interface
-@c snarfed from eval.c:1697
+@c snarfed from eval.c:1747
@deffn primitive eval-options-interface [setting]
Option interface for the evaluation options. Instead of using
this procedure directly, use the procedures @code{eval-enable},
@@ -1107,400 +1060,74 @@ this procedure directly, use the procedures @code{eval-enable},
@end deffn
evaluator-traps-interface
-@c snarfed from eval.c:1714
+@c snarfed from eval.c:1764
@deffn primitive evaluator-traps-interface [setting]
Option interface for the evaluator trap options.
@end deffn
defined?
-@c snarfed from evalext.c:74
+@c snarfed from evalext.c:75
@deffn primitive defined? sym [env]
-Return @code{#t} if @var{sym} is defined in the top-level environment.
+Return @code{#t} if @var{sym} is defined in the lexical environment @var{env}. When @var{env} is not specified, look in the top-level environment as defined by the current module.
@end deffn
map-in-order
-@c snarfed from evalext.c:146
+@c snarfed from evalext.c:144
@deffn primitive map-in-order
-scm_map
-@end deffn
-
- program-arguments
-@c snarfed from feature.c:79
-@deffn primitive program-arguments
-@deffnx procedure command-line
-Return the list of command line arguments passed to Guile, as a list of
-strings. The list includes the invoked program name, which is usually
-@code{"guile"}, but excludes switches and parameters for command line
-options like @code{-e} and @code{-l}.
-@end deffn
-
- chown
-@c snarfed from filesys.c:140
-@deffn primitive chown object owner group
-Change the ownership and group of the file referred to by @var{object} to
-the integer values @var{owner} and @var{group}. @var{object} can be
-a string containing a file name or, if the platform
-supports fchown, a port or integer file descriptor
-which is open on the file. The return value
-is unspecified.
-
-If @var{object} is a symbolic link, either the
-ownership of the link or the ownership of the referenced file will be
-changed depending on the operating system (lchown is
-unsupported at present). If @var{owner} or @var{group} is specified
-as @code{-1}, then that ID is not changed.
-@end deffn
-
- chmod
-@c snarfed from filesys.c:180
-@deffn primitive chmod object mode
-Changes the permissions of the file referred to by @var{obj}.
-@var{obj} can be a string containing a file name or a port or integer file
-descriptor which is open on a file (in which case @code{fchmod} is used
-as the underlying system call).
-@var{mode} specifies
-the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}.
-The return value is unspecified.
-@end deffn
-
- umask
-@c snarfed from filesys.c:214
-@deffn primitive umask [mode]
-If @var{mode} is omitted, retuns a decimal number representing the current
-file creation mask. Otherwise the file creation mask is set to
-@var{mode} and the previous value is returned.
-
-E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.
-@end deffn
-
- open-fdes
-@c snarfed from filesys.c:237
-@deffn primitive open-fdes path flags [mode]
-Similar to @code{open} but return a file descriptor instead of
-a port.
-@end deffn
-
- open
-@c snarfed from filesys.c:280
-@deffn primitive open path flags [mode]
-Open the file named by @var{path} for reading and/or writing.
-@var{flags} is an integer specifying how the file should be opened.
-@var{mode} is an integer specifying the permission bits of the file, if
-it needs to be created, before the umask is applied. The default is 666
-(Unix itself has no default).
-
-@var{flags} can be constructed by combining variables using @code{logior}.
-Basic flags are:
-
-@defvar O_RDONLY
-Open the file read-only.
-@end defvar
-@defvar O_WRONLY
-Open the file write-only.
-@end defvar
-@defvar O_RDWR
-Open the file read/write.
-@end defvar
-@defvar O_APPEND
-Append to the file instead of truncating.
-@end defvar
-@defvar O_CREAT
-Create the file if it does not already exist.
-@end defvar
-
-See the Unix documentation of the @code{open} system call
-for additional flags.
-@end deffn
-
- close
-@c snarfed from filesys.c:318
-@deffn primitive close fd_or_port
-Similar to close-port (@pxref{Generic Port Operations, close-port}),
-but also works on file descriptors. A side
-effect of closing a file descriptor is that any ports using that file
-descriptor are moved to a different file descriptor and have
-their revealed counts set to zero.
-@end deffn
-
- close-fdes
-@c snarfed from filesys.c:346
-@deffn primitive close-fdes fd
-A simple wrapper for the @code{close} system call.
-Close file descriptor @var{fd}, which must be an integer.
-Unlike close (@pxref{Ports and File Descriptors, close}),
-the file descriptor will be closed even if a port is using it.
-The return value is unspecified.
-@end deffn
-
- stat
-@c snarfed from filesys.c:524
-@deffn primitive stat object
-Return an object containing various information about the file
-determined by @var{obj}. @var{obj} can be a string containing
-a file name or a port or integer file descriptor which is open
-on a file (in which case @code{fstat} is used as the underlying
-system call).
-
-The object returned by @code{stat} can be passed as a single
-parameter to the following procedures, all of which return
-integers:
-
-@table @code
-@item stat:dev
-The device containing the file.
-@item stat:ino
-The file serial number, which distinguishes this file from all
-other files on the same device.
-@item stat:mode
-The mode of the file. This includes file type information and
-the file permission bits. See @code{stat:type} and
-@code{stat:perms} below.
-@item stat:nlink
-The number of hard links to the file.
-@item stat:uid
-The user ID of the file's owner.
-@item stat:gid
-The group ID of the file.
-@item stat:rdev
-Device ID; this entry is defined only for character or block
-special files.
-@item stat:size
-The size of a regular file in bytes.
-@item stat:atime
-The last access time for the file.
-@item stat:mtime
-The last modification time for the file.
-@item stat:ctime
-The last modification time for the attributes of the file.
-@item stat:blksize
-The optimal block size for reading or writing the file, in
-bytes.
-@item stat:blocks
-The amount of disk space that the file occupies measured in
-units of 512 byte blocks.
-@end table
-
-In addition, the following procedures return the information
-from stat:mode in a more convenient form:
-
-@table @code
-@item stat:type
-A symbol representing the type of file. Possible values are
-regular, directory, symlink, block-special, char-special, fifo,
-socket and unknown
-@item stat:perms
-An integer representing the access permission bits.
-@end table
-@end deffn
-
- link
-@c snarfed from filesys.c:570
-@deffn primitive link oldpath newpath
-Creates a new name @var{newpath} in the file system for the
-file named by @var{oldpath}. If @var{oldpath} is a symbolic
-link, the link may or may not be followed depending on the
-system.
-@end deffn
-
- rename-file
-@c snarfed from filesys.c:592
-@deffn primitive rename-file oldname newname
-Renames the file specified by @var{oldname} to @var{newname}.
-The return value is unspecified.
-@end deffn
-
- delete-file
-@c snarfed from filesys.c:621
-@deffn primitive delete-file str
-Deletes (or "unlinks") the file specified by @var{path}.
+implemented by the C function "scm_map"
@end deffn
- mkdir
-@c snarfed from filesys.c:640
-@deffn primitive mkdir path [mode]
-Create a new directory named by @var{path}. If @var{mode} is omitted
-then the permissions of the directory file are set using the current
-umask. Otherwise they are set to the decimal value specified with
-@var{mode}. The return value is unspecified.
-@end deffn
+ load-extension
+@c snarfed from extensions.c:153
+@deffn primitive load-extension lib init
+Load and initilize the extension designated by LIB and INIT.
+When there is no pre-registered function for LIB/INIT, this is
+equivalent to
- rmdir
-@c snarfed from filesys.c:669
-@deffn primitive rmdir path
-Remove the existing directory named by @var{path}. The directory must
-be empty for this to succeed. The return value is unspecified.
-@end deffn
-
- directory-stream?
-@c snarfed from filesys.c:695
-@deffn primitive directory-stream? obj
-Return a boolean indicating whether @var{object} is a directory
-stream as returned by @code{opendir}.
-@end deffn
-
- opendir
-@c snarfed from filesys.c:706
-@deffn primitive opendir dirname
-Open the directory specified by @var{path} and return a directory
-stream.
-@end deffn
-
- readdir
-@c snarfed from filesys.c:724
-@deffn primitive readdir port
-Return (as a string) the next directory entry from the directory stream
-@var{stream}. If there is no remaining entry to be read then the
-end of file object is returned.
-@end deffn
-
- rewinddir
-@c snarfed from filesys.c:747
-@deffn primitive rewinddir port
-Reset the directory port @var{stream} so that the next call to
-@code{readdir} will return the first directory entry.
-@end deffn
-
- closedir
-@c snarfed from filesys.c:764
-@deffn primitive closedir port
-Close the directory stream @var{stream}.
-The return value is unspecified.
-@end deffn
-
- chdir
-@c snarfed from filesys.c:814
-@deffn primitive chdir str
-Change the current working directory to @var{path}.
-The return value is unspecified.
-@end deffn
-
- getcwd
-@c snarfed from filesys.c:831
-@deffn primitive getcwd
-Return the name of the current working directory.
-@end deffn
-
- select
-@c snarfed from filesys.c:1028
-@deffn primitive select reads writes excepts [secs [usecs]]
-This procedure has a variety of uses: waiting for the ability
-to provide input, accept output, or the existance of
-exceptional conditions on a collection of ports or file
-descriptors, or waiting for a timeout to occur.
-It also returns if interrupted by a signal.
-
-@var{reads}, @var{writes} and @var{excepts} can be lists or
-vectors, with each member a port or a file descriptor.
-The value returned is a list of three corresponding
-lists or vectors containing only the members which meet the
-specified requirement. The ability of port buffers to
-provide input or accept output is taken into account.
-Ordering of the input lists or vectors is not preserved.
-
-The optional arguments @var{secs} and @var{usecs} specify the
-timeout. Either @var{secs} can be specified alone, as
-either an integer or a real number, or both @var{secs} and
-@var{usecs} can be specified as integers, in which case
-@var{usecs} is an additional timeout expressed in
-microseconds. If @var{secs} is omitted or is @code{#f} then
-select will wait for as long as it takes for one of the other
-conditions to be satisfied.
-
-The scsh version of @code{select} differs as follows:
-Only vectors are accepted for the first three arguments.
-The @var{usecs} argument is not supported.
-Multiple values are returned instead of a list.
-Duplicates in the input vectors appear only once in output.
-An additional @code{select!} interface is provided.
-@end deffn
-
- fcntl
-@c snarfed from filesys.c:1173
-@deffn primitive fcntl object cmd [value]
-Apply @var{command} to the specified file descriptor or the underlying
-file descriptor of the specified port. @var{value} is an optional
-integer argument.
+@lisp
+(dynamic-call INIT (dynamic-link LIB))
+@end lisp
-Values for @var{command} are:
+When there is a pre-registered function, that function is called
+instead.
-@table @code
-@item F_DUPFD
-Duplicate a file descriptor
-@item F_GETFD
-Get flags associated with the file descriptor.
-@item F_SETFD
-Set flags associated with the file descriptor to @var{value}.
-@item F_GETFL
-Get flags associated with the open file.
-@item F_SETFL
-Set flags associated with the open file to @var{value}
-@item F_GETOWN
-Get the process ID of a socket's owner, for @code{SIGIO} signals.
-@item F_SETOWN
-Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.
-@item FD_CLOEXEC
-The value used to indicate the "close on exec" flag with @code{F_GETFL} or
-@code{F_SETFL}.
-@end table
-@end deffn
+Normally, there is no pre-registered function. This option exists
+only for situations where dynamic linking is unavailable or unwanted.
+In that case, you would statically link your program with the desired
+library, and register its init function right after Guile has been
+initialized.
- fsync
-@c snarfed from filesys.c:1209
-@deffn primitive fsync object
-Copies any unwritten data for the specified output file descriptor to disk.
-If @var{port/fd} is a port, its buffer is flushed before the underlying
-file descriptor is fsync'd.
-The return value is unspecified.
-@end deffn
+LIB should be a string denoting a shared library without any file type
+suffix such as ".so". The suffix is provided automatically. It
+should also not contain any directory components. Libraries that
+implement Guile Extensions should be put into the normal locations for
+shared libraries. We recommend to use the naming convention
+libguile-bla-blum for a extension related to a module `(bla blum)'.
- symlink
-@c snarfed from filesys.c:1236
-@deffn primitive symlink oldpath newpath
-Create a symbolic link named @var{path-to} with the value (i.e., pointing to)
-@var{path-from}. The return value is unspecified.
-@end deffn
+The normal way for a extension to be used is to write a small Scheme
+file that defines a module, and to load the extension into this
+module. When the module is auto-loaded, the extension is loaded as
+well. For example,
- readlink
-@c snarfed from filesys.c:1257
-@deffn primitive readlink path
-Return the value of the symbolic link named by @var{path} (a
-string), i.e., the file that the link points to.
-@end deffn
-
- lstat
-@c snarfed from filesys.c:1287
-@deffn primitive lstat str
-Similar to @code{stat}, but does not follow symbolic links, i.e.,
-it will return information about a symbolic link itself, not the
-file it points to. @var{path} must be a string.
-@end deffn
-
- copy-file
-@c snarfed from filesys.c:1312
-@deffn primitive copy-file oldfile newfile
-Copy the file specified by @var{path-from} to @var{path-to}.
-The return value is unspecified.
-@end deffn
+@lisp
+(define-module (bla blum))
- dirname
-@c snarfed from filesys.c:1359
-@deffn primitive dirname filename
-Return the directory name component of the file name
-@var{filename}. If @var{filename} does not contain a directory
-component, @code{.} is returned.
+(load-extension "libguile-bla-blum" "bla_init_blum")
+@end lisp
@end deffn
- basename
-@c snarfed from filesys.c:1392
-@deffn primitive basename filename [suffix]
-Return the base name of the file name @var{filename}. The
-base name is the file name without any directory components.
-If @var{suffix} is privided, and is equal to the end of
-@var{basename}, it is removed also.
+ program-arguments
+@c snarfed from feature.c:77
+@deffn primitive program-arguments
+@deffnx procedure command-line
+Return the list of command line arguments passed to Guile, as a list of
+strings. The list includes the invoked program name, which is usually
+@code{"guile"}, but excludes switches and parameters for command line
+options like @code{-e} and @code{-l}.
@end deffn
make-fluid
-@c snarfed from fluids.c:124
+@c snarfed from fluids.c:123
@deffn primitive make-fluid
Return a newly created fluid.
Fluids are objects of a certain type (a smob) that can hold one SCM
@@ -1512,14 +1139,14 @@ in its own dynamic root, you can use fluids for thread local storage.
@end deffn
fluid?
-@c snarfed from fluids.c:137
+@c snarfed from fluids.c:136
@deffn primitive fluid? obj
Return @code{#t} iff @var{obj} is a fluid; otherwise, return
@code{#f}.
@end deffn
fluid-ref
-@c snarfed from fluids.c:148
+@c snarfed from fluids.c:147
@deffn primitive fluid-ref fluid
Return the value associated with @var{fluid} in the current
dynamic root. If @var{fluid} has not been set, then return
@@ -1527,13 +1154,13 @@ dynamic root. If @var{fluid} has not been set, then return
@end deffn
fluid-set!
-@c snarfed from fluids.c:165
+@c snarfed from fluids.c:163
@deffn primitive fluid-set! fluid value
Set the value associated with @var{fluid} in the current dynamic root.
@end deffn
with-fluids*
-@c snarfed from fluids.c:224
+@c snarfed from fluids.c:222
@deffn primitive with-fluids* fluids values thunk
Set @var{fluids} to @var{values} temporary, and call @var{thunk}.
@var{fluids} must be a list of fluids and @var{values} must be the same
@@ -1542,7 +1169,7 @@ one after another. @var{thunk} must be a procedure with no argument.
@end deffn
setvbuf
-@c snarfed from fports.c:148
+@c snarfed from fports.c:155
@deffn primitive setvbuf port mode [size]
Set the buffering mode for @var{port}. @var{mode} can be:
@table @code
@@ -1557,13 +1184,13 @@ If @var{size} is omitted, a default size will be used.
@end deffn
file-port?
-@c snarfed from fports.c:229
+@c snarfed from fports.c:237
@deffn primitive file-port? obj
Determine whether @var{obj} is a port that is related to a file.
@end deffn
open-file
-@c snarfed from fports.c:283
+@c snarfed from fports.c:291
@deffn primitive open-file filename mode
Open the file whose name is @var{filename}, and return a port
representing that file. The attributes of the port are
@@ -1605,35 +1232,28 @@ requested, @code{open-file} throws an exception.
@end deffn
gc-stats
-@c snarfed from gc.c:749
+@c snarfed from gc.c:796
@deffn primitive gc-stats
Return an association list of statistics about Guile's current
use of storage.
@end deffn
object-address
-@c snarfed from gc.c:846
+@c snarfed from gc.c:893
@deffn primitive object-address obj
Return an integer that for the lifetime of @var{obj} is uniquely
returned by this function for @var{obj}
@end deffn
gc
-@c snarfed from gc.c:857
+@c snarfed from gc.c:904
@deffn primitive gc
Scans all of SCM objects and reclaims for further use those that are
no longer accessible.
@end deffn
- unhash-name
-@c snarfed from gc.c:2306
-@deffn primitive unhash-name name
-Flushes the glocs for @var{name}, or all glocs if @var{name}
-is @code{#t}.
-@end deffn
-
%compute-slots
-@c snarfed from goops.c:290
+@c snarfed from goops.c:291
@deffn primitive %compute-slots class
Return a list consisting of the names of all slots belonging to
class @var{class}, i. e. the slots of @var{class} and of all of
@@ -1641,7 +1261,7 @@ its superclasses.
@end deffn
get-keyword
-@c snarfed from goops.c:375
+@c snarfed from goops.c:376
@deffn primitive get-keyword key l default_value
Determine an associated value for the keyword @var{key} from
the list @var{l}. The list @var{l} has to consist of an even
@@ -1652,276 +1272,292 @@ If @var{l} does not hold a value for @var{key}, the value
@end deffn
%initialize-object
-@c snarfed from goops.c:398
+@c snarfed from goops.c:399
@deffn primitive %initialize-object obj initargs
Initialize the object @var{obj} with the given arguments
@var{initargs}.
@end deffn
%prep-layout!
-@c snarfed from goops.c:479
+@c snarfed from goops.c:480
@deffn primitive %prep-layout! class
+
@end deffn
%inherit-magic!
-@c snarfed from goops.c:542
+@c snarfed from goops.c:557
@deffn primitive %inherit-magic! class dsupers
+
@end deffn
instance?
-@c snarfed from goops.c:783
+@c snarfed from goops.c:800
@deffn primitive instance? obj
Return @code{#t} if @var{obj} is an instance.
@end deffn
class-name
-@c snarfed from goops.c:798
+@c snarfed from goops.c:815
@deffn primitive class-name obj
Return the class name of @var{obj}.
@end deffn
class-direct-supers
-@c snarfed from goops.c:808
+@c snarfed from goops.c:825
@deffn primitive class-direct-supers obj
Return the direct superclasses of the class @var{obj}.
@end deffn
class-direct-slots
-@c snarfed from goops.c:818
+@c snarfed from goops.c:835
@deffn primitive class-direct-slots obj
Return the direct slots of the class @var{obj}.
@end deffn
class-direct-subclasses
-@c snarfed from goops.c:828
+@c snarfed from goops.c:845
@deffn primitive class-direct-subclasses obj
Return the direct subclasses of the class @var{obj}.
@end deffn
class-direct-methods
-@c snarfed from goops.c:838
+@c snarfed from goops.c:855
@deffn primitive class-direct-methods obj
Return the direct methods of the class @var{obj}
@end deffn
class-precedence-list
-@c snarfed from goops.c:848
+@c snarfed from goops.c:865
@deffn primitive class-precedence-list obj
Return the class precedence list of the class @var{obj}.
@end deffn
class-slots
-@c snarfed from goops.c:858
+@c snarfed from goops.c:875
@deffn primitive class-slots obj
Return the slot list of the class @var{obj}.
@end deffn
class-environment
-@c snarfed from goops.c:868
+@c snarfed from goops.c:885
@deffn primitive class-environment obj
Return the environment of the class @var{obj}.
@end deffn
generic-function-name
-@c snarfed from goops.c:879
+@c snarfed from goops.c:896
@deffn primitive generic-function-name obj
Return the name of the generic function @var{obj}.
@end deffn
generic-function-methods
-@c snarfed from goops.c:889
+@c snarfed from goops.c:906
@deffn primitive generic-function-methods obj
Return the methods of the generic function @var{obj}.
@end deffn
method-generic-function
-@c snarfed from goops.c:900
+@c snarfed from goops.c:917
@deffn primitive method-generic-function obj
Return the generic function fot the method @var{obj}.
@end deffn
method-specializers
-@c snarfed from goops.c:910
+@c snarfed from goops.c:927
@deffn primitive method-specializers obj
Return specializers of the method @var{obj}.
@end deffn
method-procedure
-@c snarfed from goops.c:920
+@c snarfed from goops.c:937
@deffn primitive method-procedure obj
Return the procedure of the method @var{obj}.
@end deffn
accessor-method-slot-definition
-@c snarfed from goops.c:930
+@c snarfed from goops.c:947
@deffn primitive accessor-method-slot-definition obj
Return the slot definition of the accessor @var{obj}.
@end deffn
%tag-body
-@c snarfed from goops.c:940
+@c snarfed from goops.c:957
@deffn primitive %tag-body body
Internal GOOPS magic---don't use this function!
@end deffn
make-unbound
-@c snarfed from goops.c:955
+@c snarfed from goops.c:972
@deffn primitive make-unbound
Return the unbound value.
@end deffn
unbound?
-@c snarfed from goops.c:964
+@c snarfed from goops.c:981
@deffn primitive unbound? obj
Return @code{#t} if @var{obj} is unbound.
@end deffn
assert-bound
-@c snarfed from goops.c:974
+@c snarfed from goops.c:991
@deffn primitive assert-bound value obj
Return @var{value} if it is bound, and invoke the
@var{slot-unbound} method of @var{obj} if it is not.
@end deffn
@@assert-bound-ref
-@c snarfed from goops.c:986
+@c snarfed from goops.c:1003
@deffn primitive @@assert-bound-ref obj index
Like @code{assert-bound}, but use @var{index} for accessing
the value from @var{obj}.
@end deffn
%fast-slot-ref
-@c snarfed from goops.c:998
+@c snarfed from goops.c:1015
@deffn primitive %fast-slot-ref obj index
Return the slot value with index @var{index} from @var{obj}.
@end deffn
%fast-slot-set!
-@c snarfed from goops.c:1015
+@c snarfed from goops.c:1033
@deffn primitive %fast-slot-set! obj index value
Set the slot with index @var{index} in @var{obj} to
@var{value}.
@end deffn
slot-ref-using-class
-@c snarfed from goops.c:1143
+@c snarfed from goops.c:1163
@deffn primitive slot-ref-using-class class obj slot_name
+
@end deffn
slot-set-using-class!
-@c snarfed from goops.c:1162
+@c snarfed from goops.c:1182
@deffn primitive slot-set-using-class! class obj slot_name value
+
@end deffn
slot-bound-using-class?
-@c snarfed from goops.c:1176
+@c snarfed from goops.c:1196
@deffn primitive slot-bound-using-class? class obj slot_name
+
@end deffn
slot-exists-using-class?
-@c snarfed from goops.c:1191
+@c snarfed from goops.c:1211
@deffn primitive slot-exists-using-class? class obj slot_name
+
@end deffn
slot-ref
-@c snarfed from goops.c:1207
+@c snarfed from goops.c:1227
@deffn primitive slot-ref obj slot_name
Return the value from @var{obj}'s slot with the name
@var{slot_name}.
@end deffn
slot-set!
-@c snarfed from goops.c:1224
+@c snarfed from goops.c:1244
@deffn primitive slot-set! obj slot_name value
Set the slot named @var{slot_name} of @var{obj} to @var{value}.
@end deffn
slot-bound?
-@c snarfed from goops.c:1241
+@c snarfed from goops.c:1261
@deffn primitive slot-bound? obj slot_name
Return @code{#t} if the slot named @var{slot_name} of @var{obj}
is bound.
@end deffn
slot-exists?
-@c snarfed from goops.c:1259
+@c snarfed from goops.c:1279
@deffn primitive slot-exists? obj slot_name
Return @code{#t} if @var{obj} has a slot named @var{slot_name}.
@end deffn
%allocate-instance
-@c snarfed from goops.c:1302
+@c snarfed from goops.c:1323
@deffn primitive %allocate-instance class initargs
Create a new instance of class @var{class} and initialize it
from the arguments @var{initargs}.
@end deffn
%set-object-setter!
-@c snarfed from goops.c:1375
+@c snarfed from goops.c:1396
@deffn primitive %set-object-setter! obj setter
+
@end deffn
%modify-instance
-@c snarfed from goops.c:1400
+@c snarfed from goops.c:1421
@deffn primitive %modify-instance old new
+
@end deffn
%modify-class
-@c snarfed from goops.c:1426
+@c snarfed from goops.c:1447
@deffn primitive %modify-class old new
+
@end deffn
%invalidate-class
-@c snarfed from goops.c:1450
+@c snarfed from goops.c:1471
@deffn primitive %invalidate-class class
+
@end deffn
%invalidate-method-cache!
-@c snarfed from goops.c:1571
+@c snarfed from goops.c:1598
@deffn primitive %invalidate-method-cache! gf
+
@end deffn
generic-capability?
-@c snarfed from goops.c:1597
+@c snarfed from goops.c:1624
@deffn primitive generic-capability? proc
+
@end deffn
enable-primitive-generic!
-@c snarfed from goops.c:1610
+@c snarfed from goops.c:1637
@deffn primitive enable-primitive-generic! . subrs
+
@end deffn
primitive-generic-generic
-@c snarfed from goops.c:1630
+@c snarfed from goops.c:1658
@deffn primitive primitive-generic-generic subr
+
@end deffn
make
-@c snarfed from goops.c:1989
+@c snarfed from goops.c:2019
@deffn primitive make . args
Make a new object. @var{args} must contain the class and
all necessary initialization information.
@end deffn
find-method
-@c snarfed from goops.c:2082
+@c snarfed from goops.c:2112
@deffn primitive find-method . l
+
@end deffn
%method-more-specific?
-@c snarfed from goops.c:2102
+@c snarfed from goops.c:2132
@deffn primitive %method-more-specific? m1 m2 targs
+
@end deffn
%goops-loaded
-@c snarfed from goops.c:2634
+@c snarfed from goops.c:2660
@deffn primitive %goops-loaded
Announce that GOOPS is loaded and perform initialization
on the C level which depends on the loaded GOOPS modules.
@end deffn
make-guardian
-@c snarfed from guardians.c:336
+@c snarfed from guardians.c:331
@deffn primitive make-guardian [greedy_p]
Create a new guardian.
A guardian protects a set of objects from garbage collection,
@@ -1951,19 +1587,19 @@ paper still (mostly) accurately describes the interface).
@end deffn
guardian-destroyed?
-@c snarfed from guardians.c:364
+@c snarfed from guardians.c:359
@deffn primitive guardian-destroyed? guardian
Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}.
@end deffn
guardian-greedy?
-@c snarfed from guardians.c:382
+@c snarfed from guardians.c:377
@deffn primitive guardian-greedy? guardian
Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.
@end deffn
destroy-guardian!
-@c snarfed from guardians.c:393
+@c snarfed from guardians.c:388
@deffn primitive destroy-guardian! guardian
Destroys @var{guardian}, by making it impossible to put any more
objects in it or get any objects from it. It also unguards any
@@ -1971,7 +1607,7 @@ objects guarded by @var{guardian}.
@end deffn
hashq
-@c snarfed from hash.c:202
+@c snarfed from hash.c:200
@deffn primitive hashq key size
Determine a hash value for @var{key} that is suitable for
lookups in a hashtable of size @var{size}, where @code{eq?} is
@@ -1986,7 +1622,7 @@ different values, since @code{foo} will be garbage collected.
@end deffn
hashv
-@c snarfed from hash.c:238
+@c snarfed from hash.c:236
@deffn primitive hashv key size
Determine a hash value for @var{key} that is suitable for
lookups in a hashtable of size @var{size}, where @code{eqv?} is
@@ -2001,7 +1637,7 @@ different values, since @code{foo} will be garbage collected.
@end deffn
hash
-@c snarfed from hash.c:261
+@c snarfed from hash.c:259
@deffn primitive hash key size
Determine a hash value for @var{key} that is suitable for
lookups in a hashtable of size @var{size}, where @code{equal?}
@@ -2131,7 +1767,7 @@ Remove @var{key} (and any value associated with it) from
@end deffn
hashx-get-handle
-@c snarfed from hashtab.c:428
+@c snarfed from hashtab.c:422
@deffn primitive hashx-get-handle hash assoc table key
This behaves the same way as the corresponding
@code{-get-handle} function, but uses @var{hash} as a hash
@@ -2142,7 +1778,7 @@ table size. @code{assoc} must be an associator function, like
@end deffn
hashx-create-handle!
-@c snarfed from hashtab.c:447
+@c snarfed from hashtab.c:441
@deffn primitive hashx-create-handle! hash assoc table key init
This behaves the same way as the corresponding
@code{-create-handle} function, but uses @var{hash} as a hash
@@ -2153,7 +1789,7 @@ table size. @code{assoc} must be an associator function, like
@end deffn
hashx-ref
-@c snarfed from hashtab.c:470
+@c snarfed from hashtab.c:464
@deffn primitive hashx-ref hash assoc table key [dflt]
This behaves the same way as the corresponding @code{ref}
function, but uses @var{hash} as a hash function and
@@ -2167,7 +1803,7 @@ equivalent to @code{hashx-ref hashq assq table key}.
@end deffn
hashx-set!
-@c snarfed from hashtab.c:496
+@c snarfed from hashtab.c:490
@deffn primitive hashx-set! hash assoc table key val
This behaves the same way as the corresponding @code{set!}
function, but uses @var{hash} as a hash function and
@@ -2181,7 +1817,7 @@ equivalent to @code{hashx-set! hashq assq table key}.
@end deffn
hash-fold
-@c snarfed from hashtab.c:534
+@c snarfed from hashtab.c:528
@deffn primitive hash-fold proc init table
An iterator over hash-table elements.
Accumulates and returns a result by applying PROC successively.
@@ -2193,70 +1829,66 @@ For example, @code{(hash-fold acons () tab)} will convert a hash
table into an a-list of key-value pairs.
@end deffn
- make-hook-with-name
-@c snarfed from hooks.c:217
-@deffn primitive make-hook-with-name name [n_args]
-Create a named hook with the name @var{name} for storing
-procedures of arity @var{n_args}. @var{n_args} defaults to
-zero.
-@end deffn
-
make-hook
-@c snarfed from hooks.c:232
+@c snarfed from hooks.c:179
@deffn primitive make-hook [n_args]
-Create a hook for storing procedure of arity
-@var{n_args}. @var{n_args} defaults to zero.
+Create a hook for storing procedure of arity @var{n_args}.
+@var{n_args} defaults to zero. The returned value is a hook
+object to be used with the other hook procedures.
@end deffn
hook?
-@c snarfed from hooks.c:242
+@c snarfed from hooks.c:202
@deffn primitive hook? x
Return @code{#t} if @var{x} is a hook, @code{#f} otherwise.
@end deffn
hook-empty?
-@c snarfed from hooks.c:253
+@c snarfed from hooks.c:213
@deffn primitive hook-empty? hook
Return @code{#t} if @var{hook} is an empty hook, @code{#f}
otherwise.
@end deffn
add-hook!
-@c snarfed from hooks.c:266
+@c snarfed from hooks.c:227
@deffn primitive add-hook! hook proc [append_p]
Add the procedure @var{proc} to the hook @var{hook}. The
procedure is added to the end if @var{append_p} is true,
-otherwise it is added to the front.
+otherwise it is added to the front. The return value of this
+procedure is not specified.
@end deffn
remove-hook!
-@c snarfed from hooks.c:292
+@c snarfed from hooks.c:254
@deffn primitive remove-hook! hook proc
-Remove the procedure @var{proc} from the hook @var{hook}.
+Remove the procedure @var{proc} from the hook @var{hook}. The
+return value of this procedure is not specified.
@end deffn
reset-hook!
-@c snarfed from hooks.c:305
+@c snarfed from hooks.c:268
@deffn primitive reset-hook! hook
-Remove all procedures from the hook @var{hook}.
+Remove all procedures from the hook @var{hook}. The return
+value of this procedure is not specified.
@end deffn
run-hook
-@c snarfed from hooks.c:319
+@c snarfed from hooks.c:282
@deffn primitive run-hook hook . args
Apply all procedures from the hook @var{hook} to the arguments
@var{args}. The order of the procedure application is first to
-last.
+last. The return value of this procedure is not specified.
@end deffn
hook->list
-@c snarfed from hooks.c:346
+@c snarfed from hooks.c:309
@deffn primitive hook->list hook
Convert the procedure list of @var{hook} to a list.
@end deffn
ftell
-@c snarfed from ioext.c:71
+@c snarfed from ioext.c:73
@deffn primitive ftell fd_port
Return an integer representing the current position of
@var{fd/port}, measured from the beginning. Equivalent to:
@@ -2267,7 +1899,7 @@ Return an integer representing the current position of
@end deffn
redirect-port
-@c snarfed from ioext.c:89
+@c snarfed from ioext.c:91
@deffn primitive redirect-port old new
This procedure takes two ports and duplicates the underlying file
descriptor from @var{old-port} into @var{new-port}. The
@@ -2285,7 +1917,7 @@ revealed counts.
@end deffn
dup->fdes
-@c snarfed from ioext.c:128
+@c snarfed from ioext.c:130
@deffn primitive dup->fdes fd_or_port [fd]
Return a new integer file descriptor referring to the open file
designated by @var{fd_or_port}, which must be either an open
@@ -2293,7 +1925,7 @@ file port or a file descriptor.
@end deffn
dup2
-@c snarfed from ioext.c:175
+@c snarfed from ioext.c:177
@deffn primitive dup2 oldfd newfd
A simple wrapper for the @code{dup2} system call.
Copies the file descriptor @var{oldfd} to descriptor
@@ -2306,21 +1938,21 @@ The return value is unspecified.
@end deffn
fileno
-@c snarfed from ioext.c:194
+@c snarfed from ioext.c:196
@deffn primitive fileno port
Return the integer file descriptor underlying @var{port}. Does
not change its revealed count.
@end deffn
isatty?
-@c snarfed from ioext.c:210
+@c snarfed from ioext.c:216
@deffn primitive isatty? port
Return @code{#t} if @var{port} is using a serial non--file
device, otherwise @code{#f}.
@end deffn
fdopen
-@c snarfed from ioext.c:232
+@c snarfed from ioext.c:238
@deffn primitive fdopen fdes modes
Return a new port based on the file descriptor @var{fdes}.
Modes are given by the string @var{modes}. The revealed count
@@ -2329,7 +1961,7 @@ same as that accepted by @ref{File Ports, open-file}.
@end deffn
primitive-move->fdes
-@c snarfed from ioext.c:257
+@c snarfed from ioext.c:262
@deffn primitive primitive-move->fdes port fd
Moves the underlying file descriptor for @var{port} to the integer
value @var{fdes} without changing the revealed count of @var{port}.
@@ -2340,7 +1972,7 @@ required value or @code{#t} if it was moved.
@end deffn
fdes->ports
-@c snarfed from ioext.c:291
+@c snarfed from ioext.c:296
@deffn primitive fdes->ports fd
Return a list of existing ports which have @var{fdes} as an
underlying file descriptor, without changing their revealed
@@ -2348,7 +1980,7 @@ counts.
@end deffn
make-keyword-from-dash-symbol
-@c snarfed from keywords.c:71
+@c snarfed from keywords.c:74
@deffn primitive make-keyword-from-dash-symbol symbol
Make a keyword object from a @var{symbol} that starts with a dash.
@end deffn
@@ -2368,7 +2000,7 @@ This is the inverse of @code{make-keyword-from-dash-symbol}.
@end deffn
nil-cons
-@c snarfed from lang.c:71
+@c snarfed from lang.c:69
@deffn primitive nil-cons x y
Create a new cons cell with @var{x} as the car and @var{y} as
the cdr, but convert @var{y} to Scheme's end-of-list if it is
@@ -2376,48 +2008,42 @@ a LISP nil.
@end deffn
nil-car
-@c snarfed from lang.c:86
+@c snarfed from lang.c:84
@deffn primitive nil-car x
Return the car of @var{x}, but convert it to LISP nil if it
is Scheme's end-of-list.
@end deffn
nil-cdr
-@c snarfed from lang.c:99
+@c snarfed from lang.c:97
@deffn primitive nil-cdr x
Return the cdr of @var{x}, but convert it to LISP nil if it
is Scheme's end-of-list.
@end deffn
null
-@c snarfed from lang.c:114
+@c snarfed from lang.c:112
@deffn primitive null x
Return LISP's @code{t} if @var{x} is nil in the LISP sense,
return LISP's nil otherwise.
@end deffn
nil-eq
-@c snarfed from lang.c:143
+@c snarfed from lang.c:141
@deffn primitive nil-eq x y
Compare @var{x} and @var{y} and return LISP's t if they are
@code{eq?}, return LISP's nil otherwise.
@end deffn
list
-@c snarfed from list.c:84
+@c snarfed from list.c:128
@deffn primitive list . objs
Return a list containing @var{objs}, the arguments to
@code{list}.
@end deffn
- list*
-@c snarfed from list.c:94
-@deffn primitive list*
-scm_cons_star
-@end deffn
-
cons*
-@c snarfed from list.c:105
+@c snarfed from list.c:143
@deffn primitive cons* arg . rest
Like @code{list}, but the last arg provides the tail of the
constructed list, returning @code{(cons @var{arg1} (cons
@@ -2428,25 +2054,25 @@ Schemes and in Common LISP.
@end deffn
null?
-@c snarfed from list.c:129
+@c snarfed from list.c:167
@deffn primitive null? x
Return @code{#t} iff @var{x} is the empty list, else @code{#f}.
@end deffn
list?
-@c snarfed from list.c:139
+@c snarfed from list.c:177
@deffn primitive list? x
Return @code{#t} iff @var{x} is a proper list, else @code{#f}.
@end deffn
length
-@c snarfed from list.c:180
+@c snarfed from list.c:218
@deffn primitive length lst
Return the number of elements in list @var{lst}.
@end deffn
append
-@c snarfed from list.c:209
+@c snarfed from list.c:247
@deffn primitive append . args
Return a list consisting of the elements the lists passed as
arguments.
@@ -2466,34 +2092,34 @@ if the last argument is not a proper list.
@end deffn
append!
-@c snarfed from list.c:243
+@c snarfed from list.c:281
@deffn primitive append! . lists
A destructive version of @code{append} (@pxref{Pairs and
-Lists,,,r4rs, The Revised^4 Report on Scheme}). The cdr field
+Lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr field
of each list's final pair is changed to point to the head of
the next list, so no consing is performed. Return a pointer to
the mutated list.
@end deffn
last-pair
-@c snarfed from list.c:269
+@c snarfed from list.c:307
@deffn primitive last-pair lst
Return a pointer to the last pair in @var{lst}, signalling an error if
@var{lst} is circular.
@end deffn
reverse
-@c snarfed from list.c:299
+@c snarfed from list.c:337
@deffn primitive reverse lst
Return a new list that contains the elements of @var{lst} but
in reverse order.
@end deffn
reverse!
-@c snarfed from list.c:333
+@c snarfed from list.c:371
@deffn primitive reverse! lst [new_tail]
-A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r4rs,
-The Revised^4 Report on Scheme}). The cdr of each cell in @var{lst} is
+A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r5rs,
+The Revised^5 Report on Scheme}). The cdr of each cell in @var{lst} is
modified to point to the previous list element. Return a pointer to the
head of the reversed list.
@@ -2506,25 +2132,25 @@ of the modified list is not lost, it is wise to save the return value of
@end deffn
list-ref
-@c snarfed from list.c:359
+@c snarfed from list.c:397
@deffn primitive list-ref list k
Return the @var{k}th element from @var{list}.
@end deffn
list-set!
-@c snarfed from list.c:383
+@c snarfed from list.c:421
@deffn primitive list-set! list k val
Set the @var{k}th element of @var{list} to @var{val}.
@end deffn
list-cdr-ref
-@c snarfed from list.c:406
+@c snarfed from list.c:444
@deffn primitive list-cdr-ref
-scm_list_tail
+implemented by the C function "scm_list_tail"
@end deffn
list-tail
-@c snarfed from list.c:415
+@c snarfed from list.c:453
@deffn primitive list-tail lst k
@deffnx primitive list-cdr-ref lst k
Return the "tail" of @var{lst} beginning with its @var{k}th element.
@@ -2536,50 +2162,26 @@ or returning the results of cdring @var{k} times down @var{lst}.
@end deffn
list-cdr-set!
-@c snarfed from list.c:431
+@c snarfed from list.c:469
@deffn primitive list-cdr-set! list k val
Set the @var{k}th cdr of @var{list} to @var{val}.
@end deffn
list-head
-@c snarfed from list.c:460
+@c snarfed from list.c:498
@deffn primitive list-head lst k
Copy the first @var{k} elements from @var{lst} into a new list, and
return it.
@end deffn
list-copy
-@c snarfed from list.c:484
+@c snarfed from list.c:522
@deffn primitive list-copy lst
Return a (newly-created) copy of @var{lst}.
@end deffn
- sloppy-memq
-@c snarfed from list.c:518
-@deffn primitive sloppy-memq x lst
-This procedure behaves like @code{memq}, but does no type or error checking.
-Its use is recommended only in writing Guile internals,
-not for high-level Scheme programs.
-@end deffn
-
- sloppy-memv
-@c snarfed from list.c:535
-@deffn primitive sloppy-memv x lst
-This procedure behaves like @code{memv}, but does no type or error checking.
-Its use is recommended only in writing Guile internals,
-not for high-level Scheme programs.
-@end deffn
-
- sloppy-member
-@c snarfed from list.c:552
-@deffn primitive sloppy-member x lst
-This procedure behaves like @code{member}, but does no type or error checking.
-Its use is recommended only in writing Guile internals,
-not for high-level Scheme programs.
-@end deffn
-
memq
-@c snarfed from list.c:592
+@c snarfed from list.c:576
@deffn primitive memq x lst
Return the first sublist of @var{lst} whose car is @code{eq?}
to @var{x} where the sublists of @var{lst} are the non-empty
@@ -2590,7 +2192,7 @@ returned.
@end deffn
memv
-@c snarfed from list.c:609
+@c snarfed from list.c:592
@deffn primitive memv x lst
Return the first sublist of @var{lst} whose car is @code{eqv?}
to @var{x} where the sublists of @var{lst} are the non-empty
@@ -2601,7 +2203,7 @@ returned.
@end deffn
member
-@c snarfed from list.c:630
+@c snarfed from list.c:613
@deffn primitive member x lst
Return the first sublist of @var{lst} whose car is
@code{equal?} to @var{x} where the sublists of @var{lst} are
@@ -2612,7 +2214,7 @@ empty list) is returned.
@end deffn
delq!
-@c snarfed from list.c:656
+@c snarfed from list.c:638
@deffn primitive delq! item lst
@deffnx primitive delv! item lst
@deffnx primitive delete! item lst
@@ -2625,21 +2227,21 @@ destructive list functions, these functions cannot modify the binding of
@end deffn
delv!
-@c snarfed from list.c:680
+@c snarfed from list.c:662
@deffn primitive delv! item lst
Destructively remove all elements from @var{lst} that are
@code{eqv?} to @var{item}.
@end deffn
delete!
-@c snarfed from list.c:705
+@c snarfed from list.c:687
@deffn primitive delete! item lst
Destructively remove all elements from @var{lst} that are
@code{equal?} to @var{item}.
@end deffn
delq
-@c snarfed from list.c:734
+@c snarfed from list.c:716
@deffn primitive delq item lst
Return a newly-created copy of @var{lst} with elements
@code{eq?} to @var{item} removed. This procedure mirrors
@@ -2648,7 +2250,7 @@ Return a newly-created copy of @var{lst} with elements
@end deffn
delv
-@c snarfed from list.c:747
+@c snarfed from list.c:729
@deffn primitive delv item lst
Return a newly-created copy of @var{lst} with elements
@code{eqv?} to @var{item} removed. This procedure mirrors
@@ -2657,7 +2259,7 @@ Return a newly-created copy of @var{lst} with elements
@end deffn
delete
-@c snarfed from list.c:760
+@c snarfed from list.c:742
@deffn primitive delete item lst
Return a newly-created copy of @var{lst} with elements
@code{equal?} to @var{item} removed. This procedure mirrors
@@ -2666,7 +2268,7 @@ against @var{item} with @code{equal?}.
@end deffn
delq1!
-@c snarfed from list.c:773
+@c snarfed from list.c:755
@deffn primitive delq1! item lst
Like @code{delq!}, but only deletes the first occurrence of
@var{item} from @var{lst}. Tests for equality using
@@ -2674,7 +2276,7 @@ Like @code{delq!}, but only deletes the first occurrence of
@end deffn
delv1!
-@c snarfed from list.c:801
+@c snarfed from list.c:783
@deffn primitive delv1! item lst
Like @code{delv!}, but only deletes the first occurrence of
@var{item} from @var{lst}. Tests for equality using
@@ -2682,7 +2284,7 @@ Like @code{delv!}, but only deletes the first occurrence of
@end deffn
delete1!
-@c snarfed from list.c:829
+@c snarfed from list.c:811
@deffn primitive delete1! item lst
Like @code{delete!}, but only deletes the first occurrence of
@var{item} from @var{lst}. Tests for equality using
@@ -2690,7 +2292,7 @@ Like @code{delete!}, but only deletes the first occurrence of
@end deffn
primitive-load
-@c snarfed from load.c:112
+@c snarfed from load.c:110
@deffn primitive primitive-load filename
Load the file named @var{filename} and evaluate its contents in
the top-level environment. The load paths are not searched;
@@ -2702,7 +2304,7 @@ documentation for @code{%load-hook} later in this section.
@end deffn
%package-data-dir
-@c snarfed from load.c:147
+@c snarfed from load.c:150
@deffn primitive %package-data-dir
Return the name of the directory where Scheme packages, modules and
libraries are kept. On most Unix systems, this will be
@@ -2710,21 +2312,21 @@ libraries are kept. On most Unix systems, this will be
@end deffn
%library-dir
-@c snarfed from load.c:159
+@c snarfed from load.c:162
@deffn primitive %library-dir
Return the directory where the Guile Scheme library files are installed.
E.g., may return "/usr/share/guile/1.3.5".
@end deffn
%site-dir
-@c snarfed from load.c:171
+@c snarfed from load.c:174
@deffn primitive %site-dir
Return the directory where the Guile site files are installed.
E.g., may return "/usr/share/guile/site".
@end deffn
parse-path
-@c snarfed from load.c:223
+@c snarfed from load.c:226
@deffn primitive parse-path path [tail]
Parse @var{path}, which is expected to be a colon-separated
string, into a list and return the resulting list with
@@ -2733,7 +2335,7 @@ is returned.
@end deffn
search-path
-@c snarfed from load.c:273
+@c snarfed from load.c:276
@deffn primitive search-path path filename [extensions]
Search @var{path} for a directory containing a file named
@var{filename}. The file must be readable, and not a directory.
@@ -2745,7 +2347,7 @@ concatenated with each @var{extension}.
@end deffn
%search-load-path
-@c snarfed from load.c:420
+@c snarfed from load.c:423
@deffn primitive %search-load-path filename
Search @var{%load-path} for the file named @var{filename},
which must be readable by the current user. If @var{filename}
@@ -2757,7 +2359,7 @@ will try each extension automatically.
@end deffn
primitive-load-path
-@c snarfed from load.c:441
+@c snarfed from load.c:444
@deffn primitive primitive-load-path filename
Search @var{%load-path} for the file named @var{filename} and
load it into the top-level environment. If @var{filename} is a
@@ -2765,17 +2367,8 @@ relative pathname and is not found in the list of search paths,
an error is signalled.
@end deffn
- read-and-eval!
-@c snarfed from load.c:476
-@deffn primitive read-and-eval! [port]
-Read a form from @var{port} (standard input by default), and evaluate it
-(memoizing it in the process) in the top-level environment. If no data
-is left to be read from @var{port}, an @code{end-of-file} error is
-signalled.
-@end deffn
-
procedure->syntax
-@c snarfed from macros.c:106
+@c snarfed from macros.c:104
@deffn primitive procedure->syntax code
Return a @dfn{macro} which, when a symbol defined to this value
appears as the first symbol in an expression, returns the
@@ -2784,7 +2377,7 @@ environment.
@end deffn
procedure->macro
-@c snarfed from macros.c:129
+@c snarfed from macros.c:127
@deffn primitive procedure->macro code
Return a @dfn{macro} which, when a symbol defined to this value
appears as the first symbol in an expression, evaluates the
@@ -2803,7 +2396,7 @@ passed to @var{code}. For example:
@end deffn
procedure->memoizing-macro
-@c snarfed from macros.c:152
+@c snarfed from macros.c:150
@deffn primitive procedure->memoizing-macro code
Return a @dfn{macro} which, when a symbol defined to this value
appears as the first symbol in an expression, evaluates the
@@ -2822,14 +2415,14 @@ passed to @var{proc}. For example:
@end deffn
macro?
-@c snarfed from macros.c:164
+@c snarfed from macros.c:162
@deffn primitive macro? obj
Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a
syntax transformer.
@end deffn
macro-type
-@c snarfed from macros.c:182
+@c snarfed from macros.c:180
@deffn primitive macro-type m
Return one of the symbols @code{syntax}, @code{macro} or
@code{macro!}, depending on whether @var{m} is a syntax
@@ -2839,32 +2432,32 @@ returned.
@end deffn
macro-name
-@c snarfed from macros.c:200
+@c snarfed from macros.c:198
@deffn primitive macro-name m
Return the name of the macro @var{m}.
@end deffn
macro-transformer
-@c snarfed from macros.c:211
+@c snarfed from macros.c:209
@deffn primitive macro-transformer m
Return the transformer of the macro @var{m}.
@end deffn
current-module
-@c snarfed from modules.c:78
+@c snarfed from modules.c:69
@deffn primitive current-module
Return the current module.
@end deffn
set-current-module
-@c snarfed from modules.c:95
+@c snarfed from modules.c:81
@deffn primitive set-current-module module
Set the current module to @var{module} and return
the previous current module.
@end deffn
interaction-environment
-@c snarfed from modules.c:128
+@c snarfed from modules.c:104
@deffn primitive interaction-environment
Return a specifier for the environment that contains
implementation--defined bindings, typically a superset of those
@@ -2873,153 +2466,90 @@ return the environment in which the implementation would
evaluate expressions dynamically typed by the user.
@end deffn
+ env-module
+@c snarfed from modules.c:253
+@deffn primitive env-module env
+Return the module of @var{ENV}, a lexical environment.
+@end deffn
+
standard-eval-closure
-@c snarfed from modules.c:312
+@c snarfed from modules.c:330
@deffn primitive standard-eval-closure module
Return an eval closure for the module @var{module}.
@end deffn
- gethost
-@c snarfed from net_db.c:146
-@deffn primitive gethost [host]
-@deffnx procedure gethostbyname hostname
-@deffnx procedure gethostbyaddr address
-Look up a host by name or address, returning a host object. The
-@code{gethost} procedure will accept either a string name or an integer
-address; if given no arguments, it behaves like @code{gethostent} (see
-below). If a name or address is supplied but the address can not be
-found, an error will be thrown to one of the keys:
-@code{host-not-found}, @code{try-again}, @code{no-recovery} or
-@code{no-data}, corresponding to the equivalent @code{h_error} values.
-Unusual conditions may result in errors thrown to the
-@code{system-error} or @code{misc_error} keys.
-@end deffn
-
- getnet
-@c snarfed from net_db.c:227
-@deffn primitive getnet [net]
-@deffnx procedure getnetbyname net-name
-@deffnx procedure getnetbyaddr net-number
-Look up a network by name or net number in the network database. The
-@var{net-name} argument must be a string, and the @var{net-number}
-argument must be an integer. @code{getnet} will accept either type of
-argument, behaving like @code{getnetent} (see below) if no arguments are
-given.
+ standard-interface-eval-closure
+@c snarfed from modules.c:341
+@deffn primitive standard-interface-eval-closure module
+Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added.
@end deffn
- getproto
-@c snarfed from net_db.c:277
-@deffn primitive getproto [protocol]
-@deffnx procedure getprotobyname name
-@deffnx procedure getprotobynumber number
-Look up a network protocol by name or by number. @code{getprotobyname}
-takes a string argument, and @code{getprotobynumber} takes an integer
-argument. @code{getproto} will accept either type, behaving like
-@code{getprotoent} (see below) if no arguments are supplied.
-@end deffn
-
- getserv
-@c snarfed from net_db.c:344
-@deffn primitive getserv [name [protocol]]
-@deffnx procedure getservbyname name protocol
-@deffnx procedure getservbyport port protocol
-Look up a network service by name or by service number, and return a
-network service object. The @var{protocol} argument specifies the name
-of the desired protocol; if the protocol found in the network service
-database does not match this name, a system error is signalled.
-
-The @code{getserv} procedure will take either a service name or number
-as its first argument; if given no arguments, it behaves like
-@code{getservent} (see below).
-@end deffn
-
- sethost
-@c snarfed from net_db.c:383
-@deffn primitive sethost [stayopen]
-If @var{stayopen} is omitted, this is equivalent to @code{endhostent}.
-Otherwise it is equivalent to @code{sethostent stayopen}.
-@end deffn
-
- setnet
-@c snarfed from net_db.c:399
-@deffn primitive setnet [stayopen]
-If @var{stayopen} is omitted, this is equivalent to @code{endnetent}.
-Otherwise it is equivalent to @code{setnetent stayopen}.
-@end deffn
-
- setproto
-@c snarfed from net_db.c:415
-@deffn primitive setproto [stayopen]
-If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}.
-Otherwise it is equivalent to @code{setprotoent stayopen}.
-@end deffn
-
- setserv
-@c snarfed from net_db.c:431
-@deffn primitive setserv [stayopen]
-If @var{stayopen} is omitted, this is equivalent to @code{endservent}.
-Otherwise it is equivalent to @code{setservent stayopen}.
+ %get-pre-modules-obarray
+@c snarfed from modules.c:564
+@deffn primitive %get-pre-modules-obarray
+Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system.
@end deffn
exact?
-@c snarfed from numbers.c:107
+@c snarfed from numbers.c:97
@deffn primitive exact? x
Return @code{#t} if @var{x} is an exact number, @code{#f}
otherwise.
@end deffn
odd?
-@c snarfed from numbers.c:124
+@c snarfed from numbers.c:114
@deffn primitive odd? n
Return @code{#t} if @var{n} is an odd number, @code{#f}
otherwise.
@end deffn
even?
-@c snarfed from numbers.c:141
+@c snarfed from numbers.c:131
@deffn primitive even? n
Return @code{#t} if @var{n} is an even number, @code{#f}
otherwise.
@end deffn
logand
-@c snarfed from numbers.c:756
+@c snarfed from numbers.c:744
@deffn primitive logand n1 n2
-Return the integer which is the bit-wise AND of the two integer
-arguments.
+Return the bitwise AND of the integer arguments.
@lisp
-(number->string (logand #b1100 #b1010) 2)
- @result{} "1000"
+(logand) @result{} -1
+(logand 7) @result{} 7
+(logand #b111 #b011 #b001) @result{} 1
@end lisp
@end deffn
logior
-@c snarfed from numbers.c:843
+@c snarfed from numbers.c:830
@deffn primitive logior n1 n2
-Return the integer which is the bit-wise OR of the two integer
-arguments.
+Return the bitwise OR of the integer arguments.
@lisp
-(number->string (logior #b1100 #b1010) 2)
- @result{} "1110"
+(logior) @result{} 0
+(logior 7) @result{} 7
+(logior #b000 #b001 #b011) @result{} 3
@end lisp
@end deffn
logxor
-@c snarfed from numbers.c:929
+@c snarfed from numbers.c:917
@deffn primitive logxor n1 n2
-Return the integer which is the bit-wise XOR of the two integer
-arguments.
-
+Return the bitwise XOR of the integer arguments. A bit is
+set in the result if it is set in an odd number of arguments.
@lisp
-(number->string (logxor #b1100 #b1010) 2)
- @result{} "110"
+(logxor) @result{} 0
+(logxor 7) @result{} 7
+(logxor #b000 #b001 #b011) @result{} 2
+(logxor #b000 #b001 #b011 #b011) @result{} 1
@end lisp
@end deffn
logtest
-@c snarfed from numbers.c:998
+@c snarfed from numbers.c:986
@deffn primitive logtest j k
@lisp
(logtest j k) @equiv{} (not (zero? (logand j k)))
@@ -3030,7 +2560,7 @@ arguments.
@end deffn
logbit?
-@c snarfed from numbers.c:1055
+@c snarfed from numbers.c:1043
@deffn primitive logbit? index j
@lisp
(logbit? index j) @equiv{} (logtest (integer-expt 2 index) j)
@@ -3044,7 +2574,7 @@ arguments.
@end deffn
lognot
-@c snarfed from numbers.c:1104
+@c snarfed from numbers.c:1092
@deffn primitive lognot n
Return the integer which is the 2s-complement of the integer
argument.
@@ -3058,7 +2588,7 @@ argument.
@end deffn
integer-expt
-@c snarfed from numbers.c:1121
+@c snarfed from numbers.c:1109
@deffn primitive integer-expt n k
Return @var{n} raised to the non-negative integer exponent
@var{k}.
@@ -3072,7 +2602,7 @@ Return @var{n} raised to the non-negative integer exponent
@end deffn
ash
-@c snarfed from numbers.c:1168
+@c snarfed from numbers.c:1164
@deffn primitive ash n cnt
The function ash performs an arithmetic shift left by @var{cnt}
bits (or shift right, if @var{cnt} is negative). 'Arithmetic'
@@ -3092,7 +2622,7 @@ Formally, the function returns an integer equivalent to
@end deffn
bit-extract
-@c snarfed from numbers.c:1221
+@c snarfed from numbers.c:1217
@deffn primitive bit-extract n start end
Return the integer composed of the @var{start} (inclusive)
through @var{end} (exclusive) bits of @var{n}. The
@@ -3107,7 +2637,7 @@ through @var{end} (exclusive) bits of @var{n}. The
@end deffn
logcount
-@c snarfed from numbers.c:1293
+@c snarfed from numbers.c:1289
@deffn primitive logcount n
Return the number of bits in integer @var{n}. If integer is
positive, the 1-bits in its binary representation are counted.
@@ -3125,7 +2655,7 @@ representation are counted. If 0, 0 is returned.
@end deffn
integer-length
-@c snarfed from numbers.c:1344
+@c snarfed from numbers.c:1340
@deffn primitive integer-length n
Return the number of bits neccessary to represent @var{n}.
@@ -3140,7 +2670,7 @@ Return the number of bits neccessary to represent @var{n}.
@end deffn
number->string
-@c snarfed from numbers.c:2290
+@c snarfed from numbers.c:2175
@deffn primitive number->string n [radix]
Return a string holding the external representation of the
number @var{n} in the given @var{radix}. If @var{n} is
@@ -3148,7 +2678,7 @@ inexact, a radix of 10 will be used.
@end deffn
string->number
-@c snarfed from numbers.c:2875
+@c snarfed from numbers.c:2810
@deffn primitive string->number string [radix]
Return a number of the maximally precise representation
expressed by the given @var{string}. @var{radix} must be an
@@ -3161,13 +2691,13 @@ syntactically valid notation for a number, then
@end deffn
number?
-@c snarfed from numbers.c:2942
+@c snarfed from numbers.c:2879
@deffn primitive number?
-scm_number_p
+implemented by the C function "scm_number_p"
@end deffn
complex?
-@c snarfed from numbers.c:2954
+@c snarfed from numbers.c:2891
@deffn primitive complex? x
Return @code{#t} if @var{x} is a complex number, @code{#f}
else. Note that the sets of real, rational and integer
@@ -3177,13 +2707,13 @@ rational or integer number.
@end deffn
real?
-@c snarfed from numbers.c:2962
+@c snarfed from numbers.c:2899
@deffn primitive real?
-scm_real_p
+implemented by the C function "scm_real_p"
@end deffn
rational?
-@c snarfed from numbers.c:2975
+@c snarfed from numbers.c:2912
@deffn primitive rational? x
Return @code{#t} if @var{x} is a rational number, @code{#f}
else. Note that the set of integer values forms a subset of
@@ -3194,28 +2724,28 @@ precision.
@end deffn
integer?
-@c snarfed from numbers.c:2996
+@c snarfed from numbers.c:2933
@deffn primitive integer? x
Return @code{#t} if @var{x} is an integer number, @code{#f}
else.
@end deffn
inexact?
-@c snarfed from numbers.c:3021
+@c snarfed from numbers.c:2958
@deffn primitive inexact? x
Return @code{#t} if @var{x} is an inexact number, @code{#f}
else.
@end deffn
$expt
-@c snarfed from numbers.c:4073
+@c snarfed from numbers.c:4003
@deffn primitive $expt x y
Return @var{x} raised to the power of @var{y}. This
procedure does not accept complex arguments.
@end deffn
$atan2
-@c snarfed from numbers.c:4089
+@c snarfed from numbers.c:4019
@deffn primitive $atan2 x y
Return the arc tangent of the two arguments @var{x} and
@var{y}. This is similar to calculating the arc tangent of
@@ -3225,86 +2755,92 @@ procedure does not accept complex arguments.
@end deffn
make-rectangular
-@c snarfed from numbers.c:4102
+@c snarfed from numbers.c:4032
@deffn primitive make-rectangular real imaginary
Return a complex number constructed of the given @var{real} and
@var{imaginary} parts.
@end deffn
make-polar
-@c snarfed from numbers.c:4115
+@c snarfed from numbers.c:4045
@deffn primitive make-polar x y
Return the complex number @var{x} * e^(i * @var{y}).
@end deffn
inexact->exact
-@c snarfed from numbers.c:4233
+@c snarfed from numbers.c:4180
@deffn primitive inexact->exact z
Return an exact number that is numerically closest to @var{z}.
@end deffn
class-of
-@c snarfed from objects.c:88
+@c snarfed from objects.c:86
@deffn primitive class-of x
Return the class of @var{x}.
@end deffn
entity?
-@c snarfed from objects.c:359
+@c snarfed from objects.c:360
@deffn primitive entity? obj
Return @code{#t} if @var{obj} is an entity.
@end deffn
operator?
-@c snarfed from objects.c:368
+@c snarfed from objects.c:369
@deffn primitive operator? obj
Return @code{#t} if @var{obj} is an operator.
@end deffn
+ valid-object-procedure?
+@c snarfed from objects.c:385
+@deffn primitive valid-object-procedure? proc
+Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}.
+@end deffn
+
set-object-procedure!
-@c snarfed from objects.c:380
+@c snarfed from objects.c:407
@deffn primitive set-object-procedure! obj proc
-Return the object procedure of @var{obj} to @var{proc}.
+Set the object procedure of @var{obj} to @var{proc}.
@var{obj} must be either an entity or an operator.
@end deffn
make-class-object
-@c snarfed from objects.c:440
+@c snarfed from objects.c:467
@deffn primitive make-class-object metaclass layout
Create a new class object of class @var{metaclass}, with the
slot layout specified by @var{layout}.
@end deffn
make-subclass-object
-@c snarfed from objects.c:455
+@c snarfed from objects.c:482
@deffn primitive make-subclass-object class layout
Create a subclass object of @var{class}, with the slot layout
specified by @var{layout}.
@end deffn
object-properties
-@c snarfed from objprop.c:62
+@c snarfed from objprop.c:60
@deffn primitive object-properties obj
@deffnx primitive procedure-properties obj
Return @var{obj}'s property list.
@end deffn
set-object-properties!
-@c snarfed from objprop.c:73
+@c snarfed from objprop.c:71
@deffn primitive set-object-properties! obj alist
@deffnx primitive set-procedure-properties! obj alist
Set @var{obj}'s property list to @var{alist}.
@end deffn
object-property
-@c snarfed from objprop.c:85
+@c snarfed from objprop.c:83
@deffn primitive object-property obj key
@deffnx primitive procedure-property obj key
Return the property of @var{obj} with name @var{key}.
@end deffn
set-object-property!
-@c snarfed from objprop.c:98
+@c snarfed from objprop.c:96
@deffn primitive set-object-property! obj key value
@deffnx primitive set-procedure-property! obj key value
In @var{obj}'s property list, set the property named @var{key}
@@ -3312,7 +2848,7 @@ to @var{value}.
@end deffn
cons
-@c snarfed from pairs.c:61
+@c snarfed from pairs.c:80
@deffn primitive cons x y
Return a newly allocated pair whose car is @var{x} and whose
cdr is @var{y}. The pair is guaranteed to be different (in the
@@ -3320,28 +2856,28 @@ sense of @code{eq?}) from every previously existing object.
@end deffn
pair?
-@c snarfed from pairs.c:94
+@c snarfed from pairs.c:113
@deffn primitive pair? x
Return @code{#t} if @var{x} is a pair; otherwise return
@code{#f}.
@end deffn
set-car!
-@c snarfed from pairs.c:105
+@c snarfed from pairs.c:124
@deffn primitive set-car! pair value
Stores @var{value} in the car field of @var{pair}. The value returned
by @code{set-car!} is unspecified.
@end deffn
set-cdr!
-@c snarfed from pairs.c:118
+@c snarfed from pairs.c:137
@deffn primitive set-cdr! pair value
Stores @var{value} in the cdr field of @var{pair}. The value returned
by @code{set-cdr!} is unspecified.
@end deffn
char-ready?
-@c snarfed from ports.c:246
+@c snarfed from ports.c:253
@deffn primitive char-ready? [port]
Return @code{#t} if a character is ready on input @var{port}
and return @code{#f} otherwise. If @code{char-ready?} returns
@@ -3359,14 +2895,26 @@ interactive port that has no ready characters.}
@end deffn
drain-input
-@c snarfed from ports.c:312
+@c snarfed from ports.c:330
@deffn primitive drain-input port
-Drain @var{port}'s read buffers (including any pushed-back
-characters) and return the content as a single string.
+This procedure clears a port's input buffers, similar
+to the way that force-output clears the output buffer. The
+contents of the buffers are returned as a single string, e.g.,
+
+@lisp
+(define p (open-input-file ...))
+(drain-input p) => empty string, nothing buffered yet.
+(unread-char (read-char p) p)
+(drain-input p) => initial chars from p, up to the buffer size.
+@end lisp
+
+Draining the buffers may be useful for cleanly finishing
+buffered I/O so that the file descriptor can be used directly
+for further input.
@end deffn
current-input-port
-@c snarfed from ports.c:339
+@c snarfed from ports.c:357
@deffn primitive current-input-port
Return the current input port. This is the default port used
by many input procedures. Initially, @code{current-input-port}
@@ -3374,7 +2922,7 @@ returns the @dfn{standard input} in Unix and C terminology.
@end deffn
current-output-port
-@c snarfed from ports.c:351
+@c snarfed from ports.c:369
@deffn primitive current-output-port
Return the current output port. This is the default port used
by many output procedures. Initially,
@@ -3383,21 +2931,21 @@ Unix and C terminology.
@end deffn
current-error-port
-@c snarfed from ports.c:361
+@c snarfed from ports.c:379
@deffn primitive current-error-port
Return the port to which errors and warnings should be sent (the
@dfn{standard error} in Unix and C terminology).
@end deffn
current-load-port
-@c snarfed from ports.c:371
+@c snarfed from ports.c:389
@deffn primitive current-load-port
Return the current-load-port.
The load port is used internally by @code{primitive-load}.
@end deffn
set-current-input-port
-@c snarfed from ports.c:384
+@c snarfed from ports.c:402
@deffn primitive set-current-input-port port
@deffnx primitive set-current-output-port port
@deffnx primitive set-current-error-port port
@@ -3407,32 +2955,32 @@ so that they use the supplied @var{port} for input or output.
@end deffn
set-current-output-port
-@c snarfed from ports.c:397
+@c snarfed from ports.c:415
@deffn primitive set-current-output-port port
Set the current default output port to @var{port}.
@end deffn
set-current-error-port
-@c snarfed from ports.c:411
+@c snarfed from ports.c:429
@deffn primitive set-current-error-port port
Set the current default error port to @var{port}.
@end deffn
port-revealed
-@c snarfed from ports.c:556
+@c snarfed from ports.c:574
@deffn primitive port-revealed port
Return the revealed count for @var{port}.
@end deffn
set-port-revealed!
-@c snarfed from ports.c:569
+@c snarfed from ports.c:587
@deffn primitive set-port-revealed! port rcount
Sets the revealed count for a port to a given value.
The return value is unspecified.
@end deffn
port-mode
-@c snarfed from ports.c:612
+@c snarfed from ports.c:630
@deffn primitive port-mode port
Return the port modes associated with the open port @var{port}.
These will not necessarily be identical to the modes used when
@@ -3441,7 +2989,7 @@ used only during port creation are not retained.
@end deffn
close-port
-@c snarfed from ports.c:649
+@c snarfed from ports.c:667
@deffn primitive close-port port
Close the specified port object. Return @code{#t} if it
successfully closes a port or @code{#f} if it was already
@@ -3452,7 +3000,7 @@ descriptors.
@end deffn
close-input-port
-@c snarfed from ports.c:677
+@c snarfed from ports.c:695
@deffn primitive close-input-port port
Close the specified input port object. The routine has no effect if
the file has already been closed. An exception may be raised if an
@@ -3463,7 +3011,7 @@ which can close file descriptors.
@end deffn
close-output-port
-@c snarfed from ports.c:692
+@c snarfed from ports.c:710
@deffn primitive close-output-port port
Close the specified output port object. The routine has no effect if
the file has already been closed. An exception may be raised if an
@@ -3474,7 +3022,7 @@ which can close file descriptors.
@end deffn
port-for-each
-@c snarfed from ports.c:709
+@c snarfed from ports.c:727
@deffn primitive port-for-each proc
Apply @var{proc} to each port in the Guile port table
in turn. The return value is unspecified. More specifically,
@@ -3484,19 +3032,8 @@ Changes to the port table while @var{port-for-each} is running
have no effect as far as @var{port-for-each} is concerned.
@end deffn
- close-all-ports-except
-@c snarfed from ports.c:752
-@deffn primitive close-all-ports-except . ports
-[DEPRECATED] Close all open file ports used by the interpreter
-except for those supplied as arguments. This procedure
-was intended to be used before an exec call to close file descriptors
-which are not needed in the new process. However it has the
-undesirable side-effect of flushing buffes, so it's deprecated.
-Use port-for-each instead.
-@end deffn
-
input-port?
-@c snarfed from ports.c:791
+@c snarfed from ports.c:768
@deffn primitive input-port? x
Return @code{#t} if @var{x} is an input port, otherwise return
@code{#f}. Any object satisfying this predicate also satisfies
@@ -3504,7 +3041,7 @@ Return @code{#t} if @var{x} is an input port, otherwise return
@end deffn
output-port?
-@c snarfed from ports.c:804
+@c snarfed from ports.c:779
@deffn primitive output-port? x
Return @code{#t} if @var{x} is an output port, otherwise return
@code{#f}. Any object satisfying this predicate also satisfies
@@ -3512,7 +3049,7 @@ Return @code{#t} if @var{x} is an output port, otherwise return
@end deffn
port?
-@c snarfed from ports.c:819
+@c snarfed from ports.c:791
@deffn primitive port? x
Return a boolean indicating whether @var{x} is a port.
Equivalent to @code{(or (input-port? @var{x}) (output-port?
@@ -3520,21 +3057,21 @@ Equivalent to @code{(or (input-port? @var{x}) (output-port?
@end deffn
port-closed?
-@c snarfed from ports.c:829
+@c snarfed from ports.c:801
@deffn primitive port-closed? port
Return @code{#t} if @var{port} is closed or @code{#f} if it is
open.
@end deffn
eof-object?
-@c snarfed from ports.c:840
+@c snarfed from ports.c:812
@deffn primitive eof-object? x
Return @code{#t} if @var{x} is an end-of-file object; otherwise
return @code{#f}.
@end deffn
force-output
-@c snarfed from ports.c:854
+@c snarfed from ports.c:826
@deffn primitive force-output [port]
Flush the specified output port, or the current output port if @var{port}
is omitted. The current output buffer contents are passed to the
@@ -3546,14 +3083,14 @@ The return value is unspecified.
@end deffn
flush-all-ports
-@c snarfed from ports.c:872
+@c snarfed from ports.c:844
@deffn primitive flush-all-ports
Equivalent to calling @code{force-output} on
all open output ports. The return value is unspecified.
@end deffn
read-char
-@c snarfed from ports.c:890
+@c snarfed from ports.c:862
@deffn primitive read-char [port]
Return the next character available from @var{port}, updating
@var{port} to point to the following character. If no more
@@ -3561,7 +3098,7 @@ characters are available, the end-of-file object is returned.
@end deffn
peek-char
-@c snarfed from ports.c:1207
+@c snarfed from ports.c:1188
@deffn primitive peek-char [port]
Return the next character available from @var{port},
@emph{without} updating @var{port} to point to the following
@@ -3578,7 +3115,7 @@ to @code{read-char} would have hung.}
@end deffn
unread-char
-@c snarfed from ports.c:1228
+@c snarfed from ports.c:1209
@deffn primitive unread-char cobj [port]
Place @var{char} in @var{port} so that it will be read by the
next read operation. If called multiple times, the unread characters
@@ -3587,7 +3124,7 @@ not supplied, the current input port is used.
@end deffn
unread-string
-@c snarfed from ports.c:1251
+@c snarfed from ports.c:1232
@deffn primitive unread-string str port
Place the string @var{str} in @var{port} so that its characters will be
read in subsequent read operations. If called multiple times, the
@@ -3596,7 +3133,7 @@ unread characters will be read again in last-in first-out order. If
@end deffn
seek
-@c snarfed from ports.c:1290
+@c snarfed from ports.c:1271
@deffn primitive seek fd_port offset whence
Sets the current position of @var{fd/port} to the integer
@var{offset}, which is interpreted according to the value of
@@ -3624,7 +3161,7 @@ that the current position of a port can be obtained using:
@end deffn
truncate-file
-@c snarfed from ports.c:1331
+@c snarfed from ports.c:1326
@deffn primitive truncate-file object [length]
Truncates the object referred to by @var{object} to at most
@var{length} bytes. @var{object} can be a string containing a
@@ -3635,19 +3172,19 @@ position. The return value is unspecified.
@end deffn
port-line
-@c snarfed from ports.c:1385
+@c snarfed from ports.c:1379
@deffn primitive port-line port
Return the current line number for @var{port}.
@end deffn
set-port-line!
-@c snarfed from ports.c:1396
+@c snarfed from ports.c:1390
@deffn primitive set-port-line! port line
Set the current line number for @var{port} to @var{line}.
@end deffn
port-column
-@c snarfed from ports.c:1417
+@c snarfed from ports.c:1411
@deffn primitive port-column port
@deffnx primitive port-line port
Return the current column number or line number of @var{port},
@@ -3661,7 +3198,7 @@ what non-programmers will find most natural.)
@end deffn
set-port-column!
-@c snarfed from ports.c:1430
+@c snarfed from ports.c:1424
@deffn primitive set-port-column! port column
@deffnx primitive set-port-line! port line
Set the current column or line number of @var{port}, using the
@@ -3669,7 +3206,7 @@ current input port if none is specified.
@end deffn
port-filename
-@c snarfed from ports.c:1445
+@c snarfed from ports.c:1439
@deffn primitive port-filename port
Return the filename associated with @var{port}. This function returns
the strings "standard input", "standard output" and "standard error"
@@ -3677,7 +3214,7 @@ when called on the current input, output and error ports respectively.
@end deffn
set-port-filename!
-@c snarfed from ports.c:1459
+@c snarfed from ports.c:1453
@deffn primitive set-port-filename! port filename
Change the filename associated with @var{port}, using the current input
port if none is specified. Note that this does not change the port's
@@ -3686,7 +3223,7 @@ source of data, but only the value that is returned by
@end deffn
%make-void-port
-@c snarfed from ports.c:1551
+@c snarfed from ports.c:1547
@deffn primitive %make-void-port mode
Create and return a new void port. A void port acts like
/dev/null. The @var{mode} argument
@@ -3694,620 +3231,8 @@ specifies the input/output modes for this port: see the
documentation for @code{open-file} in @ref{File Ports}.
@end deffn
- pipe
-@c snarfed from posix.c:201
-@deffn primitive pipe
-Return a newly created pipe: a pair of ports which are linked
-together on the local machine. The @emph{car} is the input
-port and the @emph{cdr} is the output port. Data written (and
-flushed) to the output port can be read from the input port.
-Pipes are commonly used for communication with a newly forked
-child process. The need to flush the output port can be
-avoided by making it unbuffered using @code{setvbuf}.
-
-Writes occur atomically provided the size of the data in bytes
-is not greater than the value of @code{PIPE_BUF}. Note that
-the output port is likely to block if too much data (typically
-equal to @code{PIPE_BUF}) has been written but not yet read
-from the input port.
-@end deffn
-
- getgroups
-@c snarfed from posix.c:222
-@deffn primitive getgroups
-Return a vector of integers representing the current
-supplimentary group IDs.
-@end deffn
-
- getpw
-@c snarfed from posix.c:255
-@deffn primitive getpw [user]
-Look up an entry in the user database. @var{obj} can be an integer,
-a string, or omitted, giving the behaviour of getpwuid, getpwnam
-or getpwent respectively.
-@end deffn
-
- setpw
-@c snarfed from posix.c:308
-@deffn primitive setpw [arg]
-If called with a true argument, initialize or reset the password data
-stream. Otherwise, close the stream. The @code{setpwent} and
-@code{endpwent} procedures are implemented on top of this.
-@end deffn
-
- getgr
-@c snarfed from posix.c:327
-@deffn primitive getgr [name]
-Look up an entry in the group database. @var{obj} can be an integer,
-a string, or omitted, giving the behaviour of getgrgid, getgrnam
-or getgrent respectively.
-@end deffn
-
- setgr
-@c snarfed from posix.c:368
-@deffn primitive setgr [arg]
-If called with a true argument, initialize or reset the group data
-stream. Otherwise, close the stream. The @code{setgrent} and
-@code{endgrent} procedures are implemented on top of this.
-@end deffn
-
- kill
-@c snarfed from posix.c:404
-@deffn primitive kill pid sig
-Sends a signal to the specified process or group of processes.
-
-@var{pid} specifies the processes to which the signal is sent:
-
-@table @r
-@item @var{pid} greater than 0
-The process whose identifier is @var{pid}.
-@item @var{pid} equal to 0
-All processes in the current process group.
-@item @var{pid} less than -1
-The process group whose identifier is -@var{pid}
-@item @var{pid} equal to -1
-If the process is privileged, all processes except for some special
-system processes. Otherwise, all processes with the current effective
-user ID.
-@end table
-
-@var{sig} should be specified using a variable corresponding to
-the Unix symbolic name, e.g.,
-
-@defvar SIGHUP
-Hang-up signal.
-@end defvar
-
-@defvar SIGINT
-Interrupt signal.
-@end defvar
-@end deffn
-
- waitpid
-@c snarfed from posix.c:452
-@deffn primitive waitpid pid [options]
-This procedure collects status information from a child process which
-has terminated or (optionally) stopped. Normally it will
-suspend the calling process until this can be done. If more than one
-child process is eligible then one will be chosen by the operating system.
-
-The value of @var{pid} determines the behaviour:
-
-@table @r
-@item @var{pid} greater than 0
-Request status information from the specified child process.
-@item @var{pid} equal to -1 or WAIT_ANY
-Request status information for any child process.
-@item @var{pid} equal to 0 or WAIT_MYPGRP
-Request status information for any child process in the current process
-group.
-@item @var{pid} less than -1
-Request status information for any child process whose process group ID
-is -@var{PID}.
-@end table
-
-The @var{options} argument, if supplied, should be the bitwise OR of the
-values of zero or more of the following variables:
-
-@defvar WNOHANG
-Return immediately even if there are no child processes to be collected.
-@end defvar
-
-@defvar WUNTRACED
-Report status information for stopped processes as well as terminated
-processes.
-@end defvar
-
-The return value is a pair containing:
-
-@enumerate
-@item
-The process ID of the child process, or 0 if @code{WNOHANG} was
-specified and no process was collected.
-@item
-The integer status value.
-@end enumerate
-@end deffn
-
- status:exit-val
-@c snarfed from posix.c:479
-@deffn primitive status:exit-val status
-Return the exit status value, as would be set if a process
-ended normally through a call to @code{exit} or @code{_exit},
-if any, otherwise @code{#f}.
-@end deffn
-
- status:term-sig
-@c snarfed from posix.c:499
-@deffn primitive status:term-sig status
-Return the signal number which terminated the process, if any,
-otherwise @code{#f}.
-@end deffn
-
- status:stop-sig
-@c snarfed from posix.c:517
-@deffn primitive status:stop-sig status
-Return the signal number which stopped the process, if any,
-otherwise @code{#f}.
-@end deffn
-
- getppid
-@c snarfed from posix.c:535
-@deffn primitive getppid
-Return an integer representing the process ID of the parent
-process.
-@end deffn
-
- getuid
-@c snarfed from posix.c:546
-@deffn primitive getuid
-Return an integer representing the current real user ID.
-@end deffn
-
- getgid
-@c snarfed from posix.c:557
-@deffn primitive getgid
-Return an integer representing the current real group ID.
-@end deffn
-
- geteuid
-@c snarfed from posix.c:571
-@deffn primitive geteuid
-Return an integer representing the current effective user ID.
-If the system does not support effective IDs, then the real ID
-is returned. @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-@end deffn
-
- getegid
-@c snarfed from posix.c:589
-@deffn primitive getegid
-Return an integer representing the current effective group ID.
-If the system does not support effective IDs, then the real ID
-is returned. @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-@end deffn
-
- setuid
-@c snarfed from posix.c:605
-@deffn primitive setuid id
-Sets both the real and effective user IDs to the integer @var{id}, provided
-the process has appropriate privileges.
-The return value is unspecified.
-@end deffn
-
- setgid
-@c snarfed from posix.c:619
-@deffn primitive setgid id
-Sets both the real and effective group IDs to the integer @var{id}, provided
-the process has appropriate privileges.
-The return value is unspecified.
-@end deffn
-
- seteuid
-@c snarfed from posix.c:635
-@deffn primitive seteuid id
-Sets the effective user ID to the integer @var{id}, provided the process
-has appropriate privileges. If effective IDs are not supported, the
-real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-The return value is unspecified.
-@end deffn
-
- setegid
-@c snarfed from posix.c:659
-@deffn primitive setegid id
-Sets the effective group ID to the integer @var{id}, provided the process
-has appropriate privileges. If effective IDs are not supported, the
-real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-The return value is unspecified.
-@end deffn
-
- getpgrp
-@c snarfed from posix.c:681
-@deffn primitive getpgrp
-Return an integer representing the current process group ID.
-This is the POSIX definition, not BSD.
-@end deffn
-
- setpgid
-@c snarfed from posix.c:697
-@deffn primitive setpgid pid pgid
-Move the process @var{pid} into the process group @var{pgid}. @var{pid} or
-@var{pgid} must be integers: they can be zero to indicate the ID of the
-current process.
-Fails on systems that do not support job control.
-The return value is unspecified.
-@end deffn
-
- setsid
-@c snarfed from posix.c:716
-@deffn primitive setsid
-Creates a new session. The current process becomes the session leader
-and is put in a new process group. The process will be detached
-from its controlling terminal if it has one.
-The return value is an integer representing the new process group ID.
-@end deffn
-
- ttyname
-@c snarfed from posix.c:730
-@deffn primitive ttyname port
-Return a string with the name of the serial terminal device
-underlying @var{port}.
-@end deffn
-
- ctermid
-@c snarfed from posix.c:753
-@deffn primitive ctermid
-Return a string containing the file name of the controlling
-terminal for the current process.
-@end deffn
-
- tcgetpgrp
-@c snarfed from posix.c:776
-@deffn primitive tcgetpgrp port
-Return the process group ID of the foreground process group
-associated with the terminal open on the file descriptor
-underlying @var{port}.
-
-If there is no foreground process group, the return value is a
-number greater than 1 that does not match the process group ID
-of any existing process group. This can happen if all of the
-processes in the job that was formerly the foreground job have
-terminated, and no other job has yet been moved into the
-foreground.
-@end deffn
-
- tcsetpgrp
-@c snarfed from posix.c:800
-@deffn primitive tcsetpgrp port pgid
-Set the foreground process group ID for the terminal used by the file
-descriptor underlying @var{port} to the integer @var{pgid}.
-The calling process
-must be a member of the same session as @var{pgid} and must have the same
-controlling terminal. The return value is unspecified.
-@end deffn
-
- execl
-@c snarfed from posix.c:860
-@deffn primitive execl filename . args
-Executes the file named by @var{path} as a new process image.
-The remaining arguments are supplied to the process; from a C program
-they are accessable as the @code{argv} argument to @code{main}.
-Conventionally the first @var{arg} is the same as @var{path}.
-All arguments must be strings.
-
-If @var{arg} is missing, @var{path} is executed with a null
-argument list, which may have system-dependent side-effects.
-
-This procedure is currently implemented using the @code{execv} system
-call, but we call it @code{execl} because of its Scheme calling interface.
-@end deffn
-
- execlp
-@c snarfed from posix.c:881
-@deffn primitive execlp filename . args
-Similar to @code{execl}, however if
-@var{filename} does not contain a slash
-then the file to execute will be located by searching the
-directories listed in the @code{PATH} environment variable.
-
-This procedure is currently implemented using the @code{execvp} system
-call, but we call it @code{execlp} because of its Scheme calling interface.
-@end deffn
-
- execle
-@c snarfed from posix.c:932
-@deffn primitive execle filename env . args
-Similar to @code{execl}, but the environment of the new process is
-specified by @var{env}, which must be a list of strings as returned by the
-@code{environ} procedure.
-
-This procedure is currently implemented using the @code{execve} system
-call, but we call it @code{execle} because of its Scheme calling interface.
-@end deffn
-
- primitive-fork
-@c snarfed from posix.c:956
-@deffn primitive primitive-fork
-Creates a new "child" process by duplicating the current "parent" process.
-In the child the return value is 0. In the parent the return value is
-the integer process ID of the child.
-
-This procedure has been renamed from @code{fork} to avoid a naming conflict
-with the scsh fork.
-@end deffn
-
- uname
-@c snarfed from posix.c:971
-@deffn primitive uname
-Return an object with some information about the computer
-system the program is running on.
-@end deffn
-
- environ
-@c snarfed from posix.c:1001
-@deffn primitive environ [env]
-If @var{env} is omitted, return the current environment (in the
-Unix sense) as a list of strings. Otherwise set the current
-environment, which is also the default environment for child
-processes, to the supplied list of strings. Each member of
-@var{env} should be of the form @code{NAME=VALUE} and values of
-@code{NAME} should not be duplicated. If @var{env} is supplied
-then the return value is unspecified.
-@end deffn
-
- tmpnam
-@c snarfed from posix.c:1039
-@deffn primitive tmpnam
-Return a name in the file system that does not match any
-existing file. However there is no guarantee that another
-process will not create the file after @code{tmpnam} is called.
-Care should be taken if opening the file, e.g., use the
-@code{O_EXCL} open flag or use @code{mkstemp!} instead.
-@end deffn
-
- mkstemp!
-@c snarfed from posix.c:1061
-@deffn primitive mkstemp! tmpl
-Create a new unique file in the file system and returns a new
-buffered port open for reading and writing to the file.
-@var{tmpl} is a string specifying where the file should be
-created: it must end with @code{XXXXXX} and will be changed in
-place to return the name of the temporary file.
-@end deffn
-
- utime
-@c snarfed from posix.c:1087
-@deffn primitive utime pathname [actime [modtime]]
-@code{utime} sets the access and modification times for the
-file named by @var{path}. If @var{actime} or @var{modtime} is
-not supplied, then the current time is used. @var{actime} and
-@var{modtime} must be integer time values as returned by the
-@code{current-time} procedure.
-@lisp
-(utime "foo" (- (current-time) 3600))
-@end lisp
-will set the access time to one hour in the past and the
-modification time to the current time.
-@end deffn
-
- access?
-@c snarfed from posix.c:1136
-@deffn primitive access? path how
-Return @code{#t} if @var{path} corresponds to an existing file
-and the current process has the type of access specified by
-@var{how}, otherwise @code{#f}. @var{how} should be specified
-using the values of the variables listed below. Multiple
-values can be combined using a bitwise or, in which case
-@code{#t} will only be returned if all accesses are granted.
-
-Permissions are checked using the real id of the current
-process, not the effective id, although it's the effective id
-which determines whether the access would actually be granted.
-
-@defvar R_OK
-test for read permission.
-@end defvar
-@defvar W_OK
-test for write permission.
-@end defvar
-@defvar X_OK
-test for execute permission.
-@end defvar
-@defvar F_OK
-test for existence of the file.
-@end defvar
-@end deffn
-
- getpid
-@c snarfed from posix.c:1151
-@deffn primitive getpid
-Return an integer representing the current process ID.
-@end deffn
-
- putenv
-@c snarfed from posix.c:1168
-@deffn primitive putenv str
-Modifies the environment of the current process, which is
-also the default environment inherited by child processes.
-
-If @var{string} is of the form @code{NAME=VALUE} then it will be written
-directly into the environment, replacing any existing environment string
-with
-name matching @code{NAME}. If @var{string} does not contain an equal
-sign, then any existing string with name matching @var{string} will
-be removed.
-
-The return value is unspecified.
-@end deffn
-
- setlocale
-@c snarfed from posix.c:1199
-@deffn primitive setlocale category [locale]
-If @var{locale} is omitted, return the current value of the
-specified locale category as a system-dependent string.
-@var{category} should be specified using the values
-@code{LC_COLLATE}, @code{LC_ALL} etc.
-
-Otherwise the specified locale category is set to the string
-@var{locale} and the new value is returned as a
-system-dependent string. If @var{locale} is an empty string,
-the locale will be set using envirionment variables.
-@end deffn
-
- mknod
-@c snarfed from posix.c:1240
-@deffn primitive mknod path type perms dev
-Creates a new special file, such as a file corresponding to a device.
-@var{path} specifies the name of the file. @var{type} should
-be one of the following symbols:
-regular, directory, symlink, block-special, char-special,
-fifo, or socket. @var{perms} (an integer) specifies the file permissions.
-@var{dev} (an integer) specifies which device the special file refers
-to. Its exact interpretation depends on the kind of special file
-being created.
-
-E.g.,
-@lisp
-(mknod "/dev/fd0" 'block-special #o660 (+ (* 2 256) 2))
-@end lisp
-
-The return value is unspecified.
-@end deffn
-
- nice
-@c snarfed from posix.c:1287
-@deffn primitive nice incr
-Increment the priority of the current process by @var{incr}. A higher
-priority value means that the process runs less often.
-The return value is unspecified.
-@end deffn
-
- sync
-@c snarfed from posix.c:1302
-@deffn primitive sync
-Flush the operating system disk buffers.
-The return value is unspecified.
-@end deffn
-
- crypt
-@c snarfed from posix.c:1315
-@deffn primitive crypt key salt
-Encrypt @var{key} using @var{salt} as the salt value to the
-crypt(3) library call
-@end deffn
-
- chroot
-@c snarfed from posix.c:1338
-@deffn primitive chroot path
-Change the root directory to that specified in @var{path}.
-This directory will be used for path names beginning with
-@file{/}. The root directory is inherited by all children
-of the current process. Only the superuser may change the
-root directory.
-@end deffn
-
- getlogin
-@c snarfed from posix.c:1356
-@deffn primitive getlogin
-Return a string containing the name of the user logged in on
-the controlling terminal of the process, or @code{#f} if this
-information cannot be obtained.
-@end deffn
-
- cuserid
-@c snarfed from posix.c:1374
-@deffn primitive cuserid
-Return a string containing a user name associated with the
-effective user id of the process. Return @code{#f} if this
-information cannot be obtained.
-@end deffn
-
- getpriority
-@c snarfed from posix.c:1399
-@deffn primitive getpriority which who
-Return the scheduling priority of the process, process group
-or user, as indicated by @var{which} and @var{who}. @var{which}
-is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
-or @code{PRIO_USER}, and @var{who} is interpreted relative to
-@var{which} (a process identifier for @code{PRIO_PROCESS},
-process group identifier for @code{PRIO_PGRP}, and a user
-identifier for @code{PRIO_USER}. A zero value of @var{who}
-denotes the current process, process group, or user. Return
-the highest priority (lowest numerical value) of any of the
-specified processes.
-@end deffn
-
- setpriority
-@c snarfed from posix.c:1433
-@deffn primitive setpriority which who prio
-Set the scheduling priority of the process, process group
-or user, as indicated by @var{which} and @var{who}. @var{which}
-is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
-or @code{PRIO_USER}, and @var{who} is interpreted relative to
-@var{which} (a process identifier for @code{PRIO_PROCESS},
-process group identifier for @code{PRIO_PGRP}, and a user
-identifier for @code{PRIO_USER}. A zero value of @var{who}
-denotes the current process, process group, or user.
-@var{prio} is a value in the range -20 and 20, the default
-priority is 0; lower priorities cause more favorable
-scheduling. Sets the priority of all of the specified
-processes. Only the super-user may lower priorities.
-The return value is not specified.
-@end deffn
-
- getpass
-@c snarfed from posix.c:1458
-@deffn primitive getpass prompt
-Display @var{prompt} to the standard error output and read
-a password from @file{/dev/tty}. If this file is not
-accessible, it reads from standard input. The password may be
-up to 127 characters in length. Additional characters and the
-terminating newline character are discarded. While reading
-the password, echoing and the generation of signals by special
-characters is disabled.
-@end deffn
-
- flock
-@c snarfed from posix.c:1497
-@deffn primitive flock file operation
-Apply or remove an advisory lock on an open file.
-@var{operation} specifies the action to be done:
-@table @code
-@item LOCK_SH
-Shared lock. More than one process may hold a shared lock
-for a given file at a given time.
-@item LOCK_EX
-Exclusive lock. Only one process may hold an exclusive lock
-for a given file at a given time.
-@item LOCK_UN
-Unlock the file.
-@item LOCK_NB
-Don't block when locking. May be specified by bitwise OR'ing
-it to one of the other operations.
-@end table
-The return value is not specified. @var{file} may be an open
-file descriptor or an open file descriptior port.
-@end deffn
-
- sethostname
-@c snarfed from posix.c:1523
-@deffn primitive sethostname name
-Set the host name of the current processor to @var{name}. May
-only be used by the superuser. The return value is not
-specified.
-@end deffn
-
- gethostname
-@c snarfed from posix.c:1539
-@deffn primitive gethostname
-Return the host name of the current processor.
-@end deffn
-
print-options-interface
-@c snarfed from print.c:142
+@c snarfed from print.c:141
@deffn primitive print-options-interface [setting]
Option interface for the print options. Instead of using
this procedure directly, use the procedures
@@ -4332,76 +3257,76 @@ containing the formatted text. Does not add a trailing newline.
@end deffn
newline
-@c snarfed from print.c:974
+@c snarfed from print.c:995
@deffn primitive newline [port]
Send a newline to @var{port}.
@end deffn
write-char
-@c snarfed from print.c:989
+@c snarfed from print.c:1010
@deffn primitive write-char chr [port]
Send character @var{chr} to @var{port}.
@end deffn
port-with-print-state
-@c snarfed from print.c:1043
+@c snarfed from print.c:1064
@deffn primitive port-with-print-state port pstate
Create a new port which behaves like @var{port}, but with an
included print state @var{pstate}.
@end deffn
get-print-state
-@c snarfed from print.c:1058
+@c snarfed from print.c:1079
@deffn primitive get-print-state port
Return the print state of the port @var{port}. If @var{port}
has no associated print state, @code{#f} is returned.
@end deffn
procedure-properties
-@c snarfed from procprop.c:180
+@c snarfed from procprop.c:176
@deffn primitive procedure-properties proc
Return @var{obj}'s property list.
@end deffn
set-procedure-properties!
-@c snarfed from procprop.c:193
+@c snarfed from procprop.c:189
@deffn primitive set-procedure-properties! proc new_val
Set @var{obj}'s property list to @var{alist}.
@end deffn
procedure-property
-@c snarfed from procprop.c:206
+@c snarfed from procprop.c:202
@deffn primitive procedure-property p k
Return the property of @var{obj} with name @var{key}.
@end deffn
set-procedure-property!
-@c snarfed from procprop.c:229
+@c snarfed from procprop.c:225
@deffn primitive set-procedure-property! p k v
In @var{obj}'s property list, set the property named @var{key} to
@var{value}.
@end deffn
procedure?
-@c snarfed from procs.c:196
+@c snarfed from procs.c:195
@deffn primitive procedure? obj
Return @code{#t} if @var{obj} is a procedure.
@end deffn
closure?
-@c snarfed from procs.c:223
+@c snarfed from procs.c:222
@deffn primitive closure? obj
Return @code{#t} if @var{obj} is a closure.
@end deffn
thunk?
-@c snarfed from procs.c:232
+@c snarfed from procs.c:231
@deffn primitive thunk? obj
Return @code{#t} if @var{obj} is a thunk.
@end deffn
procedure-documentation
-@c snarfed from procs.c:282
+@c snarfed from procs.c:281
@deffn primitive procedure-documentation proc
Return the documentation string associated with @code{proc}. By
convention, if a procedure contains more than one expression and the
@@ -4410,28 +3335,28 @@ documentation for that procedure.
@end deffn
procedure-with-setter?
-@c snarfed from procs.c:318
+@c snarfed from procs.c:317
@deffn primitive procedure-with-setter? obj
Return @code{#t} if @var{obj} is a procedure with an
associated setter procedure.
@end deffn
make-procedure-with-setter
-@c snarfed from procs.c:328
+@c snarfed from procs.c:327
@deffn primitive make-procedure-with-setter procedure setter
Create a new procedure which behaves like @var{procedure}, but
with the associated setter @var{setter}.
@end deffn
procedure
-@c snarfed from procs.c:347
+@c snarfed from procs.c:346
@deffn primitive procedure proc
Return the procedure of @var{proc}, which must be either a
procedure with setter, or an operator struct.
@end deffn
primitive-make-property
-@c snarfed from properties.c:66
+@c snarfed from properties.c:64
@deffn primitive primitive-make-property not_found_proc
Create a @dfn{property token} that can be used with
@code{primitive-property-ref} and @code{primitive-property-set!}.
@@ -4440,7 +3365,7 @@ See @code{primitive-property-ref} for the significance of
@end deffn
primitive-property-ref
-@c snarfed from properties.c:84
+@c snarfed from properties.c:82
@deffn primitive primitive-property-ref prop obj
Return the property @var{prop} of @var{obj}. When no value
has yet been associated with @var{prop} and @var{obj}, call
@@ -4452,90 +3377,19 @@ default value of @var{prop}.
@end deffn
primitive-property-set!
-@c snarfed from properties.c:115
+@c snarfed from properties.c:113
@deffn primitive primitive-property-set! prop obj val
Associate @var{code} with @var{prop} and @var{obj}.
@end deffn
primitive-property-del!
-@c snarfed from properties.c:136
+@c snarfed from properties.c:134
@deffn primitive primitive-property-del! prop obj
Remove any value associated with @var{prop} and @var{obj}.
@end deffn
- array-fill!
-@c snarfed from ramap.c:467
-@deffn primitive array-fill! ra fill
-Stores @var{fill} in every element of @var{array}. The value returned
-is unspecified.
-@end deffn
-
- array-copy-in-order!
-@c snarfed from ramap.c:832
-@deffn primitive array-copy-in-order!
-scm_array_copy_x
-@end deffn
-
- array-copy!
-@c snarfed from ramap.c:841
-@deffn primitive array-copy! src dst
-@deffnx primitive array-copy-in-order! src dst
-Copies every element from vector or array @var{source} to the
-corresponding element of @var{destination}. @var{destination} must have
-the same rank as @var{source}, and be at least as large in each
-dimension. The order is unspecified.
-@end deffn
-
- array-map-in-order!
-@c snarfed from ramap.c:1515
-@deffn primitive array-map-in-order!
-scm_array_map_x
-@end deffn
-
- array-map!
-@c snarfed from ramap.c:1526
-@deffn primitive array-map! ra0 proc . lra
-@deffnx primitive array-map-in-order! ra0 proc . lra
-@var{array1}, @dots{} must have the same number of dimensions as
-@var{array0} and have a range for each index which includes the range
-for the corresponding index in @var{array0}. @var{proc} is applied to
-each tuple of elements of @var{array1} @dots{} and the result is stored
-as the corresponding element in @var{array0}. The value returned is
-unspecified. The order of application is unspecified.
-@end deffn
-
- array-for-each
-@c snarfed from ramap.c:1673
-@deffn primitive array-for-each proc ra0 . lra
-@var{proc} is applied to each tuple of elements of @var{array0} @dots{}
-in row-major order. The value returned is unspecified.
-@end deffn
-
- array-index-map!
-@c snarfed from ramap.c:1701
-@deffn primitive array-index-map! ra proc
-applies @var{proc} to the indices of each element of @var{array} in
-turn, storing the result in the corresponding element. The value
-returned and the order of application are unspecified.
-
-One can implement @var{array-indexes} as
-@lisp
-(define (array-indexes array)
- (let ((ra (apply make-array #f (array-shape array))))
- (array-index-map! ra (lambda x x))
- ra))
-@end lisp
-Another example:
-@lisp
-(define (apl:index-generator n)
- (let ((v (make-uniform-vector n 1)))
- (array-index-map! v (lambda (i) i))
- v))
-@end lisp
-@end deffn
-
random
-@c snarfed from random.c:370
+@c snarfed from random.c:376
@deffn primitive random n [state]
Return a number in [0,N).
@@ -4552,26 +3406,26 @@ as a side effect of the random operation.
@end deffn
copy-random-state
-@c snarfed from random.c:393
+@c snarfed from random.c:399
@deffn primitive copy-random-state [state]
Return a copy of the random state @var{state}.
@end deffn
seed->random-state
-@c snarfed from random.c:405
+@c snarfed from random.c:411
@deffn primitive seed->random-state seed
Return a new random state using @var{seed}.
@end deffn
random:uniform
-@c snarfed from random.c:419
+@c snarfed from random.c:425
@deffn primitive random:uniform [state]
Return a uniformly distributed inexact real random number in
[0,1).
@end deffn
random:normal
-@c snarfed from random.c:434
+@c snarfed from random.c:440
@deffn primitive random:normal [state]
Return an inexact real in a normal distribution. The
distribution used has mean 0 and standard deviation 1. For a
@@ -4580,7 +3434,7 @@ normal distribution with mean m and standard deviation d use
@end deffn
random:solid-sphere!
-@c snarfed from random.c:490
+@c snarfed from random.c:496
@deffn primitive random:solid-sphere! v [state]
Fills vect with inexact real random numbers
the sum of whose squares is less than 1.0.
@@ -4591,7 +3445,7 @@ The sum of the squares of the numbers is returned.
@end deffn
random:hollow-sphere!
-@c snarfed from random.c:513
+@c snarfed from random.c:519
@deffn primitive random:hollow-sphere! v [state]
Fills vect with inexact real random numbers
the sum of whose squares is equal to 1.0.
@@ -4602,7 +3456,7 @@ unit n-shere.
@end deffn
random:normal-vector!
-@c snarfed from random.c:531
+@c snarfed from random.c:537
@deffn primitive random:normal-vector! v [state]
Fills vect with inexact real random numbers that are
independent and standard normally distributed
@@ -4610,7 +3464,7 @@ independent and standard normally distributed
@end deffn
random:exp
-@c snarfed from random.c:556
+@c snarfed from random.c:562
@deffn primitive random:exp [state]
Return an inexact real in an exponential distribution with mean
1. For an exponential distribution with mean u use (* u
@@ -4661,7 +3515,7 @@ used. This function is equivalent to:
@end deffn
read-options-interface
-@c snarfed from read.c:84
+@c snarfed from read.c:82
@deffn primitive read-options-interface [setting]
Option interface for the read options. Instead of using
this procedure directly, use the procedures @code{read-enable},
@@ -4669,7 +3523,7 @@ this procedure directly, use the procedures @code{read-enable},
@end deffn
read
-@c snarfed from read.c:104
+@c snarfed from read.c:102
@deffn primitive read [port]
Read an s-expression from the input port @var{port}, or from
the current input port if @var{port} is not specified.
@@ -4677,7 +3531,7 @@ Any whitespace before the next token is discarded.
@end deffn
read-hash-extend
-@c snarfed from read.c:746
+@c snarfed from read.c:769
@deffn primitive read-hash-extend chr proc
Install the procedure @var{proc} for reading expressions
starting with the character sequence @code{#} and @var{chr}.
@@ -4686,67 +3540,8 @@ starting with the character sequence @code{#} and @var{chr}.
returned will be the return value of @code{read}.
@end deffn
- regexp?
-@c snarfed from regex-posix.c:139
-@deffn primitive regexp? obj
-Return @code{#t} if @var{obj} is a compiled regular expression,
-or @code{#f} otherwise.
-@end deffn
-
- make-regexp
-@c snarfed from regex-posix.c:184
-@deffn primitive make-regexp pat . flags
-Compile the regular expression described by @var{pat}, and
-return the compiled regexp structure. If @var{pat} does not
-describe a legal regular expression, @code{make-regexp} throws
-a @code{regular-expression-syntax} error.
-
-The @var{flags} arguments change the behavior of the compiled
-regular expression. The following flags may be supplied:
-
-@table @code
-@item regexp/icase
-Consider uppercase and lowercase letters to be the same when
-matching.
-@item regexp/newline
-If a newline appears in the target string, then permit the
-@samp{^} and @samp{$} operators to match immediately after or
-immediately before the newline, respectively. Also, the
-@samp{.} and @samp{[^...]} operators will never match a newline
-character. The intent of this flag is to treat the target
-string as a buffer containing many lines of text, and the
-regular expression as a pattern that may match a single one of
-those lines.
-@item regexp/basic
-Compile a basic (``obsolete'') regexp instead of the extended
-(``modern'') regexps that are the default. Basic regexps do
-not consider @samp{|}, @samp{+} or @samp{?} to be special
-characters, and require the @samp{@{...@}} and @samp{(...)}
-metacharacters to be backslash-escaped (@pxref{Backslash
-Escapes}). There are several other differences between basic
-and extended regular expressions, but these are the most
-significant.
-@item regexp/extended
-Compile an extended regular expression rather than a basic
-regexp. This is the default behavior; this flag will not
-usually be needed. If a call to @code{make-regexp} includes
-both @code{regexp/basic} and @code{regexp/extended} flags, the
-one which comes last will override the earlier one.
-@end table
-@end deffn
-
- regexp-exec
-@c snarfed from regex-posix.c:232
-@deffn primitive regexp-exec rx str [start [flags]]
-Match the compiled regular expression @var{rx} against
-@code{str}. If the optional integer @var{start} argument is
-provided, begin matching from that position in the string.
-Return a match structure describing the results of the match,
-or @code{#f} if no match could be found.
-@end deffn
-
call-with-dynamic-root
-@c snarfed from root.c:358
+@c snarfed from root.c:352
@deffn primitive call-with-dynamic-root thunk handler
Evaluate @code{(thunk)} in a new dynamic context, returning its value.
@@ -4793,7 +3588,7 @@ be under a new dynamic root.)
@end deffn
dynamic-root
-@c snarfed from root.c:371
+@c snarfed from root.c:365
@deffn primitive dynamic-root
Return an object representing the current dynamic root.
@@ -4803,11 +3598,13 @@ in no way depend on this.
@end deffn
read-string!/partial
-@c snarfed from rw.c:110
+@c snarfed from rw.c:121
@deffn primitive read-string!/partial str [port_or_fdes [start [end]]]
-Read characters from an fport or file descriptor into a
-string @var{str}. This procedure is scsh-compatible
-and can efficiently read large strings. It will:
+Read characters from a port or file descriptor into a
+string @var{str}. A port must have an underlying file
+descriptor --- a so-called fport. This procedure is
+scsh-compatible and can efficiently read large strings.
+It will:
@itemize
@item
@@ -4819,12 +3616,16 @@ defaults to 0 and @var{end} defaults to
use the current input port if @var{port_or_fdes} is not
supplied.
@item
-read any characters that are currently available,
-without waiting for the rest (short reads are possible).
-
+return fewer than the requested number of characters in some
+cases, e.g., on end of file, if interrupted by a signal, or if
+not all the characters are immediately available.
@item
-wait for as long as it needs to for the first character to
-become available, unless the port is in non-blocking mode
+wait indefinitely for some input if no characters are
+currently available,
+unless the port is in non-blocking mode.
+@item
+read characters from the port's input buffers if available,
+instead from the underlying file descriptor.
@item
return @code{#f} if end-of-file is encountered before reading
any characters, otherwise return the number of characters
@@ -4834,12 +3635,58 @@ return 0 if the port is in non-blocking mode and no characters
are immediately available.
@item
return 0 if the request is for 0 bytes, with no
-end-of-file check
+end-of-file check.
+@end itemize
+@end deffn
+
+ write-string/partial
+@c snarfed from rw.c:215
+@deffn primitive write-string/partial str [port_or_fdes [start [end]]]
+Write characters from a string @var{str} to a port or file
+descriptor. A port must have an underlying file descriptor
+--- a so-called fport. This procedure is
+scsh-compatible and can efficiently write large strings.
+It will:
+
+@itemize
+@item
+attempt to write the entire string, unless the @var{start}
+and/or @var{end} arguments are supplied. i.e., @var{start}
+defaults to 0 and @var{end} defaults to
+@code{(string-length str)}
+@item
+use the current output port if @var{port_of_fdes} is not
+supplied.
+@item
+in the case of a buffered port, store the characters in the
+port's output buffer, if all will fit. If they will not fit
+then any existing buffered characters will be flushed
+before attempting
+to write the new characters directly to the underlying file
+descriptor. If the port is in non-blocking mode and
+buffered characters can not be flushed immediately, then an
+@code{EAGAIN} system-error exception will be raised (Note:
+scsh does not support the use of non-blocking buffered ports.)
+@item
+write fewer than the requested number of
+characters in some cases, e.g., if interrupted by a signal or
+if not all of the output can be accepted immediately.
+@item
+wait indefinitely for at least one character
+from @var{str} to be accepted by the port, unless the port is
+in non-blocking mode.
+@item
+return the number of characters accepted by the port.
+@item
+return 0 if the port is in non-blocking mode and can not accept
+at least one character from @var{str} immediately
+@item
+return 0 immediately if the request size is 0 bytes.
@end itemize
@end deffn
sigaction
-@c snarfed from scmsigs.c:201
+@c snarfed from scmsigs.c:211
@deffn primitive sigaction signum [handler [flags]]
Install or report the signal handler for a specified signal.
@@ -4870,14 +3717,14 @@ structures.
@end deffn
restore-signals
-@c snarfed from scmsigs.c:360
+@c snarfed from scmsigs.c:374
@deffn primitive restore-signals
Return all signal handlers to the values they had before any call to
@code{sigaction} was made. The return value is unspecified.
@end deffn
alarm
-@c snarfed from scmsigs.c:399
+@c snarfed from scmsigs.c:413
@deffn primitive alarm i
Set a timer to raise a @code{SIGALRM} signal after the specified
number of seconds (an integer). It's advisable to install a signal
@@ -4890,8 +3737,44 @@ if any. The new value replaces the previous alarm. If there was
no previous alarm, the return value is zero.
@end deffn
+ setitimer
+@c snarfed from scmsigs.c:443
+@deffn primitive setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds
+Set the timer specified by @var{which_timer} according to the given
+@var{interval_seconds}, @var{interval_microseconds},
+@var{value_seconds}, and @var{value_microseconds} values.
+
+Return information about the timer's previous setting.
+Errors are handled as described in the guile info pages under ``POSIX
+Interface Conventions''.
+
+The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
+and @code{ITIMER_PROF}.
+
+The return value will be a list of two cons pairs representing the
+current state of the given timer. The first pair is the seconds and
+microseconds of the timer @code{it_interval}, and the second pair is
+the seconds and microseconds of the timer @code{it_value}.
+@end deffn
+
+ getitimer
+@c snarfed from scmsigs.c:484
+@deffn primitive getitimer which_timer
+Return information about the timer specified by @var{which_timer}
+Errors are handled as described in the guile info pages under ``POSIX
+Interface Conventions''.
+
+The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
+and @code{ITIMER_PROF}.
+
+The return value will be a list of two cons pairs representing the
+current state of the given timer. The first pair is the seconds and
+microseconds of the timer @code{it_interval}, and the second pair is
+the seconds and microseconds of the timer @code{it_value}.
+@end deffn
+
pause
-@c snarfed from scmsigs.c:414
+@c snarfed from scmsigs.c:511
@deffn primitive pause
Pause the current process (thread?) until a signal arrives whose
action is to either terminate the current process or invoke a
@@ -4899,7 +3782,7 @@ handler procedure. The return value is unspecified.
@end deffn
sleep
-@c snarfed from scmsigs.c:427
+@c snarfed from scmsigs.c:524
@deffn primitive sleep i
Wait for the given number of seconds (an integer) or until a signal
arrives. The return value is zero if the time elapses or the number
@@ -4907,21 +3790,21 @@ of seconds remaining otherwise.
@end deffn
usleep
-@c snarfed from scmsigs.c:445
+@c snarfed from scmsigs.c:542
@deffn primitive usleep i
Sleep for I microseconds. @code{usleep} is not available on
all platforms.
@end deffn
raise
-@c snarfed from scmsigs.c:474
+@c snarfed from scmsigs.c:571
@deffn primitive raise sig
Sends a specified signal @var{sig} to the current process, where
@var{sig} is as described for the kill procedure.
@end deffn
system
-@c snarfed from simpos.c:78
+@c snarfed from simpos.c:76
@deffn primitive system [cmd]
Execute @var{cmd} using the operating system's "command
processor". Under Unix this is usually the default shell
@@ -4934,7 +3817,7 @@ indicating whether the command processor is available.
@end deffn
getenv
-@c snarfed from simpos.c:106
+@c snarfed from simpos.c:103
@deffn primitive getenv nam
Looks up the string @var{name} in the current environment. The return
value is @code{#f} unless a string of the form @code{NAME=VALUE} is
@@ -4942,431 +3825,15 @@ found, in which case the string @code{VALUE} is returned.
@end deffn
primitive-exit
-@c snarfed from simpos.c:122
+@c snarfed from simpos.c:118
@deffn primitive primitive-exit [status]
Terminate the current process without unwinding the Scheme stack.
This is would typically be useful after a fork. The exit status
is @var{status} if supplied, otherwise zero.
@end deffn
- htons
-@c snarfed from socket.c:89
-@deffn primitive htons value
-Convert a 16 bit quantity from host to network byte ordering.
-@var{value} is packed into 2 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
- ntohs
-@c snarfed from socket.c:106
-@deffn primitive ntohs value
-Convert a 16 bit quantity from network to host byte ordering.
-@var{value} is packed into 2 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
- htonl
-@c snarfed from socket.c:123
-@deffn primitive htonl value
-Convert a 32 bit quantity from host to network byte ordering.
-@var{value} is packed into 4 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
- ntohl
-@c snarfed from socket.c:136
-@deffn primitive ntohl value
-Convert a 32 bit quantity from network to host byte ordering.
-@var{value} is packed into 4 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
- inet-aton
-@c snarfed from socket.c:156
-@deffn primitive inet-aton address
-Convert an IPv4 Internet address from printable string
-(dotted decimal notation) to an integer. E.g.,
-
-@lisp
-(inet-aton "127.0.0.1") @result{} 2130706433
-@end lisp
-@end deffn
-
- inet-ntoa
-@c snarfed from socket.c:176
-@deffn primitive inet-ntoa inetid
-Convert an IPv4 Internet address to a printable
-(dotted decimal notation) string. E.g.,
-
-@lisp
-(inet-ntoa 2130706433) @result{} "127.0.0.1"
-@end lisp
-@end deffn
-
- inet-netof
-@c snarfed from socket.c:196
-@deffn primitive inet-netof address
-Return the network number part of the given IPv4
-Internet address. E.g.,
-
-@lisp
-(inet-netof 2130706433) @result{} 127
-@end lisp
-@end deffn
-
- inet-lnaof
-@c snarfed from socket.c:214
-@deffn primitive inet-lnaof address
-Return the local-address-with-network part of the given
-IPv4 Internet address, using the obsolete class A/B/C system.
-E.g.,
-
-@lisp
-(inet-lnaof 2130706433) @result{} 1
-@end lisp
-@end deffn
-
- inet-makeaddr
-@c snarfed from socket.c:232
-@deffn primitive inet-makeaddr net lna
-Make an IPv4 Internet address by combining the network number
-@var{net} with the local-address-within-network number
-@var{lna}. E.g.,
-
-@lisp
-(inet-makeaddr 127 1) @result{} 2130706433
-@end lisp
-@end deffn
-
- inet-pton
-@c snarfed from socket.c:350
-@deffn primitive inet-pton family address
-Convert a string containing a printable network address to
-an integer address. Note that unlike the C version of this
-function,
-the result is an integer with normal host byte ordering.
-@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
-
-@lisp
-(inet-pton AF_INET "127.0.0.1") @result{} 2130706433
-(inet-pton AF_INET6 "::1") @result{} 1
-@end lisp
-@end deffn
-
- inet-ntop
-@c snarfed from socket.c:385
-@deffn primitive inet-ntop family address
-Convert a network address into a printable string.
-Note that unlike the C version of this function,
-the input is an integer with normal host byte ordering.
-@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
-
-@lisp
-(inet-ntop AF_INET 2130706433) @result{} "127.0.0.1"
-(inet-ntop AF_INET6 (- (expt 2 128) 1)) @result{}
-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
-@end lisp
-@end deffn
-
- socket
-@c snarfed from socket.c:430
-@deffn primitive socket family style proto
-Return a new socket port of the type specified by @var{family},
-@var{style} and @var{proto}. All three parameters are
-integers. Supported values for @var{family} are
-@code{AF_UNIX}, @code{AF_INET} and @code{AF_INET6}.
-Typical values for @var{style} are @code{SOCK_STREAM},
-@code{SOCK_DGRAM} and @code{SOCK_RAW}.
-
-@var{proto} can be obtained from a protocol name using
-@code{getprotobyname}. A value of zero specifies the default
-protocol, which is usually right.
-
-A single socket port cannot by used for communication until it
-has been connected to another socket.
-@end deffn
-
- socketpair
-@c snarfed from socket.c:452
-@deffn primitive socketpair family style proto
-Return a pair of connected (but unnamed) socket ports of the
-type specified by @var{family}, @var{style} and @var{proto}.
-Many systems support only socket pairs of the @code{AF_UNIX}
-family. Zero is likely to be the only meaningful value for
-@var{proto}.
-@end deffn
-
- getsockopt
-@c snarfed from socket.c:481
-@deffn primitive getsockopt sock level optname
-Return the value of a particular socket option for the socket
-port @var{sock}. @var{level} is an integer code for type of
-option being requested, e.g., @code{SOL_SOCKET} for
-socket-level options. @var{optname} is an integer code for the
-option required and should be specified using one of the
-symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
-
-The returned value is typically an integer but @code{SO_LINGER}
-returns a pair of integers.
-@end deffn
-
- setsockopt
-@c snarfed from socket.c:549
-@deffn primitive setsockopt sock level optname value
-Set the value of a particular socket option for the socket
-port @var{sock}. @var{level} is an integer code for type of option
-being set, e.g., @code{SOL_SOCKET} for socket-level options.
-@var{optname} is an
-integer code for the option to set and should be specified using one of
-the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
-@var{value} is the value to which the option should be set. For
-most options this must be an integer, but for @code{SO_LINGER} it must
-be a pair.
-
-The return value is unspecified.
-@end deffn
-
- shutdown
-@c snarfed from socket.c:653
-@deffn primitive shutdown sock how
-Sockets can be closed simply by using @code{close-port}. The
-@code{shutdown} procedure allows reception or tranmission on a
-connection to be shut down individually, according to the parameter
-@var{how}:
-
-@table @asis
-@item 0
-Stop receiving data for this socket. If further data arrives, reject it.
-@item 1
-Stop trying to transmit data from this socket. Discard any
-data waiting to be sent. Stop looking for acknowledgement of
-data already sent; don't retransmit it if it is lost.
-@item 2
-Stop both reception and transmission.
-@end table
-
-The return value is unspecified.
-@end deffn
-
- connect
-@c snarfed from socket.c:797
-@deffn primitive connect sock fam address . args
-Initiate a connection from a socket using a specified address
-family to the address
-specified by @var{address} and possibly @var{args}.
-The format required for @var{address}
-and @var{args} depends on the family of the socket.
-
-For a socket of family @code{AF_UNIX},
-only @var{address} is specified and must be a string with the
-filename where the socket is to be created.
-
-For a socket of family @code{AF_INET},
-@var{address} must be an integer IPv4 host address and
-@var{args} must be a single integer port number.
-
-For a socket of family @code{AF_INET6},
-@var{address} must be an integer IPv6 host address and
-@var{args} may be up to three integers:
-port [flowinfo] [scope_id],
-where flowinfo and scope_id default to zero.
-
-The return value is unspecified.
-@end deffn
-
- bind
-@c snarfed from socket.c:857
-@deffn primitive bind sock fam address . args
-Assign an address to the socket port @var{sock}.
-Generally this only needs to be done for server sockets,
-so they know where to look for incoming connections. A socket
-without an address will be assigned one automatically when it
-starts communicating.
-
-The format of @var{address} and @var{args} depends
-on the family of the socket.
-
-For a socket of family @code{AF_UNIX}, only @var{address}
-is specified and must be a string with the filename where
-the socket is to be created.
-
-For a socket of family @code{AF_INET}, @var{address}
-must be an integer IPv4 address and @var{args}
-must be a single integer port number.
-
-The values of the following variables can also be used for
-@var{address}:
-
-@defvar INADDR_ANY
-Allow connections from any address.
-@end defvar
-
-@defvar INADDR_LOOPBACK
-The address of the local host using the loopback device.
-@end defvar
-
-@defvar INADDR_BROADCAST
-The broadcast address on the local network.
-@end defvar
-
-@defvar INADDR_NONE
-No address.
-@end defvar
-
-For a socket of family @code{AF_INET6}, @var{address}
-must be an integer IPv6 address and @var{args}
-may be up to three integers:
-port [flowinfo] [scope_id],
-where flowinfo and scope_id default to zero.
-
-The return value is unspecified.
-@end deffn
-
- listen
-@c snarfed from socket.c:891
-@deffn primitive listen sock backlog
-Enable @var{sock} to accept connection
-requests. @var{backlog} is an integer specifying
-the maximum length of the queue for pending connections.
-If the queue fills, new clients will fail to connect until
-the server calls @code{accept} to accept a connection from
-the queue.
-
-The return value is unspecified.
-@end deffn
-
- accept
-@c snarfed from socket.c:997
-@deffn primitive accept sock
-Accept a connection on a bound, listening socket.
-If there
-are no pending connections in the queue, wait until
-one is available unless the non-blocking option has been
-set on the socket.
-
-The return value is a
-pair in which the @emph{car} is a new socket port for the
-connection and
-the @emph{cdr} is an object with address information about the
-client which initiated the connection.
-
-@var{sock} does not become part of the
-connection and will continue to accept new requests.
-@end deffn
-
- getsockname
-@c snarfed from socket.c:1024
-@deffn primitive getsockname sock
-Return the address of @var{sock}, in the same form as the
-object returned by @code{accept}. On many systems the address
-of a socket in the @code{AF_FILE} namespace cannot be read.
-@end deffn
-
- getpeername
-@c snarfed from socket.c:1046
-@deffn primitive getpeername sock
-Return the address that @var{sock}
-is connected to, in the same form as the object returned by
-@code{accept}. On many systems the address of a socket in the
-@code{AF_FILE} namespace cannot be read.
-@end deffn
-
- recv!
-@c snarfed from socket.c:1081
-@deffn primitive recv! sock buf [flags]
-Receive data from a socket port.
-@var{sock} must already
-be bound to the address from which data is to be received.
-@var{buf} is a string into which
-the data will be written. The size of @var{buf} limits
-the amount of
-data which can be received: in the case of packet
-protocols, if a packet larger than this limit is encountered
-then some data
-will be irrevocably lost.
-
-The optional @var{flags} argument is a value or
-bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
-
-The value returned is the number of bytes read from the
-socket.
-
-Note that the data is read directly from the socket file
-descriptor:
-any unread buffered port data is ignored.
-@end deffn
-
- send
-@c snarfed from socket.c:1114
-@deffn primitive send sock message [flags]
-Transmit the string @var{message} on a socket port @var{sock}.
-@var{sock} must already be bound to a destination address. The
-value returned is the number of bytes transmitted --
-it's possible for
-this to be less than the length of @var{message}
-if the socket is
-set to be non-blocking. The optional @var{flags} argument
-is a value or
-bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
-
-Note that the data is written directly to the socket
-file descriptor:
-any unflushed buffered port data is ignored.
-@end deffn
-
- recvfrom!
-@c snarfed from socket.c:1154
-@deffn primitive recvfrom! sock str [flags [start [end]]]
-Return data from the socket port @var{sock} and also
-information about where the data was received from.
-@var{sock} must already be bound to the address from which
-data is to be received. @code{str}, is a string into which the
-data will be written. The size of @var{str} limits the amount
-of data which can be received: in the case of packet protocols,
-if a packet larger than this limit is encountered then some
-data will be irrevocably lost.
-
-The optional @var{flags} argument is a value or bitwise OR of
-@code{MSG_OOB}, @code{MSG_PEEK}, @code{MSG_DONTROUTE} etc.
-
-The value returned is a pair: the @emph{car} is the number of
-bytes read from the socket and the @emph{cdr} an address object
-in the same form as returned by @code{accept}. The address
-will given as @code{#f} if not available, as is usually the
-case for stream sockets.
-
-The @var{start} and @var{end} arguments specify a substring of
-@var{str} to which the data should be written.
-
-Note that the data is read directly from the socket file
-descriptor: any unread buffered port data is ignored.
-@end deffn
-
- sendto
-@c snarfed from socket.c:1212
-@deffn primitive sendto sock message fam address . args_and_flags
-Transmit the string @var{message} on the socket port
-@var{sock}. The
-destination address is specified using the @var{fam},
-@var{address} and
-@var{args_and_flags} arguments, in a similar way to the
-@code{connect} procedure. @var{args_and_flags} contains
-the usual connection arguments optionally followed by
-a flags argument, which is a value or
-bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
-
-The value returned is the number of bytes transmitted --
-it's possible for
-this to be less than the length of @var{message} if the
-socket is
-set to be non-blocking.
-Note that the data is written directly to the socket
-file descriptor:
-any unflushed buffered port data is ignored.
-@end deffn
-
restricted-vector-sort!
-@c snarfed from sort.c:425
+@c snarfed from sort.c:421
@deffn primitive restricted-vector-sort! vec less startpos endpos
Sort the vector @var{vec}, using @var{less} for comparing
the vector elements. @var{startpos} and @var{endpos} delimit
@@ -5375,7 +3842,7 @@ is not specified.
@end deffn
sorted?
-@c snarfed from sort.c:456
+@c snarfed from sort.c:452
@deffn primitive sorted? items less
Return @code{#t} iff @var{items} is a list or a vector such that
for all 1 <= i <= m, the predicate @var{less} returns true when
@@ -5383,7 +3850,7 @@ applied to all elements i - 1 and i
@end deffn
merge
-@c snarfed from sort.c:528
+@c snarfed from sort.c:524
@deffn primitive merge alist blist less
Takes two lists @var{alist} and @var{blist} such that
@code{(sorted? alist less?)} and @code{(sorted? blist less?)} and
@@ -5394,7 +3861,7 @@ Note: this does _not_ accept vectors.
@end deffn
merge!
-@c snarfed from sort.c:641
+@c snarfed from sort.c:637
@deffn primitive merge! alist blist less
Takes two lists @var{alist} and @var{blist} such that
@code{(sorted? alist less?)} and @code{(sorted? blist less?)} and
@@ -5406,7 +3873,7 @@ Note: this does _not_ accept vectors.
@end deffn
sort!
-@c snarfed from sort.c:717
+@c snarfed from sort.c:713
@deffn primitive sort! items less
Sort the sequence @var{items}, which may be a list or a
vector. @var{less} is used for comparing the sequence
@@ -5416,7 +3883,7 @@ This is not a stable sort.
@end deffn
sort
-@c snarfed from sort.c:751
+@c snarfed from sort.c:747
@deffn primitive sort items less
Sort the sequence @var{items}, which may be a list or a
vector. @var{less} is used for comparing the sequence
@@ -5424,7 +3891,7 @@ elements. This is not a stable sort.
@end deffn
stable-sort!
-@c snarfed from sort.c:847
+@c snarfed from sort.c:843
@deffn primitive stable-sort! items less
Sort the sequence @var{items}, which may be a list or a
vector. @var{less} is used for comparing the sequence elements.
@@ -5434,7 +3901,7 @@ This is a stable sort.
@end deffn
stable-sort
-@c snarfed from sort.c:887
+@c snarfed from sort.c:883
@deffn primitive stable-sort items less
Sort the sequence @var{items}, which may be a list or a
vector. @var{less} is used for comparing the sequence elements.
@@ -5442,7 +3909,7 @@ This is a stable sort.
@end deffn
sort-list!
-@c snarfed from sort.c:933
+@c snarfed from sort.c:929
@deffn primitive sort-list! items less
Sort the list @var{items}, using @var{less} for comparing the
list elements. The sorting is destructive, that means that the
@@ -5451,82 +3918,104 @@ This is a stable sort.
@end deffn
sort-list
-@c snarfed from sort.c:947
+@c snarfed from sort.c:943
@deffn primitive sort-list items less
Sort the list @var{items}, using @var{less} for comparing the
list elements. This is a stable sort.
@end deffn
source-properties
-@c snarfed from srcprop.c:172
+@c snarfed from srcprop.c:170
@deffn primitive source-properties obj
Return the source property association list of @var{obj}.
@end deffn
set-source-properties!
-@c snarfed from srcprop.c:195
+@c snarfed from srcprop.c:193
@deffn primitive set-source-properties! obj plist
Install the association list @var{plist} as the source property
list for @var{obj}.
@end deffn
source-property
-@c snarfed from srcprop.c:215
+@c snarfed from srcprop.c:213
@deffn primitive source-property obj key
Return the source property specified by @var{key} from
@var{obj}'s source property list.
@end deffn
set-source-property!
-@c snarfed from srcprop.c:248
+@c snarfed from srcprop.c:246
@deffn primitive set-source-property! obj key datum
Set the source property of object @var{obj}, which is specified by
@var{key} to @var{datum}. Normally, the key will be a symbol.
@end deffn
stack?
-@c snarfed from stacks.c:407
+@c snarfed from stacks.c:411
@deffn primitive stack? obj
Return @code{#t} if @var{obj} is a calling stack.
@end deffn
make-stack
-@c snarfed from stacks.c:421
+@c snarfed from stacks.c:442
@deffn primitive make-stack obj . args
Create a new stack. If @var{obj} is @code{#t}, the current
evaluation stack is used for creating the stack frames,
otherwise the frames are taken from @var{obj} (which must be
either a debug object or a continuation).
-@var{args} must be a list of integers and specifies how the
-resulting stack will be narrowed.
+
+@var{args} should be a list containing any combination of
+integer, procedure and @code{#t} values.
+
+These values specify various ways of cutting away uninteresting
+stack frames from the top and bottom of the stack that
+@code{make-stack} returns. They come in pairs like this:
+@code{(@var{inner_cut_1} @var{outer_cut_1} @var{inner_cut_2}
+@var{outer_cut_2} @dots{})}.
+
+Each @var{inner_cut_N} can be @code{#t}, an integer, or a
+procedure. @code{#t} means to cut away all frames up to but
+excluding the first user module frame. An integer means to cut
+away exactly that number of frames. A procedure means to cut
+away all frames up to but excluding the application frame whose
+procedure matches the specified one.
+
+Each @var{outer_cut_N} can be an integer or a procedure. An
+integer means to cut away that number of frames. A procedure
+means to cut away frames down to but excluding the application
+frame whose procedure matches the specified one.
+
+If the @var{outer_cut_N} of the last pair is missing, it is
+taken as 0.
@end deffn
stack-id
-@c snarfed from stacks.c:512
+@c snarfed from stacks.c:534
@deffn primitive stack-id stack
Return the identifier given to @var{stack} by @code{start-stack}.
@end deffn
stack-ref
-@c snarfed from stacks.c:548
-@deffn primitive stack-ref stack i
-Return the @var{i}'th frame from @var{stack}.
+@c snarfed from stacks.c:575
+@deffn primitive stack-ref stack index
+Return the @var{index}'th frame from @var{stack}.
@end deffn
stack-length
-@c snarfed from stacks.c:562
+@c snarfed from stacks.c:591
@deffn primitive stack-length stack
Return the length of @var{stack}.
@end deffn
frame?
-@c snarfed from stacks.c:575
+@c snarfed from stacks.c:604
@deffn primitive frame? obj
Return @code{#t} if @var{obj} is a stack frame.
@end deffn
last-stack-frame
-@c snarfed from stacks.c:586
+@c snarfed from stacks.c:615
@deffn primitive last-stack-frame obj
Return a stack which consists of a single frame, which is the
last stack frame for @var{obj}. @var{obj} must be either a
@@ -5534,77 +4023,77 @@ debug object or a continuation.
@end deffn
frame-number
-@c snarfed from stacks.c:627
+@c snarfed from stacks.c:657
@deffn primitive frame-number frame
Return the frame number of @var{frame}.
@end deffn
frame-source
-@c snarfed from stacks.c:637
+@c snarfed from stacks.c:667
@deffn primitive frame-source frame
Return the source of @var{frame}.
@end deffn
frame-procedure
-@c snarfed from stacks.c:648
+@c snarfed from stacks.c:678
@deffn primitive frame-procedure frame
Return the procedure for @var{frame}, or @code{#f} if no
procedure is associated with @var{frame}.
@end deffn
frame-arguments
-@c snarfed from stacks.c:660
+@c snarfed from stacks.c:690
@deffn primitive frame-arguments frame
Return the arguments of @var{frame}.
@end deffn
frame-previous
-@c snarfed from stacks.c:671
+@c snarfed from stacks.c:701
@deffn primitive frame-previous frame
Return the previous frame of @var{frame}, or @code{#f} if
@var{frame} is the first frame in its stack.
@end deffn
frame-next
-@c snarfed from stacks.c:687
+@c snarfed from stacks.c:717
@deffn primitive frame-next frame
Return the next frame of @var{frame}, or @code{#f} if
@var{frame} is the last frame in its stack.
@end deffn
frame-real?
-@c snarfed from stacks.c:702
+@c snarfed from stacks.c:732
@deffn primitive frame-real? frame
Return @code{#t} if @var{frame} is a real frame.
@end deffn
frame-procedure?
-@c snarfed from stacks.c:712
+@c snarfed from stacks.c:742
@deffn primitive frame-procedure? frame
Return @code{#t} if a procedure is associated with @var{frame}.
@end deffn
frame-evaluating-args?
-@c snarfed from stacks.c:722
+@c snarfed from stacks.c:752
@deffn primitive frame-evaluating-args? frame
Return @code{#t} if @var{frame} contains evaluated arguments.
@end deffn
frame-overflow?
-@c snarfed from stacks.c:732
+@c snarfed from stacks.c:762
@deffn primitive frame-overflow? frame
Return @code{#t} if @var{frame} is an overflow frame.
@end deffn
get-internal-real-time
-@c snarfed from stime.c:142
+@c snarfed from stime.c:143
@deffn primitive get-internal-real-time
Return the number of time units since the interpreter was
started.
@end deffn
times
-@c snarfed from stime.c:187
+@c snarfed from stime.c:188
@deffn primitive times
Return an object with information about real and processor
time. The following procedures accept such an object as an
@@ -5630,7 +4119,7 @@ terminated child processes.
@end deffn
get-internal-run-time
-@c snarfed from stime.c:219
+@c snarfed from stime.c:220
@deffn primitive get-internal-run-time
Return the number of time units of processor time used by the
interpreter. Both @emph{system} and @emph{user} time are
@@ -5638,14 +4127,14 @@ included but subprocesses are not.
@end deffn
current-time
-@c snarfed from stime.c:229
+@c snarfed from stime.c:230
@deffn primitive current-time
Return the number of seconds since 1970-01-01 00:00:00 UTC,
excluding leap seconds.
@end deffn
gettimeofday
-@c snarfed from stime.c:247
+@c snarfed from stime.c:248
@deffn primitive gettimeofday
Return a pair containing the number of seconds and microseconds
since 1970-01-01 00:00:00 UTC, excluding leap seconds. Note:
@@ -5706,7 +4195,7 @@ is the formatted string.
@end deffn
strptime
-@c snarfed from stime.c:669
+@c snarfed from stime.c:668
@deffn primitive strptime format string
Performs the reverse action to @code{strftime}, parsing
@var{string} according to the specification supplied in
@@ -5727,21 +4216,14 @@ Return @code{#t} iff @var{obj} is a string, else returns
@code{#f}.
@end deffn
- read-only-string?
-@c snarfed from strings.c:78
-@deffn primitive read-only-string? obj
-Return @code{#t} if @var{obj} is either a string or a symbol,
-otherwise return @code{#f}.
-@end deffn
-
list->string
-@c snarfed from strings.c:87
+@c snarfed from strings.c:70
@deffn primitive list->string
-scm_string
+implemented by the C function "scm_string"
@end deffn
string
-@c snarfed from strings.c:93
+@c snarfed from strings.c:76
@deffn primitive string . chrs
@deffnx primitive list->string chrs
Return a newly allocated string composed of the arguments,
@@ -5749,7 +4231,7 @@ Return a newly allocated string composed of the arguments,
@end deffn
make-string
-@c snarfed from strings.c:246
+@c snarfed from strings.c:214
@deffn primitive make-string k [chr]
Return a newly allocated string of
length @var{k}. If @var{chr} is given, then all elements of
@@ -5758,20 +4240,20 @@ of the @var{string} are unspecified.
@end deffn
string-length
-@c snarfed from strings.c:279
+@c snarfed from strings.c:247
@deffn primitive string-length string
Return the number of characters in @var{string}.
@end deffn
string-ref
-@c snarfed from strings.c:290
+@c snarfed from strings.c:258
@deffn primitive string-ref str k
Return character @var{k} of @var{str} using zero-origin
indexing. @var{k} must be a valid index of @var{str}.
@end deffn
string-set!
-@c snarfed from strings.c:307
+@c snarfed from strings.c:275
@deffn primitive string-set! str k chr
Store @var{chr} in element @var{k} of @var{str} and return
an unspecified value. @var{k} must be a valid index of
@@ -5779,7 +4261,7 @@ an unspecified value. @var{k} must be a valid index of
@end deffn
substring
-@c snarfed from strings.c:330
+@c snarfed from strings.c:294
@deffn primitive substring str start [end]
Return a newly allocated string formed from the characters
of @var{str} beginning with index @var{start} (inclusive) and
@@ -5791,26 +4273,14 @@ exact integers satisfying:
@end deffn
string-append
-@c snarfed from strings.c:353
+@c snarfed from strings.c:320
@deffn primitive string-append . args
Return a newly allocated string whose characters form the
concatenation of the given strings, @var{args}.
@end deffn
- make-shared-substring
-@c snarfed from strings.c:393
-@deffn primitive make-shared-substring str [start [end]]
-Return a shared substring of @var{str}. The arguments are the
-same as for the @code{substring} function: the shared substring
-returned includes all of the text from @var{str} between
-indexes @var{start} (inclusive) and @var{end} (exclusive). If
-@var{end} is omitted, it defaults to the end of @var{str}. The
-shared substring returned by @code{make-shared-substring}
-occupies the same storage space as @var{str}.
-@end deffn
-
string-index
-@c snarfed from strop.c:116
+@c snarfed from strop.c:138
@deffn primitive string-index str chr [frm [to]]
Return the index of the first occurrence of @var{chr} in
@var{str}. The optional integer arguments @var{frm} and
@@ -5831,7 +4301,7 @@ procedure essentially implements the @code{index} or
@end deffn
string-rindex
-@c snarfed from strop.c:146
+@c snarfed from strop.c:168
@deffn primitive string-rindex str chr [frm [to]]
Like @code{string-index}, but search from the right of the
string rather than from the left. This procedure essentially
@@ -5851,24 +4321,24 @@ the C library.
@end deffn
substring-move-left!
-@c snarfed from strop.c:163
+@c snarfed from strop.c:185
@deffn primitive substring-move-left!
-scm_substring_move_x
+implemented by the C function "scm_substring_move_x"
@end deffn
substring-move-right!
-@c snarfed from strop.c:164
+@c snarfed from strop.c:186
@deffn primitive substring-move-right!
-scm_substring_move_x
+implemented by the C function "scm_substring_move_x"
@end deffn
substring-move!
-@c snarfed from strop.c:238
+@c snarfed from strop.c:260
@deffn primitive substring-move! str1 start1 end1 str2 start2
@deffnx primitive substring-move-left! str1 start1 end1 str2 start2
@deffnx primitive substring-move-right! str1 start1 end1 str2 start2
Copy the substring of @var{str1} bounded by @var{start1} and @var{end1}
-into @var{str2} beginning at position @var{end2}.
+into @var{str2} beginning at position @var{start2}.
@code{substring-move-right!} begins copying from the rightmost character
and moves left, and @code{substring-move-left!} copies from the leftmost
character moving right.
@@ -5886,7 +4356,7 @@ are different strings, it does not matter which function you use.
@end deffn
substring-fill!
-@c snarfed from strop.c:274
+@c snarfed from strop.c:296
@deffn primitive substring-fill! str start end fill
Change every character in @var{str} between @var{start} and
@var{end} to @var{fill}.
@@ -5900,7 +4370,7 @@ y
@end deffn
string-null?
-@c snarfed from strop.c:299
+@c snarfed from strop.c:321
@deffn primitive string-null? str
Return @code{#t} if @var{str}'s length is nonzero, and
@code{#f} otherwise.
@@ -5912,7 +4382,7 @@ y @result{} "foo"
@end deffn
string->list
-@c snarfed from strop.c:313
+@c snarfed from strop.c:335
@deffn primitive string->list str
Return a newly allocated list of the characters that make up
the given string @var{str}. @code{string->list} and
@@ -5921,20 +4391,20 @@ concerned.
@end deffn
string-copy
-@c snarfed from strop.c:338
+@c snarfed from strop.c:364
@deffn primitive string-copy str
Return a newly allocated copy of the given @var{string}.
@end deffn
string-fill!
-@c snarfed from strop.c:351
+@c snarfed from strop.c:377
@deffn primitive string-fill! str chr
Store @var{char} in every element of the given @var{string} and
return an unspecified value.
@end deffn
string-upcase!
-@c snarfed from strop.c:386
+@c snarfed from strop.c:412
@deffn primitive string-upcase! str
Destructively upcase every character in @var{str} and return
@var{str}.
@@ -5946,14 +4416,14 @@ y @result{} "ARRDEFG"
@end deffn
string-upcase
-@c snarfed from strop.c:399
+@c snarfed from strop.c:425
@deffn primitive string-upcase str
Return a freshly allocated string containing the characters of
@var{str} in upper case.
@end deffn
string-downcase!
-@c snarfed from strop.c:431
+@c snarfed from strop.c:457
@deffn primitive string-downcase! str
Destructively downcase every character in @var{str} and return
@var{str}.
@@ -5965,14 +4435,14 @@ y @result{} "arrdefg"
@end deffn
string-downcase
-@c snarfed from strop.c:444
+@c snarfed from strop.c:470
@deffn primitive string-downcase str
Return a freshly allocation string containing the characters in
@var{str} in lower case.
@end deffn
string-capitalize!
-@c snarfed from strop.c:488
+@c snarfed from strop.c:515
@deffn primitive string-capitalize! str
Upcase the first character of every word in @var{str}
destructively and return @var{str}.
@@ -5985,15 +4455,38 @@ y @result{} "Hello World"
@end deffn
string-capitalize
-@c snarfed from strop.c:502
+@c snarfed from strop.c:529
@deffn primitive string-capitalize str
Return a freshly allocated string with the characters in
@var{str}, where the first character of every word is
capitalized.
@end deffn
+ string-split
+@c snarfed from strop.c:558
+@deffn primitive string-split str chr
+Split the string @var{str} into the a list of the substrings delimited
+by appearances of the character @var{chr}. Note that an empty substring
+between separator characters will result in an empty string in the
+result list.
+
+@lisp
+(string-split "root:x:0:0:root:/root:/bin/bash" #:)
+@result{}
+("root" "x" "0" "0" "root" "/root" "/bin/bash")
+
+(string-split "::" #:)
+@result{}
+("" "" "")
+
+(string-split "" #:)
+@result{}
+("")
+@end lisp
+@end deffn
+
string-ci->symbol
-@c snarfed from strop.c:516
+@c snarfed from strop.c:593
@deffn primitive string-ci->symbol str
Return the symbol whose name is @var{str}. @var{str} is
converted to lowercase before the conversion is done, if Guile
@@ -6001,7 +4494,7 @@ is currently reading symbols case--insensitively.
@end deffn
string=?
-@c snarfed from strorder.c:64
+@c snarfed from strorder.c:62
@deffn primitive string=? s1 s2
Lexicographic equality predicate; return @code{#t} if the two
strings are the same length and contain the same characters in
@@ -6014,7 +4507,7 @@ characters.
@end deffn
string-ci=?
-@c snarfed from strorder.c:99
+@c snarfed from strorder.c:97
@deffn primitive string-ci=? s1 s2
Case-insensitive string equality predicate; return @code{#t} if
the two strings are the same length and their component
@@ -6023,35 +4516,35 @@ return @code{#f}.
@end deffn
string<?
-@c snarfed from strorder.c:156
+@c snarfed from strorder.c:154
@deffn primitive string<? s1 s2
Lexicographic ordering predicate; return @code{#t} if @var{s1}
is lexicographically less than @var{s2}.
@end deffn
string<=?
-@c snarfed from strorder.c:170
+@c snarfed from strorder.c:168
@deffn primitive string<=? s1 s2
Lexicographic ordering predicate; return @code{#t} if @var{s1}
is lexicographically less than or equal to @var{s2}.
@end deffn
string>?
-@c snarfed from strorder.c:184
+@c snarfed from strorder.c:182
@deffn primitive string>? s1 s2
Lexicographic ordering predicate; return @code{#t} if @var{s1}
is lexicographically greater than @var{s2}.
@end deffn
string>=?
-@c snarfed from strorder.c:198
+@c snarfed from strorder.c:196
@deffn primitive string>=? s1 s2
Lexicographic ordering predicate; return @code{#t} if @var{s1}
is lexicographically greater than or equal to @var{s2}.
@end deffn
string-ci<?
-@c snarfed from strorder.c:237
+@c snarfed from strorder.c:235
@deffn primitive string-ci<? s1 s2
Case insensitive lexicographic ordering predicate; return
@code{#t} if @var{s1} is lexicographically less than @var{s2}
@@ -6059,7 +4552,7 @@ regardless of case.
@end deffn
string-ci<=?
-@c snarfed from strorder.c:252
+@c snarfed from strorder.c:250
@deffn primitive string-ci<=? s1 s2
Case insensitive lexicographic ordering predicate; return
@code{#t} if @var{s1} is lexicographically less than or equal
@@ -6067,7 +4560,7 @@ to @var{s2} regardless of case.
@end deffn
string-ci>?
-@c snarfed from strorder.c:267
+@c snarfed from strorder.c:265
@deffn primitive string-ci>? s1 s2
Case insensitive lexicographic ordering predicate; return
@code{#t} if @var{s1} is lexicographically greater than
@@ -6075,7 +4568,7 @@ Case insensitive lexicographic ordering predicate; return
@end deffn
string-ci>=?
-@c snarfed from strorder.c:282
+@c snarfed from strorder.c:280
@deffn primitive string-ci>=? s1 s2
Case insensitive lexicographic ordering predicate; return
@code{#t} if @var{s1} is lexicographically greater than or
@@ -6083,7 +4576,7 @@ equal to @var{s2} regardless of case.
@end deffn
object->string
-@c snarfed from strports.c:318
+@c snarfed from strports.c:321
@deffn primitive object->string obj [printer]
Return a Scheme string obtained by printing @var{obj}.
Printing function can be specified by the optional second
@@ -6091,7 +4584,7 @@ argument @var{printer} (default: @code{write}).
@end deffn
call-with-output-string
-@c snarfed from strports.c:352
+@c snarfed from strports.c:345
@deffn primitive call-with-output-string proc
Calls the one-argument procedure @var{proc} with a newly created output
port. When the function returns, the string composed of the characters
@@ -6099,7 +4592,7 @@ written into the port is returned.
@end deffn
call-with-input-string
-@c snarfed from strports.c:371
+@c snarfed from strports.c:364
@deffn primitive call-with-input-string string proc
Calls the one-argument procedure @var{proc} with a newly
created input port from which @var{string}'s contents may be
@@ -6107,7 +4600,7 @@ read. The value yielded by the @var{proc} is returned.
@end deffn
open-input-string
-@c snarfed from strports.c:384
+@c snarfed from strports.c:377
@deffn primitive open-input-string str
Take a string and return an input port that delivers characters
from the string. The port can be closed by
@@ -6116,7 +4609,7 @@ by the garbage collector if it becomes inaccessible.
@end deffn
open-output-string
-@c snarfed from strports.c:398
+@c snarfed from strports.c:391
@deffn primitive open-output-string
Return an output port that will accumulate characters for
retrieval by @code{get-output-string}. The port can be closed
@@ -6126,7 +4619,7 @@ inaccessible.
@end deffn
get-output-string
-@c snarfed from strports.c:415
+@c snarfed from strports.c:408
@deffn primitive get-output-string port
Given an output port created by @code{open-output-string},
return a string consisting of the characters that have been
@@ -6134,7 +4627,7 @@ output to the port so far.
@end deffn
eval-string
-@c snarfed from strports.c:456
+@c snarfed from strports.c:467
@deffn primitive eval-string string
Evaluate @var{string} as the text representation of a Scheme
form or forms, and return whatever value they produce.
@@ -6143,7 +4636,7 @@ procedure @code{interaction-environment}.
@end deffn
make-struct-layout
-@c snarfed from struct.c:79
+@c snarfed from struct.c:77
@deffn primitive make-struct-layout fields
Return a new structure layout object.
@@ -6158,14 +4651,14 @@ indicate that the field is a tail-array.
@end deffn
struct?
-@c snarfed from struct.c:246
+@c snarfed from struct.c:244
@deffn primitive struct? x
Return @code{#t} iff @var{obj} is a structure object, else
@code{#f}.
@end deffn
struct-vtable?
-@c snarfed from struct.c:255
+@c snarfed from struct.c:253
@deffn primitive struct-vtable? x
Return @code{#t} iff obj is a vtable structure.
@end deffn
@@ -6201,7 +4694,7 @@ For more information, see the documentation for @code{make-vtable-vtable}.
@end deffn
make-vtable-vtable
-@c snarfed from struct.c:523
+@c snarfed from struct.c:524
@deffn primitive make-vtable-vtable user_fields tail_array_size . init
Return a new, self-describing vtable structure.
@@ -6262,7 +4755,7 @@ ball @result{} #<a green ball owned by Nisse>
@end deffn
struct-ref
-@c snarfed from struct.c:565
+@c snarfed from struct.c:567
@deffn primitive struct-ref handle pos
@deffnx primitive struct-set! struct n value
Access (or modify) the @var{n}th field of @var{struct}.
@@ -6274,7 +4767,7 @@ integer value small enough to fit in one machine word.
@end deffn
struct-set!
-@c snarfed from struct.c:643
+@c snarfed from struct.c:645
@deffn primitive struct-set! handle pos val
Set the slot of the structure @var{handle} with index @var{pos}
to @var{val}. Signal an error if the slot can not be written
@@ -6282,42 +4775,42 @@ to.
@end deffn
struct-vtable
-@c snarfed from struct.c:713
+@c snarfed from struct.c:715
@deffn primitive struct-vtable handle
Return the vtable structure that describes the type of @var{struct}.
@end deffn
struct-vtable-tag
-@c snarfed from struct.c:724
+@c snarfed from struct.c:726
@deffn primitive struct-vtable-tag handle
Return the vtable tag of the structure @var{handle}.
@end deffn
struct-vtable-name
-@c snarfed from struct.c:763
+@c snarfed from struct.c:765
@deffn primitive struct-vtable-name vtable
Return the name of the vtable @var{vtable}.
@end deffn
set-struct-vtable-name!
-@c snarfed from struct.c:773
+@c snarfed from struct.c:775
@deffn primitive set-struct-vtable-name! vtable name
Set the name of the vtable @var{vtable} to @var{name}.
@end deffn
symbol?
-@c snarfed from symbols.c:422
+@c snarfed from symbols.c:152
@deffn primitive symbol? obj
Return @code{#t} if @var{obj} is a symbol, otherwise return
@code{#f}.
@end deffn
symbol->string
-@c snarfed from symbols.c:453
+@c snarfed from symbols.c:183
@deffn primitive symbol->string s
Return the name of @var{symbol} as a string. If the symbol was
part of an object returned as the value of a literal expression
-(section @pxref{Literal expressions,,,r4rs, The Revised^4
+(section @pxref{Literal expressions,,,r5rs, The Revised^5
Report on Scheme}) or by a call to the @code{read} procedure,
and its name contains alphabetic characters, then the string
returned will contain characters in the implementation's
@@ -6341,7 +4834,7 @@ standard case is lower case:
@end deffn
string->symbol
-@c snarfed from symbols.c:483
+@c snarfed from symbols.c:216
@deffn primitive string->symbol string
Return the symbol whose name is @var{string}. This procedure
can create symbols with names containing special characters or
@@ -6365,136 +4858,48 @@ standard case is lower case:
@end lisp
@end deffn
- string->obarray-symbol
-@c snarfed from symbols.c:505
-@deffn primitive string->obarray-symbol o s [softp]
-Intern a new symbol in @var{obarray}, a symbol table, with name
-@var{string}.
-
-If @var{obarray} is @code{#f}, use the default system symbol table. If
-@var{obarray} is @code{#t}, the symbol should not be interned in any
-symbol table; merely return the pair (@var{symbol}
-. @var{#<undefined>}).
-
-The @var{soft?} argument determines whether new symbol table entries
-should be created when the specified symbol is not already present in
-@var{obarray}. If @var{soft?} is specified and is a true value, then
-new entries should not be added for symbols not already present in the
-table; instead, simply return @code{#f}.
-@end deffn
-
- intern-symbol
-@c snarfed from symbols.c:537
-@deffn primitive intern-symbol o s
-Add a new symbol to @var{obarray} with name @var{string}, bound to an
-unspecified initial value. The symbol table is not modified if a symbol
-with this name is already present.
-@end deffn
-
- unintern-symbol
-@c snarfed from symbols.c:574
-@deffn primitive unintern-symbol o s
-Remove the symbol with name @var{string} from @var{obarray}. This
-function returns @code{#t} if the symbol was present and @code{#f}
-otherwise.
-@end deffn
-
- symbol-binding
-@c snarfed from symbols.c:615
-@deffn primitive symbol-binding o s
-Look up in @var{obarray} the symbol whose name is @var{string}, and
-return the value to which it is bound. If @var{obarray} is @code{#f},
-use the global symbol table. If @var{string} is not interned in
-@var{obarray}, an error is signalled.
-@end deffn
-
- symbol-interned?
-@c snarfed from symbols.c:632
-@deffn primitive symbol-interned? o s
-Return @code{#t} if @var{obarray} contains a symbol with name
-@var{string}, and @code{#f} otherwise.
-@end deffn
-
- symbol-bound?
-@c snarfed from symbols.c:655
-@deffn primitive symbol-bound? o s
-Return @code{#t} if @var{obarray} contains a symbol with name
-@var{string} bound to a defined value. This differs from
-@var{symbol-interned?} in that the mere mention of a symbol
-usually causes it to be interned; @code{symbol-bound?}
-determines whether a symbol has been given any meaningful
-value.
+ gensym
+@c snarfed from symbols.c:235
+@deffn primitive gensym [prefix]
+Create a new symbol with a name constructed from a prefix and
+a counter value. The string @var{prefix} can be specified as
+an optional argument. Default prefix is @code{g}. The counter
+is increased by 1 at each call. There is no provision for
+resetting the counter.
@end deffn
- symbol-set!
-@c snarfed from symbols.c:673
-@deffn primitive symbol-set! o s v
-Find the symbol in @var{obarray} whose name is @var{string}, and rebind
-it to @var{value}. An error is signalled if @var{string} is not present
-in @var{obarray}.
+ symbol-hash
+@c snarfed from symbols.c:266
+@deffn primitive symbol-hash symbol
+Return a hash value for @var{symbol}.
@end deffn
symbol-fref
-@c snarfed from symbols.c:690
+@c snarfed from symbols.c:276
@deffn primitive symbol-fref s
Return the contents of @var{symbol}'s @dfn{function slot}.
@end deffn
symbol-pref
-@c snarfed from symbols.c:701
+@c snarfed from symbols.c:287
@deffn primitive symbol-pref s
Return the @dfn{property list} currently associated with @var{symbol}.
@end deffn
symbol-fset!
-@c snarfed from symbols.c:712
+@c snarfed from symbols.c:298
@deffn primitive symbol-fset! s val
Change the binding of @var{symbol}'s function slot.
@end deffn
symbol-pset!
-@c snarfed from symbols.c:724
+@c snarfed from symbols.c:310
@deffn primitive symbol-pset! s val
Change the binding of @var{symbol}'s property slot.
@end deffn
- symbol-hash
-@c snarfed from symbols.c:738
-@deffn primitive symbol-hash symbol
-Return a hash value for @var{symbol}.
-@end deffn
-
- builtin-bindings
-@c snarfed from symbols.c:775
-@deffn primitive builtin-bindings
-Create and return a copy of the global symbol table, removing all
-unbound symbols.
-@end deffn
-
- gensym
-@c snarfed from symbols.c:796
-@deffn primitive gensym [prefix]
-Create a new symbol with a name constructed from a prefix and
-a counter value. The string @var{prefix} can be specified as
-an optional argument. Default prefix is @code{g}. The counter
-is increased by 1 at each call. There is no provision for
-resetting the counter.
-@end deffn
-
- gentemp
-@c snarfed from symbols.c:835
-@deffn primitive gentemp [prefix [obarray]]
-Create a new symbol with a name unique in an obarray.
-The name is constructed from an optional string @var{prefix}
-and a counter value. The default prefix is @code{t}. The
-@var{obarray} is specified as a second optional argument.
-Default is the system obarray where all normal symbols are
-interned. The counter is increased by 1 at each
-call. There is no provision for resetting the counter.
-@end deffn
-
catch
-@c snarfed from throw.c:535
+@c snarfed from throw.c:533
@deffn primitive catch key thunk handler
Invoke @var{thunk} in the dynamic context of @var{handler} for
exceptions matching @var{key}. If thunk throws to the symbol
@@ -6517,15 +4922,16 @@ match this call to @code{catch}.
@end deffn
lazy-catch
-@c snarfed from throw.c:562
+@c snarfed from throw.c:561
@deffn primitive lazy-catch key thunk handler
This behaves exactly like @code{catch}, except that it does
-not unwind the stack (this is the major difference), and if
-handler returns, its value is returned from the throw.
+not unwind the stack before invoking @var{handler}.
+The @var{handler} procedure is not allowed to return:
+it must throw to another catch, or otherwise exit non-locally.
@end deffn
throw
-@c snarfed from throw.c:595
+@c snarfed from throw.c:594
@deffn primitive throw key . args
Invoke the catch form matching @var{key}, passing @var{args} to the
@var{handler}.
@@ -6536,14 +4942,438 @@ Invoke the catch form matching @var{key}, passing @var{args} to the
If there is no handler at all, Guile prints an error and then exits.
@end deffn
+ values
+@c snarfed from values.c:77
+@deffn primitive values . args
+Delivers all of its arguments to its continuation. Except for
+continuations created by the @code{call-with-values} procedure,
+all continuations take exactly one value. The effect of
+passing no value or more than one value to continuations that
+were not created by @code{call-with-values} is unspecified.
+@end deffn
+
+ make-variable
+@c snarfed from variable.c:81
+@deffn primitive make-variable init
+Return a variable initialized to value @var{init}.
+@end deffn
+
+ make-undefined-variable
+@c snarfed from variable.c:91
+@deffn primitive make-undefined-variable
+Return a variable that is initially unbound.
+@end deffn
+
+ variable?
+@c snarfed from variable.c:102
+@deffn primitive variable? obj
+Return @code{#t} iff @var{obj} is a variable object, else
+return @code{#f}.
+@end deffn
+
+ variable-ref
+@c snarfed from variable.c:114
+@deffn primitive variable-ref var
+Dereference @var{var} and return its value.
+@var{var} must be a variable object; see @code{make-variable}
+and @code{make-undefined-variable}.
+@end deffn
+
+ variable-set!
+@c snarfed from variable.c:130
+@deffn primitive variable-set! var val
+Set the value of the variable @var{var} to @var{val}.
+@var{var} must be a variable object, @var{val} can be any
+value. Return an unspecified value.
+@end deffn
+
+ variable-bound?
+@c snarfed from variable.c:142
+@deffn primitive variable-bound? var
+Return @code{#t} iff @var{var} is bound to a value.
+Throws an error if @var{var} is not a variable object.
+@end deffn
+
+ vector?
+@c snarfed from vectors.c:58
+@deffn primitive vector? obj
+Return @code{#t} if @var{obj} is a vector, otherwise return
+@code{#f}.
+@end deffn
+
+ list->vector
+@c snarfed from vectors.c:75
+@deffn primitive list->vector
+implemented by the C function "scm_vector"
+@end deffn
+
+ vector
+@c snarfed from vectors.c:92
+@deffn primitive vector . l
+@deffnx primitive list->vector l
+Return a newly allocated vector whose elements contain the
+given arguments. Analogous to @code{list}.
+
+@lisp
+(vector 'a 'b 'c) @result{} #(a b c)
+@end lisp
+@end deffn
+
+ make-vector
+@c snarfed from vectors.c:178
+@deffn primitive make-vector k [fill]
+Return a newly allocated vector of @var{k} elements. If a
+second argument is given, then each element is initialized to
+@var{fill}. Otherwise the initial contents of each element is
+unspecified.
+@end deffn
+
+ vector->list
+@c snarfed from vectors.c:235
+@deffn primitive vector->list v
+Return a newly allocated list of the objects contained in the
+elements of @var{vector}.
+
+@lisp
+(vector->list '#(dah dah didah)) @result{} (dah dah didah)
+(list->vector '(dididit dah)) @result{} #(dididit dah)
+@end lisp
+@end deffn
+
+ vector-fill!
+@c snarfed from vectors.c:252
+@deffn primitive vector-fill! v fill
+Store @var{fill} in every element of @var{vector}. The value
+returned by @code{vector-fill!} is unspecified.
+@end deffn
+
+ vector-move-left!
+@c snarfed from vectors.c:279
+@deffn primitive vector-move-left! vec1 start1 end1 vec2 start2
+Vector version of @code{substring-move-left!}.
+@end deffn
+
+ vector-move-right!
+@c snarfed from vectors.c:302
+@deffn primitive vector-move-right! vec1 start1 end1 vec2 start2
+Vector version of @code{substring-move-right!}.
+@end deffn
+
+ major-version
+@c snarfed from version.c:59
+@deffn primitive major-version
+Return a string containing Guile's major version number.
+E.g., the 1 in "1.6.5".
+@end deffn
+
+ minor-version
+@c snarfed from version.c:72
+@deffn primitive minor-version
+Return a string containing Guile's minor version number.
+E.g., the 6 in "1.6.5".
+@end deffn
+
+ micro-version
+@c snarfed from version.c:85
+@deffn primitive micro-version
+Return a string containing Guile's micro version number.
+E.g., the 5 in "1.6.5".
+@end deffn
+
+ version
+@c snarfed from version.c:105
+@deffn primitive version
+@deffnx primitive major-version
+@deffnx primitive minor-version
+Return a string describing Guile's version number, or its major or minor
+version numbers, respectively.
+
+@lisp
+(version) @result{} "1.3a"
+(major-version) @result{} "1"
+(minor-version) @result{} "3a"
+@end lisp
+@end deffn
+
+ make-soft-port
+@c snarfed from vports.c:185
+@deffn primitive make-soft-port pv modes
+Return a port capable of receiving or delivering characters as
+specified by the @var{modes} string (@pxref{File Ports,
+open-file}). @var{pv} must be a vector of length 5. Its
+components are as follows:
+
+@enumerate 0
+@item
+procedure accepting one character for output
+@item
+procedure accepting a string for output
+@item
+thunk for flushing output
+@item
+thunk for getting one character
+@item
+thunk for closing port (not by garbage collection)
+@end enumerate
+
+For an output-only port only elements 0, 1, 2, and 4 need be
+procedures. For an input-only port only elements 3 and 4 need
+be procedures. Thunks 2 and 4 can instead be @code{#f} if
+there is no useful operation for them to perform.
+
+If thunk 3 returns @code{#f} or an @code{eof-object}
+(@pxref{Input, eof-object?, ,r5rs, The Revised^5 Report on
+Scheme}) it indicates that the port has reached end-of-file.
+For example:
+
+@lisp
+(define stdout (current-output-port))
+(define p (make-soft-port
+ (vector
+ (lambda (c) (write c stdout))
+ (lambda (s) (display s stdout))
+ (lambda () (display "." stdout))
+ (lambda () (char-upcase (read-char)))
+ (lambda () (display "@@" stdout)))
+ "rw"))
+
+(write p p) @result{} #<input-output: soft 8081e20>
+@end lisp
+@end deffn
+
+ make-weak-vector
+@c snarfed from weaks.c:115
+@deffn primitive make-weak-vector size [fill]
+Return a weak vector with @var{size} elements. If the optional
+argument @var{fill} is given, all entries in the vector will be
+set to @var{fill}. The default value for @var{fill} is the
+empty list.
+@end deffn
+
+ list->weak-vector
+@c snarfed from weaks.c:123
+@deffn primitive list->weak-vector
+implemented by the C function "scm_weak_vector"
+@end deffn
+
+ weak-vector
+@c snarfed from weaks.c:131
+@deffn primitive weak-vector . l
+@deffnx primitive list->weak-vector l
+Construct a weak vector from a list: @code{weak-vector} uses
+the list of its arguments while @code{list->weak-vector} uses
+its only argument @var{l} (a list) to construct a weak vector
+the same way @code{list->vector} would.
+@end deffn
+
+ weak-vector?
+@c snarfed from weaks.c:159
+@deffn primitive weak-vector? obj
+Return @code{#t} if @var{obj} is a weak vector. Note that all
+weak hashes are also weak vectors.
+@end deffn
+
+ make-weak-key-hash-table
+@c snarfed from weaks.c:177
+@deffn primitive make-weak-key-hash-table size
+@deffnx primitive make-weak-value-hash-table size
+@deffnx primitive make-doubly-weak-hash-table size
+Return a weak hash table with @var{size} buckets. As with any
+hash table, choosing a good size for the table requires some
+caution.
+
+You can modify weak hash tables in exactly the same way you
+would modify regular hash tables. (@pxref{Hash Tables})
+@end deffn
+
+ make-weak-value-hash-table
+@c snarfed from weaks.c:188
+@deffn primitive make-weak-value-hash-table size
+Return a hash table with weak values with @var{size} buckets.
+(@pxref{Hash Tables})
+@end deffn
+
+ make-doubly-weak-hash-table
+@c snarfed from weaks.c:199
+@deffn primitive make-doubly-weak-hash-table size
+Return a hash table with weak keys and values with @var{size}
+buckets. (@pxref{Hash Tables})
+@end deffn
+
+ weak-key-hash-table?
+@c snarfed from weaks.c:213
+@deffn primitive weak-key-hash-table? obj
+@deffnx primitive weak-value-hash-table? obj
+@deffnx primitive doubly-weak-hash-table? obj
+Return @code{#t} if @var{obj} is the specified weak hash
+table. Note that a doubly weak hash table is neither a weak key
+nor a weak value hash table.
+@end deffn
+
+ weak-value-hash-table?
+@c snarfed from weaks.c:223
+@deffn primitive weak-value-hash-table? obj
+Return @code{#t} if @var{obj} is a weak value hash table.
+@end deffn
+
+ doubly-weak-hash-table?
+@c snarfed from weaks.c:233
+@deffn primitive doubly-weak-hash-table? obj
+Return @code{#t} if @var{obj} is a doubly weak hash table.
+@end deffn
+
+ regexp?
+@c snarfed from regex-posix.c:137
+@deffn primitive regexp? obj
+Return @code{#t} if @var{obj} is a compiled regular expression,
+or @code{#f} otherwise.
+@end deffn
+
+ make-regexp
+@c snarfed from regex-posix.c:182
+@deffn primitive make-regexp pat . flags
+Compile the regular expression described by @var{pat}, and
+return the compiled regexp structure. If @var{pat} does not
+describe a legal regular expression, @code{make-regexp} throws
+a @code{regular-expression-syntax} error.
+
+The @var{flags} arguments change the behavior of the compiled
+regular expression. The following flags may be supplied:
+
+@table @code
+@item regexp/icase
+Consider uppercase and lowercase letters to be the same when
+matching.
+@item regexp/newline
+If a newline appears in the target string, then permit the
+@samp{^} and @samp{$} operators to match immediately after or
+immediately before the newline, respectively. Also, the
+@samp{.} and @samp{[^...]} operators will never match a newline
+character. The intent of this flag is to treat the target
+string as a buffer containing many lines of text, and the
+regular expression as a pattern that may match a single one of
+those lines.
+@item regexp/basic
+Compile a basic (``obsolete'') regexp instead of the extended
+(``modern'') regexps that are the default. Basic regexps do
+not consider @samp{|}, @samp{+} or @samp{?} to be special
+characters, and require the @samp{@{...@}} and @samp{(...)}
+metacharacters to be backslash-escaped (@pxref{Backslash
+Escapes}). There are several other differences between basic
+and extended regular expressions, but these are the most
+significant.
+@item regexp/extended
+Compile an extended regular expression rather than a basic
+regexp. This is the default behavior; this flag will not
+usually be needed. If a call to @code{make-regexp} includes
+both @code{regexp/basic} and @code{regexp/extended} flags, the
+one which comes last will override the earlier one.
+@end table
+@end deffn
+
+ regexp-exec
+@c snarfed from regex-posix.c:243
+@deffn primitive regexp-exec rx str [start [flags]]
+Match the compiled regular expression @var{rx} against
+@code{str}. If the optional integer @var{start} argument is
+provided, begin matching from that position in the string.
+Return a match structure describing the results of the match,
+or @code{#f} if no match could be found.
+
+The @var{flags} arguments change the matching behavior.
+The following flags may be supplied:
+
+@table @code
+@item regexp/notbol
+Operator @samp{^} always fails (unless @code{regexp/newline}
+is used). Use this when the beginning of the string should
+not be considered the beginning of a line.
+@item regexp/noteol
+Operator @samp{$} always fails (unless @code{regexp/newline}
+is used). Use this when the end of the string should not be
+considered the end of a line.
+@end table
+@end deffn
+
+ array-fill!
+@c snarfed from ramap.c:462
+@deffn primitive array-fill! ra fill
+Stores @var{fill} in every element of @var{array}. The value returned
+is unspecified.
+@end deffn
+
+ array-copy-in-order!
+@c snarfed from ramap.c:827
+@deffn primitive array-copy-in-order!
+implemented by the C function "scm_array_copy_x"
+@end deffn
+
+ array-copy!
+@c snarfed from ramap.c:836
+@deffn primitive array-copy! src dst
+@deffnx primitive array-copy-in-order! src dst
+Copies every element from vector or array @var{source} to the
+corresponding element of @var{destination}. @var{destination} must have
+the same rank as @var{source}, and be at least as large in each
+dimension. The order is unspecified.
+@end deffn
+
+ array-map-in-order!
+@c snarfed from ramap.c:1510
+@deffn primitive array-map-in-order!
+implemented by the C function "scm_array_map_x"
+@end deffn
+
+ array-map!
+@c snarfed from ramap.c:1521
+@deffn primitive array-map! ra0 proc . lra
+@deffnx primitive array-map-in-order! ra0 proc . lra
+@var{array1}, @dots{} must have the same number of dimensions as
+@var{array0} and have a range for each index which includes the range
+for the corresponding index in @var{array0}. @var{proc} is applied to
+each tuple of elements of @var{array1} @dots{} and the result is stored
+as the corresponding element in @var{array0}. The value returned is
+unspecified. The order of application is unspecified.
+@end deffn
+
+ array-for-each
+@c snarfed from ramap.c:1668
+@deffn primitive array-for-each proc ra0 . lra
+@var{proc} is applied to each tuple of elements of @var{array0} @dots{}
+in row-major order. The value returned is unspecified.
+@end deffn
+
+ array-index-map!
+@c snarfed from ramap.c:1696
+@deffn primitive array-index-map! ra proc
+applies @var{proc} to the indices of each element of @var{array} in
+turn, storing the result in the corresponding element. The value
+returned and the order of application are unspecified.
+
+One can implement @var{array-indexes} as
+@lisp
+(define (array-indexes array)
+ (let ((ra (apply make-array #f (array-shape array))))
+ (array-index-map! ra (lambda x x))
+ ra))
+@end lisp
+Another example:
+@lisp
+(define (apl:index-generator n)
+ (let ((v (make-uniform-vector n 1)))
+ (array-index-map! v (lambda (i) i))
+ v))
+@end lisp
+@end deffn
+
uniform-vector-length
-@c snarfed from unif.c:255
+@c snarfed from unif.c:257
@deffn primitive uniform-vector-length v
Return the number of elements in @var{uve}.
@end deffn
array?
-@c snarfed from unif.c:289
+@c snarfed from unif.c:291
@deffn primitive array? v [prot]
Return @code{#t} if the @var{obj} is an array, and @code{#f} if
not. The @var{prototype} argument is used with uniform arrays
@@ -6551,14 +5381,14 @@ and is described elsewhere.
@end deffn
array-rank
-@c snarfed from unif.c:360
+@c snarfed from unif.c:362
@deffn primitive array-rank ra
Return the number of dimensions of @var{obj}. If @var{obj} is
not an array, @code{0} is returned.
@end deffn
array-dimensions
-@c snarfed from unif.c:398
+@c snarfed from unif.c:400
@deffn primitive array-dimensions ra
@code{Array-dimensions} is similar to @code{array-shape} but replaces
elements with a @code{0} minimum with one greater than the maximum. So:
@@ -6568,25 +5398,25 @@ elements with a @code{0} minimum with one greater than the maximum. So:
@end deffn
shared-array-root
-@c snarfed from unif.c:445
+@c snarfed from unif.c:447
@deffn primitive shared-array-root ra
Return the root vector of a shared array.
@end deffn
shared-array-offset
-@c snarfed from unif.c:456
+@c snarfed from unif.c:458
@deffn primitive shared-array-offset ra
Return the root vector index of the first element in the array.
@end deffn
shared-array-increments
-@c snarfed from unif.c:467
+@c snarfed from unif.c:469
@deffn primitive shared-array-increments ra
For each dimension, return the distance between elements in the root vector.
@end deffn
dimensions->uniform-array
-@c snarfed from unif.c:586
+@c snarfed from unif.c:589
@deffn primitive dimensions->uniform-array dims prot [fill]
@deffnx primitive make-uniform-vector length prototype [fill]
Create and return a uniform array or vector of type
@@ -6596,7 +5426,7 @@ fill the array, otherwise @var{prototype} is used.
@end deffn
make-shared-array
-@c snarfed from unif.c:672
+@c snarfed from unif.c:678
@deffn primitive make-shared-array oldra mapfunc . dims
@code{make-shared-array} can be used to create shared subarrays of other
arrays. The @var{mapper} is a function that translates coordinates in
@@ -6616,7 +5446,7 @@ it can be otherwise arbitrary. A simple example:
@end deffn
transpose-array
-@c snarfed from unif.c:804
+@c snarfed from unif.c:810
@deffn primitive transpose-array ra . args
Return an array sharing contents with @var{array}, but with
dimensions arranged in a different order. There must be one
@@ -6640,7 +5470,7 @@ have smaller rank than @var{array}.
@end deffn
enclose-array
-@c snarfed from unif.c:913
+@c snarfed from unif.c:919
@deffn primitive enclose-array ra . axes
@var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than
the rank of @var{array}. @var{enclose-array} returns an array
@@ -6666,20 +5496,20 @@ examples:
@end deffn
array-in-bounds?
-@c snarfed from unif.c:997
+@c snarfed from unif.c:1003
@deffn primitive array-in-bounds? v . args
Return @code{#t} if its arguments would be acceptable to
@code{array-ref}.
@end deffn
array-ref
-@c snarfed from unif.c:1076
+@c snarfed from unif.c:1082
@deffn primitive array-ref
-scm_uniform_vector_ref
+implemented by the C function "scm_uniform_vector_ref"
@end deffn
uniform-vector-ref
-@c snarfed from unif.c:1083
+@c snarfed from unif.c:1089
@deffn primitive uniform-vector-ref v args
@deffnx primitive array-ref v . args
Return the element at the @code{(index1, index2)} element in
@@ -6687,13 +5517,13 @@ Return the element at the @code{(index1, index2)} element in
@end deffn
uniform-array-set1!
-@c snarfed from unif.c:1252
+@c snarfed from unif.c:1258
@deffn primitive uniform-array-set1!
-scm_array_set_x
+implemented by the C function "scm_array_set_x"
@end deffn
array-set!
-@c snarfed from unif.c:1261
+@c snarfed from unif.c:1267
@deffn primitive array-set! v obj . args
@deffnx primitive uniform-array-set1! v obj args
Sets the element at the @code{(index1, index2)} element in @var{array} to
@@ -6701,7 +5531,7 @@ Sets the element at the @code{(index1, index2)} element in @var{array} to
@end deffn
array-contents
-@c snarfed from unif.c:1376
+@c snarfed from unif.c:1383
@deffn primitive array-contents ra [strict]
@deffnx primitive array-contents array strict
If @var{array} may be @dfn{unrolled} into a one dimensional shared array
@@ -6717,7 +5547,7 @@ memory.
@end deffn
uniform-array-read!
-@c snarfed from unif.c:1490
+@c snarfed from unif.c:1497
@deffn primitive uniform-array-read! ra [port_or_fd [start [end]]]
@deffnx primitive uniform-vector-read! uve [port-or-fdes] [start] [end]
Attempts to read all elements of @var{ura}, in lexicographic order, as
@@ -6737,7 +5567,7 @@ returned by @code{(current-input-port)}.
@end deffn
uniform-array-write
-@c snarfed from unif.c:1653
+@c snarfed from unif.c:1662
@deffn primitive uniform-array-write v [port_or_fd [start [end]]]
@deffnx primitive uniform-vector-write uve [port-or-fdes] [start] [end]
Writes all elements of @var{ura} as binary objects to
@@ -6754,14 +5584,14 @@ omitted, in which case it defaults to the value returned by
@end deffn
bit-count
-@c snarfed from unif.c:1778
+@c snarfed from unif.c:1789
@deffn primitive bit-count b bitvector
Return the number of occurrences of the boolean @var{b} in
@var{bitvector}.
@end deffn
bit-position
-@c snarfed from unif.c:1817
+@c snarfed from unif.c:1828
@deffn primitive bit-position item v k
Return the minimum index of an occurrence of @var{bool} in
@var{bv} which is at least @var{k}. If no @var{bool} occurs
@@ -6769,7 +5599,7 @@ within the specified range @code{#f} is returned.
@end deffn
bit-set*!
-@c snarfed from unif.c:1885
+@c snarfed from unif.c:1896
@deffn primitive bit-set*! v kv obj
If uve is a bit-vector @var{bv} and uve must be of the same
length. If @var{bool} is @code{#t}, uve is OR'ed into
@@ -6783,7 +5613,7 @@ of @var{bv} corresponding to the indexes in uve are set to
@end deffn
bit-count*
-@c snarfed from unif.c:1939
+@c snarfed from unif.c:1950
@deffn primitive bit-count* v kv obj
Return
@lisp
@@ -6793,20 +5623,20 @@ Return
@end deffn
bit-invert!
-@c snarfed from unif.c:2003
+@c snarfed from unif.c:2014
@deffn primitive bit-invert! v
Modifies @var{bv} by replacing each element with its negation.
@end deffn
array->list
-@c snarfed from unif.c:2082
+@c snarfed from unif.c:2093
@deffn primitive array->list v
Return a list consisting of all the elements, in order, of
@var{array}.
@end deffn
list->uniform-array
-@c snarfed from unif.c:2183
+@c snarfed from unif.c:2194
@deffn primitive list->uniform-array ndim prot lst
@deffnx procedure list->uniform-vector prot lst
Return a uniform array of the type indicated by prototype
@@ -6816,298 +5646,1484 @@ done.
@end deffn
array-prototype
-@c snarfed from unif.c:2534
+@c snarfed from unif.c:2545
@deffn primitive array-prototype ra
Return an object that would produce an array of the same type
as @var{array}, if used as the @var{prototype} for
@code{make-uniform-array}.
@end deffn
- values
-@c snarfed from values.c:80
-@deffn primitive values . args
-Delivers all of its arguments to its continuation. Except for
-continuations created by the @code{call-with-values} procedure,
-all continuations take exactly one value. The effect of
-passing no value or more than one value to continuations that
-were not created by @code{call-with-values} is unspecified.
+ chown
+@c snarfed from filesys.c:170
+@deffn primitive chown object owner group
+Change the ownership and group of the file referred to by @var{object} to
+the integer values @var{owner} and @var{group}. @var{object} can be
+a string containing a file name or, if the platform
+supports fchown, a port or integer file descriptor
+which is open on the file. The return value
+is unspecified.
+
+If @var{object} is a symbolic link, either the
+ownership of the link or the ownership of the referenced file will be
+changed depending on the operating system (lchown is
+unsupported at present). If @var{owner} or @var{group} is specified
+as @code{-1}, then that ID is not changed.
@end deffn
- make-variable
-@c snarfed from variable.c:99
-@deffn primitive make-variable init [name_hint]
-Return a variable object initialized to value @var{init}.
-If given, uses @var{name-hint} as its internal (debugging)
-name, otherwise just treat it as an anonymous variable.
-Remember, of course, that multiple bindings to the same
-variable may exist, so @var{name-hint} is just that---a hint.
+ chmod
+@c snarfed from filesys.c:210
+@deffn primitive chmod object mode
+Changes the permissions of the file referred to by @var{obj}.
+@var{obj} can be a string containing a file name or a port or integer file
+descriptor which is open on a file (in which case @code{fchmod} is used
+as the underlying system call).
+@var{mode} specifies
+the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}.
+The return value is unspecified.
@end deffn
- make-undefined-variable
-@c snarfed from variable.c:119
-@deffn primitive make-undefined-variable [name_hint]
-Return a variable object initialized to an undefined value.
-If given, uses @var{name-hint} as its internal (debugging)
-name, otherwise just treat it as an anonymous variable.
-Remember, of course, that multiple bindings to the same
-variable may exist, so @var{name-hint} is just that---a hint.
+ umask
+@c snarfed from filesys.c:243
+@deffn primitive umask [mode]
+If @var{mode} is omitted, retuns a decimal number representing the current
+file creation mask. Otherwise the file creation mask is set to
+@var{mode} and the previous value is returned.
+
+E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.
@end deffn
- variable?
-@c snarfed from variable.c:136
-@deffn primitive variable? obj
-Return @code{#t} iff @var{obj} is a variable object, else
-return @code{#f}
+ open-fdes
+@c snarfed from filesys.c:266
+@deffn primitive open-fdes path flags [mode]
+Similar to @code{open} but return a file descriptor instead of
+a port.
@end deffn
- variable-ref
-@c snarfed from variable.c:148
-@deffn primitive variable-ref var
-Dereference @var{var} and return its value.
-@var{var} must be a variable object; see @code{make-variable}
-and @code{make-undefined-variable}.
+ open
+@c snarfed from filesys.c:308
+@deffn primitive open path flags [mode]
+Open the file named by @var{path} for reading and/or writing.
+@var{flags} is an integer specifying how the file should be opened.
+@var{mode} is an integer specifying the permission bits of the file, if
+it needs to be created, before the umask is applied. The default is 666
+(Unix itself has no default).
+
+@var{flags} can be constructed by combining variables using @code{logior}.
+Basic flags are:
+
+@defvar O_RDONLY
+Open the file read-only.
+@end defvar
+@defvar O_WRONLY
+Open the file write-only.
+@end defvar
+@defvar O_RDWR
+Open the file read/write.
+@end defvar
+@defvar O_APPEND
+Append to the file instead of truncating.
+@end defvar
+@defvar O_CREAT
+Create the file if it does not already exist.
+@end defvar
+
+See the Unix documentation of the @code{open} system call
+for additional flags.
@end deffn
- variable-set!
-@c snarfed from variable.c:162
-@deffn primitive variable-set! var val
-Set the value of the variable @var{var} to @var{val}.
-@var{var} must be a variable object, @var{val} can be any
-value. Return an unspecified value.
+ close
+@c snarfed from filesys.c:346
+@deffn primitive close fd_or_port
+Similar to close-port (@pxref{Generic Port Operations, close-port}),
+but also works on file descriptors. A side
+effect of closing a file descriptor is that any ports using that file
+descriptor are moved to a different file descriptor and have
+their revealed counts set to zero.
@end deffn
- builtin-variable
-@c snarfed from variable.c:176
-@deffn primitive builtin-variable name
-Return the built-in variable with the name @var{name}.
-@var{name} must be a symbol (not a string).
-Then use @code{variable-ref} to access its value.
+ close-fdes
+@c snarfed from filesys.c:374
+@deffn primitive close-fdes fd
+A simple wrapper for the @code{close} system call.
+Close file descriptor @var{fd}, which must be an integer.
+Unlike close (@pxref{Ports and File Descriptors, close}),
+the file descriptor will be closed even if a port is using it.
+The return value is unspecified.
@end deffn
- variable-bound?
-@c snarfed from variable.c:204
-@deffn primitive variable-bound? var
-Return @code{#t} iff @var{var} is bound to a value.
-Throws an error if @var{var} is not a variable object.
+ stat
+@c snarfed from filesys.c:577
+@deffn primitive stat object
+Return an object containing various information about the file
+determined by @var{obj}. @var{obj} can be a string containing
+a file name or a port or integer file descriptor which is open
+on a file (in which case @code{fstat} is used as the underlying
+system call).
+
+The object returned by @code{stat} can be passed as a single
+parameter to the following procedures, all of which return
+integers:
+
+@table @code
+@item stat:dev
+The device containing the file.
+@item stat:ino
+The file serial number, which distinguishes this file from all
+other files on the same device.
+@item stat:mode
+The mode of the file. This includes file type information and
+the file permission bits. See @code{stat:type} and
+@code{stat:perms} below.
+@item stat:nlink
+The number of hard links to the file.
+@item stat:uid
+The user ID of the file's owner.
+@item stat:gid
+The group ID of the file.
+@item stat:rdev
+Device ID; this entry is defined only for character or block
+special files.
+@item stat:size
+The size of a regular file in bytes.
+@item stat:atime
+The last access time for the file.
+@item stat:mtime
+The last modification time for the file.
+@item stat:ctime
+The last modification time for the attributes of the file.
+@item stat:blksize
+The optimal block size for reading or writing the file, in
+bytes.
+@item stat:blocks
+The amount of disk space that the file occupies measured in
+units of 512 byte blocks.
+@end table
+
+In addition, the following procedures return the information
+from stat:mode in a more convenient form:
+
+@table @code
+@item stat:type
+A symbol representing the type of file. Possible values are
+regular, directory, symlink, block-special, char-special, fifo,
+socket and unknown
+@item stat:perms
+An integer representing the access permission bits.
+@end table
@end deffn
- vector?
-@c snarfed from vectors.c:142
-@deffn primitive vector? obj
-Return @code{#t} if @var{obj} is a vector, otherwise return
-@code{#f}.
+ link
+@c snarfed from filesys.c:640
+@deffn primitive link oldpath newpath
+Creates a new name @var{newpath} in the file system for the
+file named by @var{oldpath}. If @var{oldpath} is a symbolic
+link, the link may or may not be followed depending on the
+system.
@end deffn
- list->vector
-@c snarfed from vectors.c:161
-@deffn primitive list->vector
-scm_vector
+ rename-file
+@c snarfed from filesys.c:661
+@deffn primitive rename-file oldname newname
+Renames the file specified by @var{oldname} to @var{newname}.
+The return value is unspecified.
@end deffn
- vector
-@c snarfed from vectors.c:178
-@deffn primitive vector . l
-@deffnx primitive list->vector l
-Return a newly allocated vector whose elements contain the
-given arguments. Analogous to @code{list}.
+ delete-file
+@c snarfed from filesys.c:688
+@deffn primitive delete-file str
+Deletes (or "unlinks") the file specified by @var{path}.
+@end deffn
+
+ mkdir
+@c snarfed from filesys.c:706
+@deffn primitive mkdir path [mode]
+Create a new directory named by @var{path}. If @var{mode} is omitted
+then the permissions of the directory file are set using the current
+umask. Otherwise they are set to the decimal value specified with
+@var{mode}. The return value is unspecified.
+@end deffn
+
+ rmdir
+@c snarfed from filesys.c:734
+@deffn primitive rmdir path
+Remove the existing directory named by @var{path}. The directory must
+be empty for this to succeed. The return value is unspecified.
+@end deffn
+
+ directory-stream?
+@c snarfed from filesys.c:759
+@deffn primitive directory-stream? obj
+Return a boolean indicating whether @var{object} is a directory
+stream as returned by @code{opendir}.
+@end deffn
+
+ opendir
+@c snarfed from filesys.c:770
+@deffn primitive opendir dirname
+Open the directory specified by @var{path} and return a directory
+stream.
+@end deffn
+
+ readdir
+@c snarfed from filesys.c:787
+@deffn primitive readdir port
+Return (as a string) the next directory entry from the directory stream
+@var{stream}. If there is no remaining entry to be read then the
+end of file object is returned.
+@end deffn
+
+ rewinddir
+@c snarfed from filesys.c:810
+@deffn primitive rewinddir port
+Reset the directory port @var{stream} so that the next call to
+@code{readdir} will return the first directory entry.
+@end deffn
+
+ closedir
+@c snarfed from filesys.c:827
+@deffn primitive closedir port
+Close the directory stream @var{stream}.
+The return value is unspecified.
+@end deffn
+
+ chdir
+@c snarfed from filesys.c:877
+@deffn primitive chdir str
+Change the current working directory to @var{path}.
+The return value is unspecified.
+@end deffn
+
+ getcwd
+@c snarfed from filesys.c:893
+@deffn primitive getcwd
+Return the name of the current working directory.
+@end deffn
+
+ select
+@c snarfed from filesys.c:1089
+@deffn primitive select reads writes excepts [secs [usecs]]
+This procedure has a variety of uses: waiting for the ability
+to provide input, accept output, or the existance of
+exceptional conditions on a collection of ports or file
+descriptors, or waiting for a timeout to occur.
+It also returns if interrupted by a signal.
+
+@var{reads}, @var{writes} and @var{excepts} can be lists or
+vectors, with each member a port or a file descriptor.
+The value returned is a list of three corresponding
+lists or vectors containing only the members which meet the
+specified requirement. The ability of port buffers to
+provide input or accept output is taken into account.
+Ordering of the input lists or vectors is not preserved.
+
+The optional arguments @var{secs} and @var{usecs} specify the
+timeout. Either @var{secs} can be specified alone, as
+either an integer or a real number, or both @var{secs} and
+@var{usecs} can be specified as integers, in which case
+@var{usecs} is an additional timeout expressed in
+microseconds. If @var{secs} is omitted or is @code{#f} then
+select will wait for as long as it takes for one of the other
+conditions to be satisfied.
+
+The scsh version of @code{select} differs as follows:
+Only vectors are accepted for the first three arguments.
+The @var{usecs} argument is not supported.
+Multiple values are returned instead of a list.
+Duplicates in the input vectors appear only once in output.
+An additional @code{select!} interface is provided.
+@end deffn
+
+ fcntl
+@c snarfed from filesys.c:1235
+@deffn primitive fcntl object cmd [value]
+Apply @var{command} to the specified file descriptor or the underlying
+file descriptor of the specified port. @var{value} is an optional
+integer argument.
+
+Values for @var{command} are:
+
+@table @code
+@item F_DUPFD
+Duplicate a file descriptor
+@item F_GETFD
+Get flags associated with the file descriptor.
+@item F_SETFD
+Set flags associated with the file descriptor to @var{value}.
+@item F_GETFL
+Get flags associated with the open file.
+@item F_SETFL
+Set flags associated with the open file to @var{value}
+@item F_GETOWN
+Get the process ID of a socket's owner, for @code{SIGIO} signals.
+@item F_SETOWN
+Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.
+@item FD_CLOEXEC
+The value used to indicate the "close on exec" flag with @code{F_GETFL} or
+@code{F_SETFL}.
+@end table
+@end deffn
+
+ fsync
+@c snarfed from filesys.c:1272
+@deffn primitive fsync object
+Copies any unwritten data for the specified output file descriptor to disk.
+If @var{port/fd} is a port, its buffer is flushed before the underlying
+file descriptor is fsync'd.
+The return value is unspecified.
+@end deffn
+
+ symlink
+@c snarfed from filesys.c:1299
+@deffn primitive symlink oldpath newpath
+Create a symbolic link named @var{path-to} with the value (i.e., pointing to)
+@var{path-from}. The return value is unspecified.
+@end deffn
+
+ readlink
+@c snarfed from filesys.c:1318
+@deffn primitive readlink path
+Return the value of the symbolic link named by @var{path} (a
+string), i.e., the file that the link points to.
+@end deffn
+
+ lstat
+@c snarfed from filesys.c:1347
+@deffn primitive lstat str
+Similar to @code{stat}, but does not follow symbolic links, i.e.,
+it will return information about a symbolic link itself, not the
+file it points to. @var{path} must be a string.
+@end deffn
+
+ copy-file
+@c snarfed from filesys.c:1371
+@deffn primitive copy-file oldfile newfile
+Copy the file specified by @var{path-from} to @var{path-to}.
+The return value is unspecified.
+@end deffn
+
+ dirname
+@c snarfed from filesys.c:1416
+@deffn primitive dirname filename
+Return the directory name component of the file name
+@var{filename}. If @var{filename} does not contain a directory
+component, @code{.} is returned.
+@end deffn
+
+ basename
+@c snarfed from filesys.c:1459
+@deffn primitive basename filename [suffix]
+Return the base name of the file name @var{filename}. The
+base name is the file name without any directory components.
+If @var{suffix} is privided, and is equal to the end of
+@var{basename}, it is removed also.
+@end deffn
+
+ pipe
+@c snarfed from posix.c:200
+@deffn primitive pipe
+Return a newly created pipe: a pair of ports which are linked
+together on the local machine. The @emph{car} is the input
+port and the @emph{cdr} is the output port. Data written (and
+flushed) to the output port can be read from the input port.
+Pipes are commonly used for communication with a newly forked
+child process. The need to flush the output port can be
+avoided by making it unbuffered using @code{setvbuf}.
+
+Writes occur atomically provided the size of the data in bytes
+is not greater than the value of @code{PIPE_BUF}. Note that
+the output port is likely to block if too much data (typically
+equal to @code{PIPE_BUF}) has been written but not yet read
+from the input port.
+@end deffn
+
+ getgroups
+@c snarfed from posix.c:221
+@deffn primitive getgroups
+Return a vector of integers representing the current
+supplimentary group IDs.
+@end deffn
+
+ getpw
+@c snarfed from posix.c:254
+@deffn primitive getpw [user]
+Look up an entry in the user database. @var{obj} can be an integer,
+a string, or omitted, giving the behaviour of getpwuid, getpwnam
+or getpwent respectively.
+@end deffn
+
+ setpw
+@c snarfed from posix.c:307
+@deffn primitive setpw [arg]
+If called with a true argument, initialize or reset the password data
+stream. Otherwise, close the stream. The @code{setpwent} and
+@code{endpwent} procedures are implemented on top of this.
+@end deffn
+
+ getgr
+@c snarfed from posix.c:326
+@deffn primitive getgr [name]
+Look up an entry in the group database. @var{obj} can be an integer,
+a string, or omitted, giving the behaviour of getgrgid, getgrnam
+or getgrent respectively.
+@end deffn
+
+ setgr
+@c snarfed from posix.c:366
+@deffn primitive setgr [arg]
+If called with a true argument, initialize or reset the group data
+stream. Otherwise, close the stream. The @code{setgrent} and
+@code{endgrent} procedures are implemented on top of this.
+@end deffn
+
+ kill
+@c snarfed from posix.c:402
+@deffn primitive kill pid sig
+Sends a signal to the specified process or group of processes.
+
+@var{pid} specifies the processes to which the signal is sent:
+
+@table @r
+@item @var{pid} greater than 0
+The process whose identifier is @var{pid}.
+@item @var{pid} equal to 0
+All processes in the current process group.
+@item @var{pid} less than -1
+The process group whose identifier is -@var{pid}
+@item @var{pid} equal to -1
+If the process is privileged, all processes except for some special
+system processes. Otherwise, all processes with the current effective
+user ID.
+@end table
+
+@var{sig} should be specified using a variable corresponding to
+the Unix symbolic name, e.g.,
+
+@defvar SIGHUP
+Hang-up signal.
+@end defvar
+
+@defvar SIGINT
+Interrupt signal.
+@end defvar
+@end deffn
+
+ waitpid
+@c snarfed from posix.c:455
+@deffn primitive waitpid pid [options]
+This procedure collects status information from a child process which
+has terminated or (optionally) stopped. Normally it will
+suspend the calling process until this can be done. If more than one
+child process is eligible then one will be chosen by the operating system.
+
+The value of @var{pid} determines the behaviour:
+
+@table @r
+@item @var{pid} greater than 0
+Request status information from the specified child process.
+@item @var{pid} equal to -1 or WAIT_ANY
+Request status information for any child process.
+@item @var{pid} equal to 0 or WAIT_MYPGRP
+Request status information for any child process in the current process
+group.
+@item @var{pid} less than -1
+Request status information for any child process whose process group ID
+is -@var{PID}.
+@end table
+
+The @var{options} argument, if supplied, should be the bitwise OR of the
+values of zero or more of the following variables:
+
+@defvar WNOHANG
+Return immediately even if there are no child processes to be collected.
+@end defvar
+
+@defvar WUNTRACED
+Report status information for stopped processes as well as terminated
+processes.
+@end defvar
+
+The return value is a pair containing:
+
+@enumerate
+@item
+The process ID of the child process, or 0 if @code{WNOHANG} was
+specified and no process was collected.
+@item
+The integer status value.
+@end enumerate
+@end deffn
+
+ status:exit-val
+@c snarfed from posix.c:483
+@deffn primitive status:exit-val status
+Return the exit status value, as would be set if a process
+ended normally through a call to @code{exit} or @code{_exit},
+if any, otherwise @code{#f}.
+@end deffn
+
+ status:term-sig
+@c snarfed from posix.c:503
+@deffn primitive status:term-sig status
+Return the signal number which terminated the process, if any,
+otherwise @code{#f}.
+@end deffn
+
+ status:stop-sig
+@c snarfed from posix.c:521
+@deffn primitive status:stop-sig status
+Return the signal number which stopped the process, if any,
+otherwise @code{#f}.
+@end deffn
+
+ getppid
+@c snarfed from posix.c:541
+@deffn primitive getppid
+Return an integer representing the process ID of the parent
+process.
+@end deffn
+
+ getuid
+@c snarfed from posix.c:553
+@deffn primitive getuid
+Return an integer representing the current real user ID.
+@end deffn
+
+ getgid
+@c snarfed from posix.c:564
+@deffn primitive getgid
+Return an integer representing the current real group ID.
+@end deffn
+
+ geteuid
+@c snarfed from posix.c:578
+@deffn primitive geteuid
+Return an integer representing the current effective user ID.
+If the system does not support effective IDs, then the real ID
+is returned. @code{(feature? 'EIDs)} reports whether the
+system supports effective IDs.
+@end deffn
+
+ getegid
+@c snarfed from posix.c:595
+@deffn primitive getegid
+Return an integer representing the current effective group ID.
+If the system does not support effective IDs, then the real ID
+is returned. @code{(feature? 'EIDs)} reports whether the
+system supports effective IDs.
+@end deffn
+
+ setuid
+@c snarfed from posix.c:611
+@deffn primitive setuid id
+Sets both the real and effective user IDs to the integer @var{id}, provided
+the process has appropriate privileges.
+The return value is unspecified.
+@end deffn
+
+ setgid
+@c snarfed from posix.c:625
+@deffn primitive setgid id
+Sets both the real and effective group IDs to the integer @var{id}, provided
+the process has appropriate privileges.
+The return value is unspecified.
+@end deffn
+
+ seteuid
+@c snarfed from posix.c:641
+@deffn primitive seteuid id
+Sets the effective user ID to the integer @var{id}, provided the process
+has appropriate privileges. If effective IDs are not supported, the
+real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
+system supports effective IDs.
+The return value is unspecified.
+@end deffn
+
+ setegid
+@c snarfed from posix.c:667
+@deffn primitive setegid id
+Sets the effective group ID to the integer @var{id}, provided the process
+has appropriate privileges. If effective IDs are not supported, the
+real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
+system supports effective IDs.
+The return value is unspecified.
+@end deffn
+
+ getpgrp
+@c snarfed from posix.c:691
+@deffn primitive getpgrp
+Return an integer representing the current process group ID.
+This is the POSIX definition, not BSD.
+@end deffn
+
+ setpgid
+@c snarfed from posix.c:709
+@deffn primitive setpgid pid pgid
+Move the process @var{pid} into the process group @var{pgid}. @var{pid} or
+@var{pgid} must be integers: they can be zero to indicate the ID of the
+current process.
+Fails on systems that do not support job control.
+The return value is unspecified.
+@end deffn
+
+ setsid
+@c snarfed from posix.c:728
+@deffn primitive setsid
+Creates a new session. The current process becomes the session leader
+and is put in a new process group. The process will be detached
+from its controlling terminal if it has one.
+The return value is an integer representing the new process group ID.
+@end deffn
+
+ ttyname
+@c snarfed from posix.c:743
+@deffn primitive ttyname port
+Return a string with the name of the serial terminal device
+underlying @var{port}.
+@end deffn
+
+ ctermid
+@c snarfed from posix.c:767
+@deffn primitive ctermid
+Return a string containing the file name of the controlling
+terminal for the current process.
+@end deffn
+
+ tcgetpgrp
+@c snarfed from posix.c:790
+@deffn primitive tcgetpgrp port
+Return the process group ID of the foreground process group
+associated with the terminal open on the file descriptor
+underlying @var{port}.
+
+If there is no foreground process group, the return value is a
+number greater than 1 that does not match the process group ID
+of any existing process group. This can happen if all of the
+processes in the job that was formerly the foreground job have
+terminated, and no other job has yet been moved into the
+foreground.
+@end deffn
+
+ tcsetpgrp
+@c snarfed from posix.c:814
+@deffn primitive tcsetpgrp port pgid
+Set the foreground process group ID for the terminal used by the file
+descriptor underlying @var{port} to the integer @var{pgid}.
+The calling process
+must be a member of the same session as @var{pgid} and must have the same
+controlling terminal. The return value is unspecified.
+@end deffn
+
+ execl
+@c snarfed from posix.c:874
+@deffn primitive execl filename . args
+Executes the file named by @var{path} as a new process image.
+The remaining arguments are supplied to the process; from a C program
+they are accessable as the @code{argv} argument to @code{main}.
+Conventionally the first @var{arg} is the same as @var{path}.
+All arguments must be strings.
+
+If @var{arg} is missing, @var{path} is executed with a null
+argument list, which may have system-dependent side-effects.
+
+This procedure is currently implemented using the @code{execv} system
+call, but we call it @code{execl} because of its Scheme calling interface.
+@end deffn
+
+ execlp
+@c snarfed from posix.c:894
+@deffn primitive execlp filename . args
+Similar to @code{execl}, however if
+@var{filename} does not contain a slash
+then the file to execute will be located by searching the
+directories listed in the @code{PATH} environment variable.
+
+This procedure is currently implemented using the @code{execvp} system
+call, but we call it @code{execlp} because of its Scheme calling interface.
+@end deffn
+
+ execle
+@c snarfed from posix.c:944
+@deffn primitive execle filename env . args
+Similar to @code{execl}, but the environment of the new process is
+specified by @var{env}, which must be a list of strings as returned by the
+@code{environ} procedure.
+
+This procedure is currently implemented using the @code{execve} system
+call, but we call it @code{execle} because of its Scheme calling interface.
+@end deffn
+
+ primitive-fork
+@c snarfed from posix.c:968
+@deffn primitive primitive-fork
+Creates a new "child" process by duplicating the current "parent" process.
+In the child the return value is 0. In the parent the return value is
+the integer process ID of the child.
+
+This procedure has been renamed from @code{fork} to avoid a naming conflict
+with the scsh fork.
+@end deffn
+
+ uname
+@c snarfed from posix.c:988
+@deffn primitive uname
+Return an object with some information about the computer
+system the program is running on.
+@end deffn
+
+ environ
+@c snarfed from posix.c:1018
+@deffn primitive environ [env]
+If @var{env} is omitted, return the current environment (in the
+Unix sense) as a list of strings. Otherwise set the current
+environment, which is also the default environment for child
+processes, to the supplied list of strings. Each member of
+@var{env} should be of the form @code{NAME=VALUE} and values of
+@code{NAME} should not be duplicated. If @var{env} is supplied
+then the return value is unspecified.
+@end deffn
+
+ tmpnam
+@c snarfed from posix.c:1056
+@deffn primitive tmpnam
+Return a name in the file system that does not match any
+existing file. However there is no guarantee that another
+process will not create the file after @code{tmpnam} is called.
+Care should be taken if opening the file, e.g., use the
+@code{O_EXCL} open flag or use @code{mkstemp!} instead.
+@end deffn
+
+ mkstemp!
+@c snarfed from posix.c:1082
+@deffn primitive mkstemp! tmpl
+Create a new unique file in the file system and returns a new
+buffered port open for reading and writing to the file.
+@var{tmpl} is a string specifying where the file should be
+created: it must end with @code{XXXXXX} and will be changed in
+place to return the name of the temporary file.
+@end deffn
+ utime
+@c snarfed from posix.c:1107
+@deffn primitive utime pathname [actime [modtime]]
+@code{utime} sets the access and modification times for the
+file named by @var{path}. If @var{actime} or @var{modtime} is
+not supplied, then the current time is used. @var{actime} and
+@var{modtime} must be integer time values as returned by the
+@code{current-time} procedure.
@lisp
-(vector 'a 'b 'c) @result{} #(a b c)
+(utime "foo" (- (current-time) 3600))
@end lisp
+will set the access time to one hour in the past and the
+modification time to the current time.
@end deffn
- make-vector
-@c snarfed from vectors.c:264
-@deffn primitive make-vector k [fill]
-Return a newly allocated vector of @var{k} elements. If a
-second argument is given, then each element is initialized to
-@var{fill}. Otherwise the initial contents of each element is
-unspecified.
+ access?
+@c snarfed from posix.c:1155
+@deffn primitive access? path how
+Return @code{#t} if @var{path} corresponds to an existing file
+and the current process has the type of access specified by
+@var{how}, otherwise @code{#f}. @var{how} should be specified
+using the values of the variables listed below. Multiple
+values can be combined using a bitwise or, in which case
+@code{#t} will only be returned if all accesses are granted.
+
+Permissions are checked using the real id of the current
+process, not the effective id, although it's the effective id
+which determines whether the access would actually be granted.
+
+@defvar R_OK
+test for read permission.
+@end defvar
+@defvar W_OK
+test for write permission.
+@end defvar
+@defvar X_OK
+test for execute permission.
+@end defvar
+@defvar F_OK
+test for existence of the file.
+@end defvar
@end deffn
- vector->list
-@c snarfed from vectors.c:321
-@deffn primitive vector->list v
-Return a newly allocated list of the objects contained in the
-elements of @var{vector}.
+ getpid
+@c snarfed from posix.c:1169
+@deffn primitive getpid
+Return an integer representing the current process ID.
+@end deffn
+
+ putenv
+@c snarfed from posix.c:1186
+@deffn primitive putenv str
+Modifies the environment of the current process, which is
+also the default environment inherited by child processes.
+
+If @var{string} is of the form @code{NAME=VALUE} then it will be written
+directly into the environment, replacing any existing environment string
+with
+name matching @code{NAME}. If @var{string} does not contain an equal
+sign, then any existing string with name matching @var{string} will
+be removed.
+
+The return value is unspecified.
+@end deffn
+
+ setlocale
+@c snarfed from posix.c:1217
+@deffn primitive setlocale category [locale]
+If @var{locale} is omitted, return the current value of the
+specified locale category as a system-dependent string.
+@var{category} should be specified using the values
+@code{LC_COLLATE}, @code{LC_ALL} etc.
+
+Otherwise the specified locale category is set to the string
+@var{locale} and the new value is returned as a
+system-dependent string. If @var{locale} is an empty string,
+the locale will be set using envirionment variables.
+@end deffn
+ mknod
+@c snarfed from posix.c:1257
+@deffn primitive mknod path type perms dev
+Creates a new special file, such as a file corresponding to a device.
+@var{path} specifies the name of the file. @var{type} should
+be one of the following symbols:
+regular, directory, symlink, block-special, char-special,
+fifo, or socket. @var{perms} (an integer) specifies the file permissions.
+@var{dev} (an integer) specifies which device the special file refers
+to. Its exact interpretation depends on the kind of special file
+being created.
+
+E.g.,
@lisp
-(vector->list '#(dah dah didah)) @result{} (dah dah didah)
-(list->vector '(dididit dah)) @result{} #(dididit dah)
+(mknod "/dev/fd0" 'block-special #o660 (+ (* 2 256) 2))
@end lisp
+
+The return value is unspecified.
@end deffn
- vector-fill!
-@c snarfed from vectors.c:338
-@deffn primitive vector-fill! v fill
-Store @var{fill} in every element of @var{vector}. The value
-returned by @code{vector-fill!} is unspecified.
+ nice
+@c snarfed from posix.c:1303
+@deffn primitive nice incr
+Increment the priority of the current process by @var{incr}. A higher
+priority value means that the process runs less often.
+The return value is unspecified.
@end deffn
- vector-move-left!
-@c snarfed from vectors.c:365
-@deffn primitive vector-move-left! vec1 start1 end1 vec2 start2
-Vector version of @code{substring-move-left!}.
+ sync
+@c snarfed from posix.c:1318
+@deffn primitive sync
+Flush the operating system disk buffers.
+The return value is unspecified.
@end deffn
- vector-move-right!
-@c snarfed from vectors.c:388
-@deffn primitive vector-move-right! vec1 start1 end1 vec2 start2
-Vector version of @code{substring-move-right!}.
+ crypt
+@c snarfed from posix.c:1331
+@deffn primitive crypt key salt
+Encrypt @var{key} using @var{salt} as the salt value to the
+crypt(3) library call.
@end deffn
- major-version
-@c snarfed from version.c:59
-@deffn primitive major-version
-Return a string containing Guile's major version number.
-E.g., "1".
+ chroot
+@c snarfed from posix.c:1352
+@deffn primitive chroot path
+Change the root directory to that specified in @var{path}.
+This directory will be used for path names beginning with
+@file{/}. The root directory is inherited by all children
+of the current process. Only the superuser may change the
+root directory.
@end deffn
- minor-version
-@c snarfed from version.c:71
-@deffn primitive minor-version
-Return a string containing Guile's minor version number.
-E.g., "3.5".
+ getlogin
+@c snarfed from posix.c:1384
+@deffn primitive getlogin
+Return a string containing the name of the user logged in on
+the controlling terminal of the process, or @code{#f} if this
+information cannot be obtained.
@end deffn
- version
-@c snarfed from version.c:90
-@deffn primitive version
-@deffnx primitive major-version
-@deffnx primitive minor-version
-Return a string describing Guile's version number, or its major or minor
-version numbers, respectively.
+ cuserid
+@c snarfed from posix.c:1402
+@deffn primitive cuserid
+Return a string containing a user name associated with the
+effective user id of the process. Return @code{#f} if this
+information cannot be obtained.
+@end deffn
+
+ getpriority
+@c snarfed from posix.c:1427
+@deffn primitive getpriority which who
+Return the scheduling priority of the process, process group
+or user, as indicated by @var{which} and @var{who}. @var{which}
+is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
+or @code{PRIO_USER}, and @var{who} is interpreted relative to
+@var{which} (a process identifier for @code{PRIO_PROCESS},
+process group identifier for @code{PRIO_PGRP}, and a user
+identifier for @code{PRIO_USER}. A zero value of @var{who}
+denotes the current process, process group, or user. Return
+the highest priority (lowest numerical value) of any of the
+specified processes.
+@end deffn
+
+ setpriority
+@c snarfed from posix.c:1461
+@deffn primitive setpriority which who prio
+Set the scheduling priority of the process, process group
+or user, as indicated by @var{which} and @var{who}. @var{which}
+is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
+or @code{PRIO_USER}, and @var{who} is interpreted relative to
+@var{which} (a process identifier for @code{PRIO_PROCESS},
+process group identifier for @code{PRIO_PGRP}, and a user
+identifier for @code{PRIO_USER}. A zero value of @var{who}
+denotes the current process, process group, or user.
+@var{prio} is a value in the range -20 and 20, the default
+priority is 0; lower priorities cause more favorable
+scheduling. Sets the priority of all of the specified
+processes. Only the super-user may lower priorities.
+The return value is not specified.
+@end deffn
+
+ getpass
+@c snarfed from posix.c:1486
+@deffn primitive getpass prompt
+Display @var{prompt} to the standard error output and read
+a password from @file{/dev/tty}. If this file is not
+accessible, it reads from standard input. The password may be
+up to 127 characters in length. Additional characters and the
+terminating newline character are discarded. While reading
+the password, echoing and the generation of signals by special
+characters is disabled.
+@end deffn
+
+ flock
+@c snarfed from posix.c:1524
+@deffn primitive flock file operation
+Apply or remove an advisory lock on an open file.
+@var{operation} specifies the action to be done:
+@table @code
+@item LOCK_SH
+Shared lock. More than one process may hold a shared lock
+for a given file at a given time.
+@item LOCK_EX
+Exclusive lock. Only one process may hold an exclusive lock
+for a given file at a given time.
+@item LOCK_UN
+Unlock the file.
+@item LOCK_NB
+Don't block when locking. May be specified by bitwise OR'ing
+it to one of the other operations.
+@end table
+The return value is not specified. @var{file} may be an open
+file descriptor or an open file descriptior port.
+@end deffn
+
+ sethostname
+@c snarfed from posix.c:1550
+@deffn primitive sethostname name
+Set the host name of the current processor to @var{name}. May
+only be used by the superuser. The return value is not
+specified.
+@end deffn
+
+ gethostname
+@c snarfed from posix.c:1565
+@deffn primitive gethostname
+Return the host name of the current processor.
+@end deffn
+
+ gethost
+@c snarfed from net_db.c:149
+@deffn primitive gethost [host]
+@deffnx procedure gethostbyname hostname
+@deffnx procedure gethostbyaddr address
+Look up a host by name or address, returning a host object. The
+@code{gethost} procedure will accept either a string name or an integer
+address; if given no arguments, it behaves like @code{gethostent} (see
+below). If a name or address is supplied but the address can not be
+found, an error will be thrown to one of the keys:
+@code{host-not-found}, @code{try-again}, @code{no-recovery} or
+@code{no-data}, corresponding to the equivalent @code{h_error} values.
+Unusual conditions may result in errors thrown to the
+@code{system-error} or @code{misc_error} keys.
+@end deffn
+
+ getnet
+@c snarfed from net_db.c:228
+@deffn primitive getnet [net]
+@deffnx procedure getnetbyname net-name
+@deffnx procedure getnetbyaddr net-number
+Look up a network by name or net number in the network database. The
+@var{net-name} argument must be a string, and the @var{net-number}
+argument must be an integer. @code{getnet} will accept either type of
+argument, behaving like @code{getnetent} (see below) if no arguments are
+given.
+@end deffn
+
+ getproto
+@c snarfed from net_db.c:277
+@deffn primitive getproto [protocol]
+@deffnx procedure getprotobyname name
+@deffnx procedure getprotobynumber number
+Look up a network protocol by name or by number. @code{getprotobyname}
+takes a string argument, and @code{getprotobynumber} takes an integer
+argument. @code{getproto} will accept either type, behaving like
+@code{getprotoent} (see below) if no arguments are supplied.
+@end deffn
+
+ getserv
+@c snarfed from net_db.c:343
+@deffn primitive getserv [name [protocol]]
+@deffnx procedure getservbyname name protocol
+@deffnx procedure getservbyport port protocol
+Look up a network service by name or by service number, and return a
+network service object. The @var{protocol} argument specifies the name
+of the desired protocol; if the protocol found in the network service
+database does not match this name, a system error is signalled.
+
+The @code{getserv} procedure will take either a service name or number
+as its first argument; if given no arguments, it behaves like
+@code{getservent} (see below).
+@end deffn
+
+ sethost
+@c snarfed from net_db.c:380
+@deffn primitive sethost [stayopen]
+If @var{stayopen} is omitted, this is equivalent to @code{endhostent}.
+Otherwise it is equivalent to @code{sethostent stayopen}.
+@end deffn
+
+ setnet
+@c snarfed from net_db.c:396
+@deffn primitive setnet [stayopen]
+If @var{stayopen} is omitted, this is equivalent to @code{endnetent}.
+Otherwise it is equivalent to @code{setnetent stayopen}.
+@end deffn
+
+ setproto
+@c snarfed from net_db.c:412
+@deffn primitive setproto [stayopen]
+If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}.
+Otherwise it is equivalent to @code{setprotoent stayopen}.
+@end deffn
+
+ setserv
+@c snarfed from net_db.c:428
+@deffn primitive setserv [stayopen]
+If @var{stayopen} is omitted, this is equivalent to @code{endservent}.
+Otherwise it is equivalent to @code{setservent stayopen}.
+@end deffn
+
+ htons
+@c snarfed from socket.c:101
+@deffn primitive htons value
+Convert a 16 bit quantity from host to network byte ordering.
+@var{value} is packed into 2 bytes, which are then converted
+and returned as a new integer.
+@end deffn
+
+ ntohs
+@c snarfed from socket.c:118
+@deffn primitive ntohs value
+Convert a 16 bit quantity from network to host byte ordering.
+@var{value} is packed into 2 bytes, which are then converted
+and returned as a new integer.
+@end deffn
+
+ htonl
+@c snarfed from socket.c:135
+@deffn primitive htonl value
+Convert a 32 bit quantity from host to network byte ordering.
+@var{value} is packed into 4 bytes, which are then converted
+and returned as a new integer.
+@end deffn
+
+ ntohl
+@c snarfed from socket.c:148
+@deffn primitive ntohl value
+Convert a 32 bit quantity from network to host byte ordering.
+@var{value} is packed into 4 bytes, which are then converted
+and returned as a new integer.
+@end deffn
+
+ inet-aton
+@c snarfed from socket.c:168
+@deffn primitive inet-aton address
+Convert an IPv4 Internet address from printable string
+(dotted decimal notation) to an integer. E.g.,
@lisp
-(version) @result{} "1.3a"
-(major-version) @result{} "1"
-(minor-version) @result{} "3a"
+(inet-aton "127.0.0.1") @result{} 2130706433
@end lisp
@end deffn
- make-soft-port
-@c snarfed from vports.c:190
-@deffn primitive make-soft-port pv modes
-Return a port capable of receiving or delivering characters as
-specified by the @var{modes} string (@pxref{File Ports,
-open-file}). @var{pv} must be a vector of length 5. Its
-components are as follows:
+ inet-ntoa
+@c snarfed from socket.c:187
+@deffn primitive inet-ntoa inetid
+Convert an IPv4 Internet address to a printable
+(dotted decimal notation) string. E.g.,
-@enumerate 0
-@item
-procedure accepting one character for output
-@item
-procedure accepting a string for output
-@item
-thunk for flushing output
-@item
-thunk for getting one character
-@item
-thunk for closing port (not by garbage collection)
-@end enumerate
+@lisp
+(inet-ntoa 2130706433) @result{} "127.0.0.1"
+@end lisp
+@end deffn
-For an output-only port only elements 0, 1, 2, and 4 need be
-procedures. For an input-only port only elements 3 and 4 need
-be procedures. Thunks 2 and 4 can instead be @code{#f} if
-there is no useful operation for them to perform.
+ inet-netof
+@c snarfed from socket.c:207
+@deffn primitive inet-netof address
+Return the network number part of the given IPv4
+Internet address. E.g.,
-If thunk 3 returns @code{#f} or an @code{eof-object}
-(@pxref{Input, eof-object?, ,r4rs, The Revised^4 Report on
-Scheme}) it indicates that the port has reached end-of-file.
-For example:
+@lisp
+(inet-netof 2130706433) @result{} 127
+@end lisp
+@end deffn
+
+ inet-lnaof
+@c snarfed from socket.c:225
+@deffn primitive inet-lnaof address
+Return the local-address-with-network part of the given
+IPv4 Internet address, using the obsolete class A/B/C system.
+E.g.,
@lisp
-(define stdout (current-output-port))
-(define p (make-soft-port
- (vector
- (lambda (c) (write c stdout))
- (lambda (s) (display s stdout))
- (lambda () (display "." stdout))
- (lambda () (char-upcase (read-char)))
- (lambda () (display "@@" stdout)))
- "rw"))
+(inet-lnaof 2130706433) @result{} 1
+@end lisp
+@end deffn
-(write p p) @result{} #<input-output: soft 8081e20>
+ inet-makeaddr
+@c snarfed from socket.c:243
+@deffn primitive inet-makeaddr net lna
+Make an IPv4 Internet address by combining the network number
+@var{net} with the local-address-within-network number
+@var{lna}. E.g.,
+
+@lisp
+(inet-makeaddr 127 1) @result{} 2130706433
@end lisp
@end deffn
- make-weak-vector
-@c snarfed from weaks.c:63
-@deffn primitive make-weak-vector size [fill]
-Return a weak vector with @var{size} elements. If the optional
-argument @var{fill} is given, all entries in the vector will be
-set to @var{fill}. The default value for @var{fill} is the
-empty list.
+ inet-pton
+@c snarfed from socket.c:361
+@deffn primitive inet-pton family address
+Convert a string containing a printable network address to
+an integer address. Note that unlike the C version of this
+function,
+the result is an integer with normal host byte ordering.
+@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
+
+@lisp
+(inet-pton AF_INET "127.0.0.1") @result{} 2130706433
+(inet-pton AF_INET6 "::1") @result{} 1
+@end lisp
@end deffn
- list->weak-vector
-@c snarfed from weaks.c:80
-@deffn primitive list->weak-vector
-scm_weak_vector
+ inet-ntop
+@c snarfed from socket.c:396
+@deffn primitive inet-ntop family address
+Convert a network address into a printable string.
+Note that unlike the C version of this function,
+the input is an integer with normal host byte ordering.
+@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
+
+@lisp
+(inet-ntop AF_INET 2130706433) @result{} "127.0.0.1"
+(inet-ntop AF_INET6 (- (expt 2 128) 1)) @result{}
+ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
+@end lisp
@end deffn
- weak-vector
-@c snarfed from weaks.c:88
-@deffn primitive weak-vector . l
-@deffnx primitive list->weak-vector l
-Construct a weak vector from a list: @code{weak-vector} uses
-the list of its arguments while @code{list->weak-vector} uses
-its only argument @var{l} (a list) to construct a weak vector
-the same way @code{list->vector} would.
+ socket
+@c snarfed from socket.c:441
+@deffn primitive socket family style proto
+Return a new socket port of the type specified by @var{family},
+@var{style} and @var{proto}. All three parameters are
+integers. Supported values for @var{family} are
+@code{AF_UNIX}, @code{AF_INET} and @code{AF_INET6}.
+Typical values for @var{style} are @code{SOCK_STREAM},
+@code{SOCK_DGRAM} and @code{SOCK_RAW}.
+
+@var{proto} can be obtained from a protocol name using
+@code{getprotobyname}. A value of zero specifies the default
+protocol, which is usually right.
+
+A single socket port cannot by used for communication until it
+has been connected to another socket.
@end deffn
- weak-vector?
-@c snarfed from weaks.c:116
-@deffn primitive weak-vector? obj
-Return @code{#t} if @var{obj} is a weak vector. Note that all
-weak hashes are also weak vectors.
+ socketpair
+@c snarfed from socket.c:463
+@deffn primitive socketpair family style proto
+Return a pair of connected (but unnamed) socket ports of the
+type specified by @var{family}, @var{style} and @var{proto}.
+Many systems support only socket pairs of the @code{AF_UNIX}
+family. Zero is likely to be the only meaningful value for
+@var{proto}.
@end deffn
- make-weak-key-hash-table
-@c snarfed from weaks.c:138
-@deffn primitive make-weak-key-hash-table size
-@deffnx primitive make-weak-value-hash-table size
-@deffnx primitive make-doubly-weak-hash-table size
-Return a weak hash table with @var{size} buckets. As with any
-hash table, choosing a good size for the table requires some
-caution.
+ getsockopt
+@c snarfed from socket.c:492
+@deffn primitive getsockopt sock level optname
+Return the value of a particular socket option for the socket
+port @var{sock}. @var{level} is an integer code for type of
+option being requested, e.g., @code{SOL_SOCKET} for
+socket-level options. @var{optname} is an integer code for the
+option required and should be specified using one of the
+symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
-You can modify weak hash tables in exactly the same way you
-would modify regular hash tables. (@pxref{Hash Tables})
+The returned value is typically an integer but @code{SO_LINGER}
+returns a pair of integers.
@end deffn
- make-weak-value-hash-table
-@c snarfed from weaks.c:155
-@deffn primitive make-weak-value-hash-table size
-Return a hash table with weak values with @var{size} buckets.
-(@pxref{Hash Tables})
+ setsockopt
+@c snarfed from socket.c:560
+@deffn primitive setsockopt sock level optname value
+Set the value of a particular socket option for the socket
+port @var{sock}. @var{level} is an integer code for type of option
+being set, e.g., @code{SOL_SOCKET} for socket-level options.
+@var{optname} is an
+integer code for the option to set and should be specified using one of
+the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
+@var{value} is the value to which the option should be set. For
+most options this must be an integer, but for @code{SO_LINGER} it must
+be a pair.
+
+The return value is unspecified.
@end deffn
- make-doubly-weak-hash-table
-@c snarfed from weaks.c:173
-@deffn primitive make-doubly-weak-hash-table size
-Return a hash table with weak keys and values with @var{size}
-buckets. (@pxref{Hash Tables})
+ shutdown
+@c snarfed from socket.c:664
+@deffn primitive shutdown sock how
+Sockets can be closed simply by using @code{close-port}. The
+@code{shutdown} procedure allows reception or tranmission on a
+connection to be shut down individually, according to the parameter
+@var{how}:
+
+@table @asis
+@item 0
+Stop receiving data for this socket. If further data arrives, reject it.
+@item 1
+Stop trying to transmit data from this socket. Discard any
+data waiting to be sent. Stop looking for acknowledgement of
+data already sent; don't retransmit it if it is lost.
+@item 2
+Stop both reception and transmission.
+@end table
+
+The return value is unspecified.
@end deffn
- weak-key-hash-table?
-@c snarfed from weaks.c:192
-@deffn primitive weak-key-hash-table? obj
-@deffnx primitive weak-value-hash-table? obj
-@deffnx primitive doubly-weak-hash-table? obj
-Return @code{#t} if @var{obj} is the specified weak hash
-table. Note that a doubly weak hash table is neither a weak key
-nor a weak value hash table.
+ connect
+@c snarfed from socket.c:808
+@deffn primitive connect sock fam address . args
+Initiate a connection from a socket using a specified address
+family to the address
+specified by @var{address} and possibly @var{args}.
+The format required for @var{address}
+and @var{args} depends on the family of the socket.
+
+For a socket of family @code{AF_UNIX},
+only @var{address} is specified and must be a string with the
+filename where the socket is to be created.
+
+For a socket of family @code{AF_INET},
+@var{address} must be an integer IPv4 host address and
+@var{args} must be a single integer port number.
+
+For a socket of family @code{AF_INET6},
+@var{address} must be an integer IPv6 host address and
+@var{args} may be up to three integers:
+port [flowinfo] [scope_id],
+where flowinfo and scope_id default to zero.
+
+The return value is unspecified.
@end deffn
- weak-value-hash-table?
-@c snarfed from weaks.c:202
-@deffn primitive weak-value-hash-table? obj
-Return @code{#t} if @var{obj} is a weak value hash table.
+ bind
+@c snarfed from socket.c:868
+@deffn primitive bind sock fam address . args
+Assign an address to the socket port @var{sock}.
+Generally this only needs to be done for server sockets,
+so they know where to look for incoming connections. A socket
+without an address will be assigned one automatically when it
+starts communicating.
+
+The format of @var{address} and @var{args} depends
+on the family of the socket.
+
+For a socket of family @code{AF_UNIX}, only @var{address}
+is specified and must be a string with the filename where
+the socket is to be created.
+
+For a socket of family @code{AF_INET}, @var{address}
+must be an integer IPv4 address and @var{args}
+must be a single integer port number.
+
+The values of the following variables can also be used for
+@var{address}:
+
+@defvar INADDR_ANY
+Allow connections from any address.
+@end defvar
+
+@defvar INADDR_LOOPBACK
+The address of the local host using the loopback device.
+@end defvar
+
+@defvar INADDR_BROADCAST
+The broadcast address on the local network.
+@end defvar
+
+@defvar INADDR_NONE
+No address.
+@end defvar
+
+For a socket of family @code{AF_INET6}, @var{address}
+must be an integer IPv6 address and @var{args}
+may be up to three integers:
+port [flowinfo] [scope_id],
+where flowinfo and scope_id default to zero.
+
+The return value is unspecified.
@end deffn
- doubly-weak-hash-table?
-@c snarfed from weaks.c:212
-@deffn primitive doubly-weak-hash-table? obj
-Return @code{#t} if @var{obj} is a doubly weak hash table.
+ listen
+@c snarfed from socket.c:902
+@deffn primitive listen sock backlog
+Enable @var{sock} to accept connection
+requests. @var{backlog} is an integer specifying
+the maximum length of the queue for pending connections.
+If the queue fills, new clients will fail to connect until
+the server calls @code{accept} to accept a connection from
+the queue.
+
+The return value is unspecified.
+@end deffn
+
+ accept
+@c snarfed from socket.c:1007
+@deffn primitive accept sock
+Accept a connection on a bound, listening socket.
+If there
+are no pending connections in the queue, wait until
+one is available unless the non-blocking option has been
+set on the socket.
+
+The return value is a
+pair in which the @emph{car} is a new socket port for the
+connection and
+the @emph{cdr} is an object with address information about the
+client which initiated the connection.
+
+@var{sock} does not become part of the
+connection and will continue to accept new requests.
+@end deffn
+
+ getsockname
+@c snarfed from socket.c:1034
+@deffn primitive getsockname sock
+Return the address of @var{sock}, in the same form as the
+object returned by @code{accept}. On many systems the address
+of a socket in the @code{AF_FILE} namespace cannot be read.
+@end deffn
+
+ getpeername
+@c snarfed from socket.c:1056
+@deffn primitive getpeername sock
+Return the address that @var{sock}
+is connected to, in the same form as the object returned by
+@code{accept}. On many systems the address of a socket in the
+@code{AF_FILE} namespace cannot be read.
+@end deffn
+
+ recv!
+@c snarfed from socket.c:1091
+@deffn primitive recv! sock buf [flags]
+Receive data from a socket port.
+@var{sock} must already
+be bound to the address from which data is to be received.
+@var{buf} is a string into which
+the data will be written. The size of @var{buf} limits
+the amount of
+data which can be received: in the case of packet
+protocols, if a packet larger than this limit is encountered
+then some data
+will be irrevocably lost.
+
+The optional @var{flags} argument is a value or
+bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
+
+The value returned is the number of bytes read from the
+socket.
+
+Note that the data is read directly from the socket file
+descriptor:
+any unread buffered port data is ignored.
+@end deffn
+
+ send
+@c snarfed from socket.c:1124
+@deffn primitive send sock message [flags]
+Transmit the string @var{message} on a socket port @var{sock}.
+@var{sock} must already be bound to a destination address. The
+value returned is the number of bytes transmitted --
+it's possible for
+this to be less than the length of @var{message}
+if the socket is
+set to be non-blocking. The optional @var{flags} argument
+is a value or
+bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
+
+Note that the data is written directly to the socket
+file descriptor:
+any unflushed buffered port data is ignored.
+@end deffn
+
+ recvfrom!
+@c snarfed from socket.c:1164
+@deffn primitive recvfrom! sock str [flags [start [end]]]
+Return data from the socket port @var{sock} and also
+information about where the data was received from.
+@var{sock} must already be bound to the address from which
+data is to be received. @code{str}, is a string into which the
+data will be written. The size of @var{str} limits the amount
+of data which can be received: in the case of packet protocols,
+if a packet larger than this limit is encountered then some
+data will be irrevocably lost.
+
+The optional @var{flags} argument is a value or bitwise OR of
+@code{MSG_OOB}, @code{MSG_PEEK}, @code{MSG_DONTROUTE} etc.
+
+The value returned is a pair: the @emph{car} is the number of
+bytes read from the socket and the @emph{cdr} an address object
+in the same form as returned by @code{accept}. The address
+will given as @code{#f} if not available, as is usually the
+case for stream sockets.
+
+The @var{start} and @var{end} arguments specify a substring of
+@var{str} to which the data should be written.
+
+Note that the data is read directly from the socket file
+descriptor: any unread buffered port data is ignored.
+@end deffn
+
+ sendto
+@c snarfed from socket.c:1222
+@deffn primitive sendto sock message fam address . args_and_flags
+Transmit the string @var{message} on the socket port
+@var{sock}. The
+destination address is specified using the @var{fam},
+@var{address} and
+@var{args_and_flags} arguments, in a similar way to the
+@code{connect} procedure. @var{args_and_flags} contains
+the usual connection arguments optionally followed by
+a flags argument, which is a value or
+bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
+
+The value returned is the number of bytes transmitted --
+it's possible for
+this to be less than the length of @var{message} if the
+socket is
+set to be non-blocking.
+Note that the data is written directly to the socket
+file descriptor:
+any unflushed buffered port data is ignored.
@end deffn
diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog
index 52476be8e..cdd5ee958 100644
--- a/doc/ref/ChangeLog
+++ b/doc/ref/ChangeLog
@@ -1,3 +1,61 @@
+2001-11-08 Neil Jerram <neil@ossau.uklinux.net>
+
+ * guile.texi (Top): Added new chapter `Programming Options'.
+
+ * program.texi: New file.
+
+ * Makefile.am (guile_TEXINFOS): Added program.texi.
+
+2001-11-07 Neil Jerram <neil@ossau.uklinux.net>
+
+ * scheme-memory.texi, scheme-io.texi, scheme-debug.texi,
+ scheme-data.texi, scheme-binding.texi, posix.texi,
+ new-docstrings.texi: Automatic updates from improved libguile
+ docstrings.
+
+2001-11-04 Neil Jerram <neil@ossau.uklinux.net>
+
+ * preface.texi: Use MANUAL_EDITION variable.
+ (Manual Layout): Updated to reflect reorg.
+
+ * guile.texi (MANUAL_EDITION): New variable, with value
+ incremented from 1.0 to 1.1 to reflect the reorg described here.
+ (Top): Use MANUAL_EDITION variable.
+
+ * scheme-indices.texi (R5RS Index, Guile Extensions Index): Use
+ @unnumbered rather than @chapter for these indices.
+
+ * guile.texi (Top): A little top-level reshuffling, with the aims
+ that: (1) the `Guile Scheme' (reference) part of the manual
+ becomes the `Guile API Reference', and covers both Scheme and C
+ interfaces; (2) non-API-reference material such as the `Basic
+ Ideas in Scheme' chapter is collected together to form a new part
+ `Programming with Guile'. This new part will contain general
+ documentation on using and programming Guile in both Scheme and C,
+ including - for example - awareness of GC when C programming, how
+ to use the snarf macros, how to debug ...
+ (Top): Move inclusion of scheme-indices.texi so that all indices
+ appear together in the printed manual.
+
+ * Makefile.am (guile_TEXINFOS): Removed appendices.texi, added
+ debugging.texi.
+
+ * appendices.texi: Removed.
+
+ * debugging.texi (Debugger User Interface): New file, same as the
+ material that used to be in appendices.texi, but now a chapter in
+ Part II rather than an appendix.
+
+ * appendices.texi (Obtaining and Installing Guile): Moved to
+ become a chapter in ...
+ * intro.texi: ... Part I: Introduction to Guile.
+
+ * scm.texi (I/O Extensions): Moved to become a section of ...
+ * scheme-io.texi (Input and Output): ... this chapter.
+
+ * scm.texi (Handling Errors): Moved to become a section of ...
+ * scheme-control.texi (Control Mechanisms): ... this chapter.
+
2001-11-06 Thien-Thi Nguyen <ttn@glug.org>
* srfi-modules.texi (SRFI-19, SRFI-19 Constants, SRFI-19 Current
diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am
index 99e06b0a8..5fbacd8a7 100644
--- a/doc/ref/Makefile.am
+++ b/doc/ref/Makefile.am
@@ -23,7 +23,7 @@ AUTOMAKE_OPTIONS = gnu
info_TEXINFOS = guile.texi
-guile_TEXINFOS = preface.texi intro.texi scheme-intro.texi \
+guile_TEXINFOS = preface.texi intro.texi program.texi scheme-intro.texi \
scheme-ideas.texi scheme-data.texi scheme-procedures.texi \
scheme-utility.texi scheme-binding.texi scheme-control.texi \
scheme-io.texi scheme-evaluation.texi scheme-memory.texi \
@@ -31,7 +31,7 @@ guile_TEXINFOS = preface.texi intro.texi scheme-intro.texi \
scheme-translation.texi scheme-debug.texi deprecated.texi \
scheme-reading.texi scheme-indices.texi slib.texi posix.texi \
expect.texi scsh.texi tcltk.texi scripts.texi gh.texi scm.texi \
- appendices.texi indices.texi script-getopt.texi data-rep.texi \
+ debugging.texi indices.texi script-getopt.texi data-rep.texi \
extend.texi repl-modules.texi srfi-modules.texi misc-modules.texi
# Optionally support building an HTML version of the reference manual.
diff --git a/doc/ref/appendices.texi b/doc/ref/appendices.texi
deleted file mode 100644
index e69de29bb..000000000
--- a/doc/ref/appendices.texi
+++ /dev/null
diff --git a/doc/ref/debugging.texi b/doc/ref/debugging.texi
new file mode 100644
index 000000000..28607c551
--- /dev/null
+++ b/doc/ref/debugging.texi
@@ -0,0 +1,179 @@
+@page
+@node Debugger User Interface
+@chapter Debugger User Interface
+
+@c --- The title and introduction of this appendix need to
+@c distinguish this clearly from the chapter on the internal
+@c debugging interface.
+
+When debugging a program, programmers often find it helpful to examine
+the program's internal status while it runs: the values of internal
+variables, the choices made in @code{if} and @code{cond} statements, and
+so forth. Guile Scheme provides a debugging interface that programmers
+can use to single-step through Scheme functions and examine symbol
+bindings. This is different from the @ref{Debugging}, which permits
+programmers to debug the Guile interpreter itself. Most programmers
+will be more interested in debugging their own Scheme programs than the
+interpreter which evaluates them.
+
+[FIXME: should we include examples of traditional debuggers
+and explain why they can't be used to debug interpreted Scheme or Lisp?]
+
+@menu
+* Single-Step:: Execute a program or function one step at a time.
+* Trace:: Print a report each time a given function is called.
+* Backtrace:: See a list of the statements that caused an error.
+* Stacks and Frames:: Examine the state of an interrupted program.
+@end menu
+
+
+@node Single-Step
+@section Single-Step
+
+
+@node Trace
+@section Trace
+
+When a function is @dfn{traced}, it means that every call to that
+function is reported to the user during a program run. This can help a
+programmer determine whether a function is being called at the wrong
+time or with the wrong set of arguments.
+
+@defun trace function
+Enable debug tracing on @code{function}. While a program is being run, Guile
+will print a brief report at each call to a traced function,
+advising the user which function was called and the arguments that were
+passed to it.
+@end defun
+
+@defun untrace function
+Disable debug tracing for @code{function}.
+@end defun
+
+Example:
+
+@lisp
+(define (rev ls)
+ (if (null? ls)
+ '()
+ (append (rev (cdr ls))
+ (cons (car ls) '())))) @result{} rev
+
+(trace rev) @result{} (rev)
+
+(rev '(a b c d e))
+@result{} [rev (a b c d e)]
+ | [rev (b c d e)]
+ | | [rev (c d e)]
+ | | | [rev (d e)]
+ | | | | [rev (e)]
+ | | | | | [rev ()]
+ | | | | | ()
+ | | | | (e)
+ | | | (e d)
+ | | (e d c)
+ | (e d c b)
+ (e d c b a)
+ (e d c b a)
+@end lisp
+
+Note the way Guile indents the output, illustrating the depth of
+execution at each function call. This can be used to demonstrate, for
+example, that Guile implements self-tail-recursion properly:
+
+@lisp
+(define (rev ls sl)
+ (if (null? ls)
+ sl
+ (rev (cdr ls)
+ (cons (car ls) sl)))) @result{} rev
+
+(trace rev) @result{} (rev)
+
+(rev '(a b c d e) '())
+@result{} [rev (a b c d e) ()]
+ [rev (b c d e) (a)]
+ [rev (c d e) (b a)]
+ [rev (d e) (c b a)]
+ [rev (e) (d c b a)]
+ [rev () (e d c b a)]
+ (e d c b a)
+ (e d c b a)
+@end lisp
+
+Since the tail call is effectively optimized to a @code{goto} statement,
+there is no need for Guile to create a new stack frame for each
+iteration. Using @code{trace} here helps us see why this is so.
+
+@node Backtrace
+@appendixsec Backtrace
+
+@node Stacks and Frames
+@appendixsec Stacks and Frames
+
+When a running program is interrupted, usually upon reaching an error or
+breakpoint, its state is represented by a @dfn{stack} of suspended
+function calls, each of which is called a @dfn{frame}. The programmer
+can learn more about the program's state at the point of interruption by
+inspecting and modifying these frames.
+
+@deffn primitive stack? obj
+Return @code{#t} if @var{obj} is a calling stack.
+@end deffn
+
+@deffn primitive make-stack
+@end deffn
+
+@deffn syntax start-stack id exp
+Evaluate @var{exp} on a new calling stack with identity @var{id}. If
+@var{exp} is interrupted during evaluation, backtraces will not display
+frames farther back than @var{exp}'s top-level form. This macro is a
+way of artificially limiting backtraces and stack procedures, largely as
+a convenience to the user.
+@end deffn
+
+@deffn primitive stack-id stack
+Return the identifier given to @var{stack} by @code{start-stack}.
+@end deffn
+
+@deffn primitive stack-ref
+@end deffn
+
+@deffn primitive stack-length
+@end deffn
+
+@deffn primitive frame?
+@end deffn
+
+@deffn primitive last-stack-frame
+@end deffn
+
+@deffn primitive frame-number
+@end deffn
+
+@deffn primitive frame-source
+@end deffn
+
+@deffn primitive frame-procedure
+@end deffn
+
+@deffn primitive frame-arguments
+@end deffn
+
+@deffn primitive frame-previous
+@end deffn
+
+@deffn primitive frame-next
+@end deffn
+
+@deffn primitive frame-real?
+@end deffn
+
+@deffn primitive frame-procedure?
+@end deffn
+
+@deffn primitive frame-evaluating-args?
+@end deffn
+
+@deffn primitive frame-overflow
+@end deffn
diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi
index 7d5e0ba01..fdd6df748 100644
--- a/doc/ref/guile.texi
+++ b/doc/ref/guile.texi
@@ -4,6 +4,7 @@
@setfilename guile.info
@settitle Guile Reference Manual
@set guile
+@set MANUAL_EDITION 1.1
@c %**end of header
@c Notes: (distilled from Jim's and Tim's notes, and kept up to date)
@@ -80,7 +81,7 @@ by the Free Software Foundation.
@sp 10
@comment The title is printed in a large font.
@title Guile Reference Manual
-@subtitle $Id: guile.texi,v 1.5 2001-10-27 16:53:34 ghouston Exp $
+@subtitle $Id: guile.texi,v 1.6 2001-11-11 15:01:51 ossau Exp $
@subtitle For use with Guile @value{VERSION}
@c AUTHORS
@@ -175,8 +176,8 @@ This reference manual documents Guile, GNU's Ubiquitous Intelligent
Language for Extensions. It describes how to use Guile in many useful
and interesting ways.
-This Info file contains edition 1.0 of the reference manual,
-corresponding to Guile version @value{VERSION}.
+This Info file contains edition @value{MANUAL_EDITION} of the reference
+manual, corresponding to Guile version @value{VERSION}.
@end ifinfo
@menu
@@ -190,12 +191,27 @@ Part I: Introduction to Guile
* What is Guile?:: And what does it do?
* Whirlwind Tour:: An introductory whirlwind tour.
+* Obtaining and Installing Guile::
* Reporting Bugs:: Reporting bugs in Guile or this manual.
-Part II: Guile Scheme
+Part II: Programming with Guile
+* Programming Intro:: Intoduction to programming with Guile.
+* Programming Options:: Programming Options in Guile.
* Scheme Intro:: Introduction to Guile Scheme.
* Basic Ideas:: Basic ideas in Scheme.
+* Guile Scripting:: How to write Guile scripts.
+* Command Line Handling:: Command line options and arguments.
+* Libguile Intro:: Using Guile as an extension language.
+* Scheme Primitives:: Writing Scheme primitives in C.
+* Data Representation:: Data representation in Guile.
+* GH:: The deprecated GH interface.
+* Debugger User Interface::
+* Further Reading:: Where to find out more about Scheme programming.
+
+Part III: Guile API Reference
+
+* Reference Intro:: Introduction to the Guile API reference.
* Data Types:: Data types for generic use.
* Procedures and Macros:: Procedures and macros.
* Utility Functions:: General utility functions.
@@ -211,9 +227,8 @@ Part II: Guile Scheme
* Translation:: Support for translating other languages.
* Debugging:: Internal debugging interface.
* Deprecated:: Features that are planned to disappear.
-* Further Reading:: Where to find out more about Scheme programming.
-Part III: Guile Modules
+Part IV: Guile Modules
* SLIB:: Using the SLIB Scheme library.
* POSIX:: POSIX system calls and networking.
@@ -224,26 +239,6 @@ Part III: Guile Modules
* Formatted Output:: The @code{format} procedure.
* Expect:: Controlling interactive programs with Guile.
* The Scheme shell (scsh):: Using scsh interfaces in Guile.
-@c * Tcl/Tk Interface::
-
-Part IV: Guile Scripting
-
-* Guile Scripting:: How to write Guile scripts.
-* Command Line Handling:: Command line options and arguments.
-
-Part V: Extending Applications Using Guile
-
-* Libguile Intro:: Using Guile as an extension language.
-* Data Representation:: Data representation in Guile.
-* Scheme Primitives:: Writing Scheme primitives in C.
-* I/O Extensions:: Using and extending ports in C.
-* Handling Errors:: How to handle errors in C code.
-* GH:: The deprecated GH interface.
-
-Appendices
-
-* Obtaining and Installing Guile::
-* Debugger User Interface::
Indices
@@ -258,7 +253,6 @@ Indices
@include preface.texi
-@c preliminary
@iftex
@page
@unnumbered{Part I: Introduction to Guile}
@@ -266,14 +260,37 @@ Indices
@include intro.texi
-@c programming in Scheme
-@iftex
@page
-@unnumbered{Part II: Guile Scheme}
-@end iftex
+@node Programming Intro
+@unnumbered Part II: Programming with Guile
+
+In this part of the manual, we aim to present a wide ranging picture of
+what it means to program using Guile, to provide guidance, practical
+guidelines and tips for @emph{how} to program in Guile, and to document
+the tools that are available to help you with your programming. For
+detailed reference information on the variables, functions etc. that
+make up Guile's application programming interface (API), please refer to
+Part III (@pxref{Reference Intro,,Part III: Programming with Guile}).
+We begin in the first chapter of this part by looking at the programming
+options available.
+
+@include program.texi
@include scheme-intro.texi
@include scheme-ideas.texi
+@include scripts.texi
+@include script-getopt.texi
+@include extend.texi
+@include scm.texi
+@include data-rep.texi
+@include gh.texi
+@include debugging.texi
+@include scheme-reading.texi
+
+@page
+@node Reference Intro
+@unnumbered Part III: Guile API Reference
+
@include scheme-data.texi
@include scheme-procedures.texi
@include scheme-utility.texi
@@ -289,13 +306,10 @@ Indices
@include scheme-translation.texi
@include scheme-debug.texi
@include deprecated.texi
-@include scheme-reading.texi
-@include scheme-indices.texi
-@c Unix system interface
@iftex
@page
-@unnumbered{Part III: Guile Modules}
+@unnumbered{Part IV: Guile Modules}
@end iftex
@include slib.texi
@@ -305,43 +319,14 @@ Indices
@include misc-modules.texi
@include expect.texi
@include scsh.texi
-@c @include tcltk.texi
-
-@c Guile as an scripting language
-@iftex
-@page
-@unnumbered{Part IV: Guile Scripting}
-@end iftex
-
-@include scripts.texi
-@include script-getopt.texi
-@c Guile as an extension language
-@iftex
-@page
-@unnumbered{Part V: Extending Applications Using Guile}
-@end iftex
-
-@include extend.texi
-@include data-rep.texi
-@include scm.texi
-@include gh.texi
-
-@c Appendices
-@iftex
-@page
-@unnumbered{Appendices}
-@end iftex
-
-@include appendices.texi
-
-@c Indices
@iftex
@page
@unnumbered{Indices}
@end iftex
@include indices.texi
+@include scheme-indices.texi
@contents
diff --git a/doc/ref/indices.texi b/doc/ref/indices.texi
index a35592e90..11ab7476b 100644
--- a/doc/ref/indices.texi
+++ b/doc/ref/indices.texi
@@ -1,3 +1,4 @@
+@page
@node Concept Index
@unnumbered Concept Index
@@ -41,9 +42,6 @@ in the section @xref{Transforming Scheme name to C name}.
@page
-@c Spell out this node fully, because it is the last real node
-@c in the top-level menu. Leaving off the pointers here causes
-@c spurious makeinfo errors.
@node Type Index
@unnumbered Type Index
diff --git a/doc/ref/intro.texi b/doc/ref/intro.texi
index fdbbbf85b..9391a1d48 100644
--- a/doc/ref/intro.texi
+++ b/doc/ref/intro.texi
@@ -1,4 +1,5 @@
-@c $Id: intro.texi,v 1.2 2001-08-27 21:25:44 ossau Exp $
+@c $Id: intro.texi,v 1.3 2001-11-11 15:01:51 ossau Exp $
+
@page
@node What is Guile?
@@ -50,6 +51,7 @@ can program applications which use Guile in the language of their
choice, rather than having the tastes of the application's author
imposed on them.
+
@page
@node Whirlwind Tour
@chapter A Whirlwind Tour
@@ -582,6 +584,7 @@ guile> (exit)
$
@end example
+
@node Writing Extensions for Guile
@section Writing Extensions for Guile
@@ -624,6 +627,7 @@ by Guile.
* A Sample Guile Extension::
@end menu
+
@node A Sample Guile Extension
@subsection A Sample Guile Extension
@@ -688,6 +692,7 @@ environment variable.
To see how these Guile extensions via shared libraries relate to the
module system, see below @xref{Intro to Modules and Extensions}.
+
@node Guile Modules
@section Guile Modules
@@ -701,13 +706,13 @@ anyway. Guile will provide reasonable backwards compatability.)
Details on the module system beyond this introductory material can be found in
@xref{Modules}.
-
@menu
* Intro to Using Guile Modules::
* Intro to Writing New Modules::
* Intro to Modules and Extensions::
@end menu
+
@node Intro to Using Guile Modules
@subsection Intro to Using Existing Modules
@@ -848,6 +853,110 @@ There is also a way to manipulate the module system from C but only
Scheme files can be autoloaded. Thus, we recommend that you define
your modules in Scheme.
+
+@page
+@node Obtaining and Installing Guile
+@chapter Obtaining and Installing Guile
+
+Here is the information you will need to get and install Guile and extra
+packages and documentation you might need or find interesting.
+
+@menu
+* The Basic Guile Package::
+* Packages not shipped with Guile::
+@end menu
+
+
+@node The Basic Guile Package
+@section The Basic Guile Package
+
+Guile can be obtained from the main GNU archive site
+@url{ftp://prep.ai.mit.edu/pub/gnu} or any of its mirrors. The file
+will be named guile-version.tar.gz. The current version is
+@value{VERSION}, so the file you should grab is:
+
+@url{ftp://prep.ai.mit.edu/pub/gnu/guile-@value{VERSION}.tar.gz}
+
+To unbundle Guile use the instruction
+@example
+zcat guile-@value{VERSION}.tar.gz | tar xvf -
+@end example
+which will create a directory called @file{guile-@value{VERSION}} with
+all the sources. You can look at the file @file{INSTALL} for detailed
+instructions on how to build and install Guile, but you should be able
+to just do
+@example
+cd guile-@value{VERSION}
+./configure
+make install
+@end example
+
+This will install the Guile executable @file{guile}, the Guile library
+@file{libguile.a} and various associated header files and support
+libraries. It will also install the Guile tutorial and reference manual.
+
+@c [[include instructions for getting R5RS]]
+
+Since this manual frequently refers to the Scheme ``standard'', also
+known as R5RS, or the
+@iftex
+``Revised$^5$ Report on the Algorithmic Language Scheme'',
+@end iftex
+@ifinfo
+``Revised^5 Report on the Algorithmic Language Scheme'',
+@end ifinfo
+we have included the report in the Guile distribution;
+@xref{Top, , Introduction, r5rs, Revised(5) Report on the Algorithmic
+Language Scheme}.
+This will also be installed in your info directory.
+
+
+@node Packages not shipped with Guile
+@section Packages not shipped with Guile
+
+We ship the Guile tutorial and reference manual with the Guile
+distribution. Since the Scheme standard (R5RS) is a stable document, we
+ship that too.
+
+Here are references (usually World Wide Web URLs) to some other freely
+redistributable documents and packages which you might find useful if
+you are using Guile.
+
+@table @strong
+@item SCSH
+the Scheme Shell. Gary Houston has ported SCSH to Guile. The relevant
+chapter (@pxref{The Scheme shell (scsh)}) has references to the SCSH web
+page with all its documentation.
+
+@item SLIB
+a portable Scheme library maintained by Aubrey Jaffer. SLIB can be
+obtained by ftp from @url{ftp://prep.ai.mit.edu/pub/gnu/jacal/}.
+
+The SLIB package should be unpacked somewhere in Guile's load path. It
+will typically be unpacked in @file{/usr/local/share/guile/site}, so
+that it will be @file{/usr/local/share/guile/site/slib}.
+
+Guile might have been installed with a different prefix, in which case
+the load path can be checked from inside the interpreter with:
+
+@smalllisp
+guile> %load-path
+("/usr/local/share/guile/site" "/usr/local/share/guile/1.3a" "/usr/local/share/guile" ".")
+@end smalllisp
+
+The relevant chapter (@pxref{SLIB}) has details on how to use SLIB with
+Guile.
+
+@item JACAL
+a symbolic math package by Aubrey Jaffer. The latest version of Jacal
+can be obtained from @url{ftp://prep.ai.mit.edu/pub/gnu/jacal/}, and
+should be unpacked in @file{/usr/local/share/guile/site/slib} so that
+it will be in @file{/usr/local/share/guile/site/slib/jacal}.
+
+The relevant section (@pxref{JACAL}) has details on how to use Jacal.
+@end table
+
+
@page
@node Reporting Bugs
@chapter Reporting Bugs
diff --git a/doc/ref/new-docstrings.texi b/doc/ref/new-docstrings.texi
index 8bce646e6..e795fd3ef 100644
--- a/doc/ref/new-docstrings.texi
+++ b/doc/ref/new-docstrings.texi
@@ -304,9 +304,11 @@ If @var{l} does not hold a value for @var{key}, the value
@end deffn
@deffn primitive slot-ref-using-class class obj slot_name
+
@end deffn
@deffn primitive slot-set-using-class! class obj slot_name value
+
@end deffn
@deffn primitive class-of x
@@ -319,33 +321,43 @@ on the C level which depends on the loaded GOOPS modules.
@end deffn
@deffn primitive %method-more-specific? m1 m2 targs
+
@end deffn
@deffn primitive find-method . l
+
@end deffn
@deffn primitive primitive-generic-generic subr
+
@end deffn
@deffn primitive enable-primitive-generic! . subrs
+
@end deffn
@deffn primitive generic-capability? proc
+
@end deffn
@deffn primitive %invalidate-method-cache! gf
+
@end deffn
@deffn primitive %invalidate-class class
+
@end deffn
@deffn primitive %modify-class old new
+
@end deffn
@deffn primitive %modify-instance old new
+
@end deffn
@deffn primitive %set-object-setter! obj setter
+
@end deffn
@deffn primitive %allocate-instance class initargs
@@ -367,9 +379,11 @@ Set the slot named @var{slot_name} of @var{obj} to @var{value}.
@end deffn
@deffn primitive slot-exists-using-class? class obj slot_name
+
@end deffn
@deffn primitive slot-bound-using-class? class obj slot_name
+
@end deffn
@deffn primitive %fast-slot-set! obj index value
@@ -460,9 +474,11 @@ Return @code{#t} if @var{obj} is an instance.
@end deffn
@deffn primitive %inherit-magic! class dsupers
+
@end deffn
@deffn primitive %prep-layout! class
+
@end deffn
@deffn primitive %initialize-object obj initargs
@@ -530,3 +546,56 @@ this specific @var{msg}. Do nothing otherwise.
The argument @var{msgs} should be a list of strings;
they are printed in turn, each one followed by a newline.
@end deffn
+
+@deffn primitive valid-object-procedure? proc
+Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}.
+@end deffn
+
+@deffn primitive %get-pre-modules-obarray
+Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system.
+@end deffn
+
+@deffn primitive standard-interface-eval-closure module
+Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added.
+@end deffn
+
+@deffn primitive env-module env
+Return the module of @var{ENV}, a lexical environment.
+@end deffn
+
+@deffn primitive load-extension lib init
+Load and initilize the extension designated by LIB and INIT.
+When there is no pre-registered function for LIB/INIT, this is
+equivalent to
+
+@lisp
+(dynamic-call INIT (dynamic-link LIB))
+@end lisp
+
+When there is a pre-registered function, that function is called
+instead.
+
+Normally, there is no pre-registered function. This option exists
+only for situations where dynamic linking is unavailable or unwanted.
+In that case, you would statically link your program with the desired
+library, and register its init function right after Guile has been
+initialized.
+
+LIB should be a string denoting a shared library without any file type
+suffix such as ".so". The suffix is provided automatically. It
+should also not contain any directory components. Libraries that
+implement Guile Extensions should be put into the normal locations for
+shared libraries. We recommend to use the naming convention
+libguile-bla-blum for a extension related to a module `(bla blum)'.
+
+The normal way for a extension to be used is to write a small Scheme
+file that defines a module, and to load the extension into this
+module. When the module is auto-loaded, the extension is loaded as
+well. For example,
+
+@lisp
+(define-module (bla blum))
+
+(load-extension "libguile-bla-blum" "bla_init_blum")
+@end lisp
+@end deffn
diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
index 4d4473422..f2237f2c1 100644
--- a/doc/ref/posix.texi
+++ b/doc/ref/posix.texi
@@ -1457,26 +1457,35 @@ all platforms.
@end deffn
@deffn primitive setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds
-
Set the timer specified by @var{which_timer} according to the given
@var{interval_seconds}, @var{interval_microseconds},
-@var{value_seconds}, and @var{value_microseconds} values, and return
-information about the timer's previous setting. The timers available
-are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL}, and @code{ITIMER_PROF},
-and the return value will be a list of two cons pairs representing the
+@var{value_seconds}, and @var{value_microseconds} values.
+
+Return information about the timer's previous setting.
+Errors are handled as described in the guile info pages under ``POSIX
+Interface Conventions''.
+
+The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
+and @code{ITIMER_PROF}.
+
+The return value will be a list of two cons pairs representing the
current state of the given timer. The first pair is the seconds and
-microseconds of the timer @code{it_interval}, and the second pair is the
-seconds and microseconds of the timer @code{it_value}.
+microseconds of the timer @code{it_interval}, and the second pair is
+the seconds and microseconds of the timer @code{it_value}.
@end deffn
@deffn primitive getitimer which_timer
-Return information about the timer specified by @var{which_timer}. The
-timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL}, and
-@code{ITIMER_PROF}, and the return value will be a list of two cons
-pairs representing the current state of the given timer. The first pair
-is the seconds and microseconds of the timer @code{it_interval}, and the
-second pair is the seconds and microseconds of the timer
-@code{it_value}.
+Return information about the timer specified by @var{which_timer}
+Errors are handled as described in the guile info pages under ``POSIX
+Interface Conventions''.
+
+The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
+and @code{ITIMER_PROF}.
+
+The return value will be a list of two cons pairs representing the
+current state of the given timer. The first pair is the seconds and
+microseconds of the timer @code{it_interval}, and the second pair is
+the seconds and microseconds of the timer @code{it_value}.
@end deffn
@@ -2310,7 +2319,7 @@ documentation before using them.
@deffn primitive crypt key salt
Encrypt @var{key} using @var{salt} as the salt value to the
-crypt(3) library call
+crypt(3) library call.
@end deffn
@code{getpass} is no encryption procedure at all, but it is often used
diff --git a/doc/ref/preface.texi b/doc/ref/preface.texi
index 90e53e9ac..0a6ce32ba 100644
--- a/doc/ref/preface.texi
+++ b/doc/ref/preface.texi
@@ -6,8 +6,8 @@ This reference manual documents Guile, GNU's Ubiquitous Intelligent
Language for Extensions. It describes how to use Guile in many useful
and interesting ways.
-This is edition 1.0 of the reference manual, and corresponds to Guile
-version @value{VERSION}.
+This is edition @value{MANUAL_EDITION} of the reference manual, and
+corresponds to Guile version @value{VERSION}.
@end iftex
@@ -74,57 +74,74 @@ do not wish that, delete this exception notice.
@chapter Layout of this Manual
@end ifnottex
-This manual is divided into five parts.
+The manual is divided into three parts.
@strong{Part I: Introduction to Guile} provides an overview of what
Guile is and how you can use it. A whirlwind tour shows how Guile can
be used interactively and as a script interpreter, how to link Guile
into your own applications, and how to write modules of interpreted and
-compiled code for use with Guile. All of the ideas introduced here are
-documented in full by the later parts of the manual.
-
-@strong{Part II: Guile Scheme} documents the core Scheme language and
-features that Guile implements. Although the basis for this is the
-Scheme language described in R5RS, this part of the manual does not
-assume any prior familiarity with R5RS in particular, or with Scheme in
-general. Basic Scheme concepts, standard aspects of the Scheme language
-and Guile extensions on top of R5RS are all documented from scratch, and
-organized by functionality rather than by the defining standards.
-
-@strong{Part III: Guile Modules} describes some important modules,
+compiled code for use with Guile. Everything introduced here is
+documented again and in full by the later parts of the manual. This
+part also explains how to obtain and install new versions of Guile, and
+how to report bugs effectively.
+
+@strong{Part II: Programming with Guile} documents all aspects of
+practical programming using Guile. This covers both the Scheme level
+--- where we provide an introduction to the key ideas of the Scheme
+language --- and use of Guile's @code{scm} interface to write new
+primitives and objects in C, and to incorporate Guile into a C
+application. It also covers the use of Guile as a POSIX compliant
+script interpreter, and how to use the Guile debugger.
+
+@c @strong{Part V: Extending Applications Using Guile} explains the options
+@c available for using Guile as a application extension language. At the
+@c simpler end of the scale, an application might use Guile to define some
+@c application-specific primitives in C and then load an application Scheme
+@c file. In this case most of the application code is written on the
+@c Scheme level, and uses the application-specific primitives as an
+@c extension to standard Scheme. At the other end of the scale, an
+@c application might be predominantly written in C --- with its main
+@c control loop implemented in C --- but make occasional forays into Scheme
+@c to, say, read configuration data or run user-defined customization code.
+@c This part of the manual covers the complete range of application
+@c extension options.
+
+@strong{Part III: Guile API Reference} documents Guile's core API. Most
+of the variables and procedures in Guile's core programming interface
+are available in both Scheme and C, and are related systematically such
+that the C interface can be inferred from the Scheme interface and vice
+versa. Therefore this part of the manual documents the Guile API in
+functionality-based groups with the Scheme and C interfaces presented
+side by side. Where the Scheme and C interfaces for a particular
+functional area do differ --- which is sometimes inevitable, given the
+differences in the structure of the two languages --- this is pointed
+out and explained. In all cases the overriding principle is that all
+the reference documentation for a given functional area is grouped
+together.
+
+@c the core Scheme language and features that Guile implements. Although
+@c the basis for this is the Scheme language described in R5RS, this part
+@c of the manual does not assume any prior familiarity with R5RS in
+@c particular, or with Scheme in general. Basic Scheme concepts, standard
+@c aspects of the Scheme language and Guile extensions on top of R5RS are
+@c all documented from scratch, and organized by functionality rather than
+@c by the defining standards.
+
+@strong{Part IV: Guile Modules} describes some important modules,
distributed as part of the Guile distribution, that extend the
-functionality provided by the Guile Scheme core, most notably:
+functionality provided by the Guile Scheme core. Two important examples
+are:
@itemize @bullet
@item
the POSIX module, which provides Scheme level procedures for system and
-network programming, conforming to the POSIX standard
+network programming that conform to the POSIX standard
@item
the SLIB module, which makes Aubrey Jaffer's portable Scheme library
available for use in Guile.
@end itemize
-@strong{Part IV: Guile Scripting} documents the use of Guile as a script
-interpreter, and illustrates this with a series of examples.
-
-@strong{Part V: Extending Applications Using Guile} explains the options
-available for using Guile as a application extension language. At the
-simpler end of the scale, an application might use Guile to define some
-application-specific primitives in C and then load an application Scheme
-file. In this case most of the application code is written on the
-Scheme level, and uses the application-specific primitives as an
-extension to standard Scheme. At the other end of the scale, an
-application might be predominantly written in C --- with its main
-control loop implemented in C --- but make occasional forays into Scheme
-to, say, read configuration data or run user-defined customization code.
-This part of the manual covers the complete range of application
-extension options.
-
-Finally, the appendices explain how to obtain the latest version of
-Guile, how to install it, where to find modules to work with Guile, and
-how to use the Guile debugger.
-
@iftex
@section Manual Conventions
diff --git a/doc/ref/program.texi b/doc/ref/program.texi
new file mode 100644
index 000000000..b6d268981
--- /dev/null
+++ b/doc/ref/program.texi
@@ -0,0 +1,199 @@
+@page
+@node Programming Options
+@chapter Programming Options in Guile
+
+What does it mean to program using Guile?
+
+If you are an application developer, and want to combine Guile in some
+way with your application, there is a range of possibilities available
+to you@dots{}
+
+@itemize @bullet
+@item
+You could choose to write your whole application in Scheme (or one of
+the other high level languages that Guile supports through translation),
+and simply use Guile as an interpreter (and hopefully in the future a
+compiler) for Scheme.
+
+@item
+You could write a small amount of C code that implements domain-specific
+@dfn{primitive} functions for your application and connects these to the
+Scheme level of Guile, and then write the rest of your application,
+using these application-specific primitives, in Scheme.
+
+@item
+You could write almost all of your application in C, and only call out
+to Guile occasionally for specific actions such as reading a
+configuration file or executing a user-specified extension.
+@end itemize
+
+Underlying these choices are two basic questions.
+
+@itemize @bullet
+@item
+Which parts of the application do you write in C, and which in Scheme
+(or another high level translated language)?
+
+@item
+How do you design the interface between the C and Scheme parts of your
+application?
+@end itemize
+
+These are of course design questions, and the right design for any given
+application will always depend upon the particular requirements that you
+are trying to meet. In the Guile world, however, there are some
+generally applicable considerations that can help you when searching for
+the answers.
+
+@menu
+* Available Functionality:: What functionality is already available?
+* Basic Constraints:: Functional and performance constraints.
+* Style Choices:: Your preferred programming style.
+* Program Control:: What controls program execution?
+* User Programming:: How about application users?
+@end menu
+
+
+@node Available Functionality
+@section What Functionality is Already Available?
+
+Suppose, for the sake of argument, that you would prefer to write your
+whole application in Scheme. Then the API available to you consists of:
+
+@itemize @bullet
+@item
+standard Scheme
+
+@item
+plus the extensions to standard Scheme provided by
+Guile in its core distribution
+
+@item
+plus any additional functionality that you or others have packaged so
+that it can be loaded as a Guile Scheme module.
+@end itemize
+
+A module in the last category can either be a pure Scheme module --- in
+other words a collection of utility procedures coded in Scheme --- or a
+module that provides a Scheme interface to an extension library coded in
+C --- in other words a nice package where someone else has done the work
+of wrapping up some useful C code for you. The set of available modules
+is growing quickly and already includes such useful examples as
+@code{(gtk gtk)}, which makes Gtk+ drawing functions available in
+Scheme, and @code{(database postgres)}, which provides SQL access to a
+Postgres database.
+
+In practice, therefore, it is quite feasible that your application can
+be implemented by combining together a selection of pre-existing modules
+with new application code written in Scheme, and approach may
+suffice for the application that you want to write.
+
+If it does not suffice, because the functionality that your application
+needs is not already available in this form (and assuming that it's
+impossible or unacceptable for performance reasons to write the new
+functionality in Scheme), you will need to write some C code.
+
+@itemize @bullet
+@item
+If the required function is already written (e.g. in a library), you
+only need a little glue to connect it to the world of Guile.
+
+@item
+If not, you need to write the basic code as well.
+@end itemize
+
+In either case, two general considerations are important. Firstly, what
+is the interface by which the functionality is presented to the Scheme
+world? Does the interface consist only of function calls (for example,
+a simple drawing interface), or does it need to include @dfn{objects} of
+some kind that can be passed between C and Scheme and manipulated by
+both worlds. Secondly, how does the lifetime and memory management of
+objects in the C code relate to the garbage collection governed approach
+of Scheme objects? In the case where the basic C code is not already
+written, most of the difficulties of memory management can be avoided by
+using Guile's C interface features from the start.
+
+For further information, tips and guidelines on writing C code for
+Guile, or for connecting existing C code to the Guile world, see
+REFFIXME.
+
+
+@node Basic Constraints
+@section Functional and Performance Constraints
+
+
+@node Style Choices
+@section Your Preferred Programming Style
+
+
+@node Program Control
+@section What Controls Program Execution?
+
+What indeed?
+
+
+@node User Programming
+@section How About Application Users?
+
+So far we have considered what Guile programming means for an
+application developer. But what if you are instead @emph{using} an
+existing Guile-based application, and want to know what your
+options are for programming and extending this application?
+
+The answer to this question varies from one application to another,
+because the options available depend inevitably on whether the
+application developer has provided any hooks for you to hang your own
+code on and, if there are such hooks, what they allow you to
+do.@footnote{Of course, in the world of free software, you always have
+the freedom to modify the application's source code to your own
+requirements. Here we are concerned with the extension options that the
+application has provided for without your needing to modify its source
+code.} For example@dots{}
+
+@itemize @bullet
+@item
+If the application permits you to load and execute any Guile code, the
+world is your oyster. You can extend the application in any way that
+you choose.
+
+@item
+A more cautious application might allow you to load and execute Guile
+code, but only in a @dfn{safe} environment, where the interface
+available is restricted by the application from the standard Guile API.
+
+@item
+Or a really fearful application might not provide a hook to really
+execute user code at all, but just use Scheme syntax as a convenient way
+for users to specify application data or configuration options.
+@end itemize
+
+In the last two cases, what you can do is, by definition, restricted by
+the application, and you should refer to the application's own manual to
+find out your options.
+
+The most well known example of the first case is Emacs, with its
+extension language Emacs Lisp: as well as being a text editor, Emacs
+supports the loading and execution of arbitrary Emacs Lisp code. The
+result of such openness has been dramatic: Emacs now benefits from
+user-contributed Emacs Lisp libraries that extend the basic editing
+function to do everything from reading news to psychoanalysis and
+playing adventure games. The only limitation is that extensions are
+restricted to the functionality provided by Emacs's built-in set of
+primitive operations. For example, you can interact and display data by
+manipulating the contents of an Emacs buffer, but you can't popup and
+draw a window with a layout that is totally different to the Emacs
+standard.
+
+This situation with a Guile application that supports the loading of
+arbitrary user code is similar, except perhaps even more so, because
+Guile also supports the loading of extension libraries written in C.
+This last point enables user code to add new primitive operations to
+Guile, and so to bypass the limitation present in Emacs Lisp.
+
+At this point, the distinction between an application developer and an
+application user becomes rather blurred. Instead of seeing yourself as
+a user extending an application, you could equally well say that you are
+developing a new application of your own using some of the primitive
+functionality provided by the original application. As such, all the
+discussions of the preceding sections of this chapter are relevant to
+how you can proceed with developing your extension.
diff --git a/doc/ref/scheme-binding.texi b/doc/ref/scheme-binding.texi
index b37bced03..5e476141e 100644
--- a/doc/ref/scheme-binding.texi
+++ b/doc/ref/scheme-binding.texi
@@ -233,7 +233,7 @@ bound in expression, you can use the @code{bound?} macro from the module
@c NJFIXME explain [env]
@deffn primitive defined? sym [env]
-Return @code{#t} if @var{sym} is defined in the top-level environment.
+Return @code{#t} if @var{sym} is defined in the lexical environment @var{env}. When @var{env} is not specified, look in the top-level environment as defined by the current module.
@end deffn
diff --git a/doc/ref/scheme-control.texi b/doc/ref/scheme-control.texi
index dd5f9be53..d7b95151b 100644
--- a/doc/ref/scheme-control.texi
+++ b/doc/ref/scheme-control.texi
@@ -12,6 +12,7 @@
* Exceptions:: Throwing and catching exceptions.
* Error Reporting:: Procedures for signaling errors.
* Dynamic Wind:: Guarding against non-local entrance/exit.
+* Handling Errors:: How to handle errors in C code.
@end menu
@@ -818,6 +819,143 @@ a-cont
@result{} special-binding
@end lisp
@end deffn
+
+
+@node Handling Errors
+@section How to Handle Errors in C Code
+
+Error handling is based on @code{catch} and @code{throw}. Errors are
+always thrown with a @var{key} and four arguments:
+
+@itemize @bullet
+@item
+@var{key}: a symbol which indicates the type of error. The symbols used
+by libguile are listed below.
+
+@item
+@var{subr}: the name of the procedure from which the error is thrown, or
+@code{#f}.
+
+@item
+@var{message}: a string (possibly language and system dependent)
+describing the error. The tokens @code{~A} and @code{~S} can be
+embedded within the message: they will be replaced with members of the
+@var{args} list when the message is printed. @code{~A} indicates an
+argument printed using @code{display}, while @code{~S} indicates an
+argument printed using @code{write}. @var{message} can also be
+@code{#f}, to allow it to be derived from the @var{key} by the error
+handler (may be useful if the @var{key} is to be thrown from both C and
+Scheme).
+
+@item
+@var{args}: a list of arguments to be used to expand @code{~A} and
+@code{~S} tokens in @var{message}. Can also be @code{#f} if no
+arguments are required.
+
+@item
+@var{rest}: a list of any additional objects required. e.g., when the
+key is @code{'system-error}, this contains the C errno value. Can also
+be @code{#f} if no additional objects are required.
+@end itemize
+
+In addition to @code{catch} and @code{throw}, the following Scheme
+facilities are available:
+
+@deffn primitive scm-error key subr message args rest
+Throw an error, with arguments
+as described above.
+@end deffn
+
+@deffn procedure error msg arg @dots{}
+Throw an error using the key @code{'misc-error}. The error
+message is created by displaying @var{msg} and writing the @var{args}.
+@end deffn
+
+The following are the error keys defined by libguile and the situations
+in which they are used:
+
+@itemize @bullet
+@item
+@code{error-signal}: thrown after receiving an unhandled fatal signal
+such as SIGSEV, SIGBUS, SIGFPE etc. The @var{rest} argument in the throw
+contains the coded signal number (at present this is not the same as the
+usual Unix signal number).
+
+@item
+@code{system-error}: thrown after the operating system indicates an
+error condition. The @var{rest} argument in the throw contains the
+errno value.
+
+@item
+@code{numerical-overflow}: numerical overflow.
+
+@item
+@code{out-of-range}: the arguments to a procedure do not fall within the
+accepted domain.
+
+@item
+@code{wrong-type-arg}: an argument to a procedure has the wrong thpe.
+
+@item
+@code{wrong-number-of-args}: a procedure was called with the wrong number
+of arguments.
+
+@item
+@code{memory-allocation-error}: memory allocation error.
+
+@item
+@code{stack-overflow}: stack overflow error.
+
+@item
+@code{regex-error}: errors generated by the regular expression library.
+
+@item
+@code{misc-error}: other errors.
+@end itemize
+
+
+@subsection C Support
+
+SCM scm_error (SCM key, char *subr, char *message, SCM args, SCM rest)
+
+Throws an error, after converting the char * arguments to Scheme strings.
+subr is the Scheme name of the procedure, NULL is converted to #f.
+Likewise a NULL message is converted to #f.
+
+The following procedures invoke scm_error with various error keys and
+arguments. The first three call scm_error with the system-error key
+and automatically supply errno in the "rest" argument: scm_syserror
+generates messages using strerror, scm_sysmissing is used when
+facilities are not available. Care should be taken that the errno
+value is not reset (e.g. due to an interrupt).
+
+@itemize @bullet
+@item
+void scm_syserror (char *subr);
+@item
+void scm_syserror_msg (char *subr, char *message, SCM args);
+@item
+void scm_sysmissing (char *subr);
+@item
+void scm_num_overflow (char *subr);
+@item
+void scm_out_of_range (char *subr, SCM bad_value);
+@item
+void scm_wrong_num_args (SCM proc);
+@item
+void scm_wrong_type_arg (char *subr, int pos, SCM bad_value);
+@item
+void scm_memory_error (char *subr);
+@item
+static void scm_regex_error (char *subr, int code); (only used in rgx.c).
+@end itemize
+
+Exception handlers can also be installed from C, using
+scm_internal_catch, scm_lazy_catch, or scm_stack_catch from
+libguile/throw.c. These have not yet been documented, however the
+source contains some useful comments.
+
+
@c Local Variables:
@c TeX-master: "guile.texi"
@c End:
diff --git a/doc/ref/scheme-data.texi b/doc/ref/scheme-data.texi
index 0adf9abfc..235644c63 100755
--- a/doc/ref/scheme-data.texi
+++ b/doc/ref/scheme-data.texi
@@ -956,32 +956,33 @@ Return the hyperbolic arctangent of @var{x}.
@subsection Bitwise Operations
@deffn primitive logand n1 n2
-Return the integer which is the bit-wise AND of the two integer
-arguments.
+Return the bitwise AND of the integer arguments.
@lisp
-(number->string (logand #b1100 #b1010) 2)
- @result{} "1000"
+(logand) @result{} -1
+(logand 7) @result{} 7
+(logand #b111 #b011 #b001) @result{} 1
@end lisp
@end deffn
@deffn primitive logior n1 n2
-Return the integer which is the bit-wise OR of the two integer
-arguments.
+Return the bitwise OR of the integer arguments.
@lisp
-(number->string (logior #b1100 #b1010) 2)
- @result{} "1110"
+(logior) @result{} 0
+(logior 7) @result{} 7
+(logior #b000 #b001 #b011) @result{} 3
@end lisp
@end deffn
@deffn primitive logxor n1 n2
-Return the integer which is the bit-wise XOR of the two integer
-arguments.
-
+Return the bitwise XOR of the integer arguments. A bit is
+set in the result if it is set in an odd number of arguments.
@lisp
-(number->string (logxor #b1100 #b1010) 2)
- @result{} "110"
+(logxor) @result{} 0
+(logxor 7) @result{} 7
+(logxor #b000 #b001 #b011) @result{} 2
+(logxor #b000 #b001 #b011 #b011) @result{} 1
@end lisp
@end deffn
@@ -1468,16 +1469,17 @@ Split the string @var{str} into the a list of the substrings delimited
by appearances of the character @var{chr}. Note that an empty substring
between separator characters will result in an empty string in the
result list.
+
@lisp
-(string-split "root:x:0:0:root:/root:/bin/bash" #\:)
+(string-split "root:x:0:0:root:/root:/bin/bash" #:)
@result{}
("root" "x" "0" "0" "root" "/root" "/bin/bash")
-(string-split "::" #\:)
+(string-split "::" #:)
@result{}
("" "" "")
-(string-split "" #\:)
+(string-split "" #:)
@result{}
("")
@end lisp
@@ -1554,7 +1556,7 @@ y
@deffnx primitive substring-move-left! str1 start1 end1 str2 start2
@deffnx primitive substring-move-right! str1 start1 end1 str2 start2
Copy the substring of @var{str1} bounded by @var{start1} and @var{end1}
-into @var{str2} beginning at position @var{end2}.
+into @var{str2} beginning at position @var{start2}.
@code{substring-move-right!} begins copying from the rightmost character
and moves left, and @code{substring-move-left!} copies from the leftmost
character moving right.
@@ -1916,6 +1918,20 @@ Match the compiled regular expression @var{rx} against
provided, begin matching from that position in the string.
Return a match structure describing the results of the match,
or @code{#f} if no match could be found.
+
+The @var{flags} arguments change the matching behavior.
+The following flags may be supplied:
+
+@table @code
+@item regexp/notbol
+Operator @samp{^} always fails (unless @code{regexp/newline}
+is used). Use this when the beginning of the string should
+not be considered the beginning of a line.
+@item regexp/noteol
+Operator @samp{$} always fails (unless @code{regexp/newline}
+is used). Use this when the end of the string should not be
+considered the end of a line.
+@end table
@end deffn
@deffn primitive regexp? obj
@@ -2394,7 +2410,7 @@ part of an object returned as the value of a literal expression
Report on Scheme}) or by a call to the @code{read} procedure,
and its name contains alphabetic characters, then the string
returned will contain characters in the implementation's
-preferred standard case--some implementations will prefer
+preferred standard case---some implementations will prefer
upper case, others lower case. If the symbol was returned by
@code{string->symbol}, the case of characters in the string
returned will be the same as the case in the string that was
@@ -2541,20 +2557,12 @@ Return the built-in variable with the name @var{name}.
Then use @code{variable-ref} to access its value.
@end deffn
-@deffn primitive make-undefined-variable [name-hint]
-Return a variable object initialized to an undefined value.
-If given, uses @var{name-hint} as its internal (debugging)
-name, otherwise just treat it as an anonymous variable.
-Remember, of course, that multiple bindings to the same
-variable may exist, so @var{name-hint} is just that---a hint.
+@deffn primitive make-undefined-variable
+Return a variable that is initially unbound.
@end deffn
-@deffn primitive make-variable init [name-hint]
-Return a variable object initialized to value @var{init}.
-If given, uses @var{name-hint} as its internal (debugging)
-name, otherwise just treat it as an anonymous variable.
-Remember, of course, that multiple bindings to the same
-variable may exist, so @var{name-hint} is just that---a hint.
+@deffn primitive make-variable init
+Return a variable initialized to value @var{init}.
@end deffn
@deffn primitive variable-bound? var
@@ -2576,7 +2584,7 @@ value. Return an unspecified value.
@deffn primitive variable? obj
Return @code{#t} iff @var{obj} is a variable object, else
-return @code{#f}
+return @code{#f}.
@end deffn
diff --git a/doc/ref/scheme-debug.texi b/doc/ref/scheme-debug.texi
index d9387f5d0..170d7e382 100644
--- a/doc/ref/scheme-debug.texi
+++ b/doc/ref/scheme-debug.texi
@@ -173,8 +173,8 @@ Return the identifier given to @var{stack} by @code{start-stack}.
Return the length of @var{stack}.
@end deffn
-@deffn primitive stack-ref stack i
-Return the @var{i}'th frame from @var{stack}.
+@deffn primitive stack-ref stack index
+Return the @var{index}'th frame from @var{stack}.
@end deffn
@deffn primitive stack? obj
diff --git a/doc/ref/scheme-indices.texi b/doc/ref/scheme-indices.texi
index 03a21bb30..46a87b3d8 100644
--- a/doc/ref/scheme-indices.texi
+++ b/doc/ref/scheme-indices.texi
@@ -1,13 +1,13 @@
@page
@node R5RS Index
-@chapter R5RS Index
+@unnumbered R5RS Index
@printindex rn
@page
@node Guile Extensions Index
-@chapter Guile Extensions Index
+@unnumbered Guile Extensions Index
@printindex ge
diff --git a/doc/ref/scheme-io.texi b/doc/ref/scheme-io.texi
index 07a258868..a121823a5 100644
--- a/doc/ref/scheme-io.texi
+++ b/doc/ref/scheme-io.texi
@@ -12,6 +12,7 @@
* Block Reading and Writing:: Reading and writing blocks of text.
* Default Ports:: Defaults for input, output and errors.
* Port Types:: Types of port and how to make them.
+* I/O Extensions:: Using and extending ports in C.
@end menu
@@ -119,8 +120,20 @@ unread characters will be read again in last-in first-out order. If
@end deffn
@deffn primitive drain-input port
-Drain @var{port}'s read buffers (including any pushed-back
-characters) and return the content as a single string.
+This procedure clears a port's input buffers, similar
+to the way that force-output clears the output buffer. The
+contents of the buffers are returned as a single string, e.g.,
+
+@lisp
+(define p (open-input-file ...))
+(drain-input p) => empty string, nothing buffered yet.
+(unread-char (read-char p) p)
+(drain-input p) => initial chars from p, up to the buffer size.
+@end lisp
+
+Draining the buffers may be useful for cleanly finishing
+buffered I/O so that the file descriptor can be used directly
+for further input.
@end deffn
@deffn primitive port-column port
@@ -419,7 +432,7 @@ The Block-string-I/O module can be accessed with:
It currently contains procedures that help to implement the
@code{(scsh rw)} module in guile-scsh.
-@deffn primitive read-string!/partial str [port_or_fdes start end]
+@deffn primitive read-string!/partial str [port_or_fdes [start [end]]]
Read characters from a port or file descriptor into a
string @var{str}. A port must have an underlying file
descriptor --- a so-called fport. This procedure is
@@ -830,6 +843,221 @@ modes for this port: see the documentation for @code{open-file} in
@end deffn
+@node I/O Extensions
+@section Using and Extending Ports in C
+
+@menu
+* C Port Interface:: Using ports from C.
+* Port Implementation:: How to implement a new port type in C.
+@end menu
+
+
+@node C Port Interface
+@subsection C Port Interface
+
+This section describes how to use Scheme ports from C.
+
+@subsubsection Port basics
+
+There are two main data structures. A port type object (ptob) is of
+type @code{scm_ptob_descriptor}. A port instance is of type
+@code{scm_port}. Given an @code{SCM} variable which points to a port,
+the corresponding C port object can be obtained using the
+@code{SCM_PTAB_ENTRY} macro. The ptob can be obtained by using
+@code{SCM_PTOBNUM} to give an index into the @code{scm_ptobs}
+global array.
+
+@subsubsection Port buffers
+
+An input port always has a read buffer and an output port always has a
+write buffer. However the size of these buffers is not guaranteed to be
+more than one byte (e.g., the @code{shortbuf} field in @code{scm_port}
+which is used when no other buffer is allocated). The way in which the
+buffers are allocated depends on the implementation of the ptob. For
+example in the case of an fport, buffers may be allocated with malloc
+when the port is created, but in the case of an strport the underlying
+string is used as the buffer.
+
+@subsubsection The @code{rw_random} flag
+
+Special treatment is required for ports which can be seeked at random.
+Before various operations, such as seeking the port or changing from
+input to output on a bidirectional port or vice versa, the port
+implemention must be given a chance to update its state. The write
+buffer is updated by calling the @code{flush} ptob procedure and the
+input buffer is updated by calling the @code{end_input} ptob procedure.
+In the case of an fport, @code{flush} causes buffered output to be
+written to the file descriptor, while @code{end_input} causes the
+descriptor position to be adjusted to account for buffered input which
+was never read.
+
+The special treatment must be performed if the @code{rw_random} flag in
+the port is non-zero.
+
+@subsubsection The @code{rw_active} variable
+
+The @code{rw_active} variable in the port is only used if
+@code{rw_random} is set. It's defined as an enum with the following
+values:
+
+@table @code
+@item SCM_PORT_READ
+the read buffer may have unread data.
+
+@item SCM_PORT_WRITE
+the write buffer may have unwritten data.
+
+@item SCM_PORT_NEITHER
+neither the write nor the read buffer has data.
+@end table
+
+@subsubsection Reading from a port.
+
+To read from a port, it's possible to either call existing libguile
+procedures such as @code{scm_getc} and @code{scm_read_line} or to read
+data from the read buffer directly. Reading from the buffer involves
+the following steps:
+
+@enumerate
+@item
+Flush output on the port, if @code{rw_active} is @code{SCM_PORT_WRITE}.
+
+@item
+Fill the read buffer, if it's empty, using @code{scm_fill_input}.
+
+@item Read the data from the buffer and update the read position in
+the buffer. Steps 2) and 3) may be repeated as many times as required.
+
+@item Set rw_active to @code{SCM_PORT_READ} if @code{rw_random} is set.
+
+@item update the port's line and column counts.
+@end enumerate
+
+@subsubsection Writing to a port.
+
+To write data to a port, calling @code{scm_lfwrite} should be sufficient for
+most purposes. This takes care of the following steps:
+
+@enumerate
+@item
+End input on the port, if @code{rw_active} is @code{SCM_PORT_READ}.
+
+@item
+Pass the data to the ptob implementation using the @code{write} ptob
+procedure. The advantage of using the ptob @code{write} instead of
+manipulating the write buffer directly is that it allows the data to be
+written in one operation even if the port is using the single-byte
+@code{shortbuf}.
+
+@item
+Set @code{rw_active} to @code{SCM_PORT_WRITE} if @code{rw_random}
+is set.
+@end enumerate
+
+
+@node Port Implementation
+@subsection Port Implementation
+
+This section describes how to implement a new port type in C.
+
+As described in the previous section, a port type object (ptob) is
+a structure of type @code{scm_ptob_descriptor}. A ptob is created by
+calling @code{scm_make_port_type}.
+
+All of the elements of the ptob, apart from @code{name}, are procedures
+which collectively implement the port behaviour. Creating a new port
+type mostly involves writing these procedures.
+
+@code{scm_make_port_type} initializes three elements of the structure
+(@code{name}, @code{fill_input} and @code{write}) from its arguments.
+The remaining elements are initialized with default values and can be
+set later if required.
+
+@table @code
+@item name
+A pointer to a NUL terminated string: the name of the port type. This
+is the only element of @code{scm_ptob_descriptor} which is not
+a procedure. Set via the first argument to @code{scm_make_port_type}.
+
+@item mark
+Called during garbage collection to mark any SCM objects that a port
+object may contain. It doesn't need to be set unless the port has
+@code{SCM} components. Set using @code{scm_set_port_mark}.
+
+@item free
+Called when the port is collected during gc. It
+should free any resources used by the port.
+Set using @code{scm_set_port_free}.
+
+@item print
+Called when @code{write} is called on the port object, to print a
+port description. e.g., for an fport it may produce something like:
+@code{#<input: /etc/passwd 3>}. Set using @code{scm_set_port_print}.
+
+@item equalp
+Not used at present. Set using @code{scm_set_port_equalp}.
+
+@item close
+Called when the port is closed, unless it was collected during gc. It
+should free any resources used by the port.
+Set using @code{scm_set_port_close}.
+
+@item write
+Accept data which is to be written using the port. The port implementation
+may choose to buffer the data instead of processing it directly.
+Set via the third argument to @code{scm_make_port_type}.
+
+@item flush
+Complete the processing of buffered output data. Reset the value of
+@code{rw_active} to @code{SCM_PORT_NEITHER}.
+Set using @code{scm_set_port_flush}.
+
+@item end_input
+Perform any synchronisation required when switching from input to output
+on the port. Reset the value of @code{rw_active} to @code{SCM_PORT_NEITHER}.
+Set using @code{scm_set_port_end_input}.
+
+@item fill_input
+Read new data into the read buffer and return the first character. It
+can be assumed that the read buffer is empty when this procedure is called.
+Set via the second argument to @code{scm_make_port_type}.
+
+@item input_waiting
+Return a lower bound on the number of bytes that could be read from the
+port without blocking. It can be assumed that the current state of
+@code{rw_active} is @code{SCM_PORT_NEITHER}.
+Set using @code{scm_set_port_input_waiting}.
+
+@item seek
+Set the current position of the port. The procedure can not make
+any assumptions about the value of @code{rw_active} when it's
+called. It can reset the buffers first if desired by using something
+like:
+
+@example
+ if (pt->rw_active == SCM_PORT_READ)
+ scm_end_input (object);
+ else if (pt->rw_active == SCM_PORT_WRITE)
+ ptob->flush (object);
+@end example
+
+However note that this will have the side effect of discarding any data
+in the unread-char buffer, in addition to any side effects from the
+@code{end_input} and @code{flush} ptob procedures. This is undesirable
+when seek is called to measure the current position of the port, i.e.,
+@code{(seek p 0 SEEK_CUR)}. The libguile fport and string port
+implementations take care to avoid this problem.
+
+The procedure is set using @code{scm_set_port_seek}.
+
+@item truncate
+Truncate the port data to be specified length. It can be assumed that the
+current state of @code{rw_active} is @code{SCM_PORT_NEITHER}.
+Set using @code{scm_set_port_truncate}.
+
+@end table
+
+
@c Local Variables:
@c TeX-master: "guile.texi"
@c End:
diff --git a/doc/ref/scheme-memory.texi b/doc/ref/scheme-memory.texi
index 6a1f21e9c..e29fd8607 100644
--- a/doc/ref/scheme-memory.texi
+++ b/doc/ref/scheme-memory.texi
@@ -202,7 +202,7 @@ Return @code{#t} if @var{obj} is an operator.
@end deffn
@deffn primitive set-object-procedure! obj proc
-Return the object procedure of @var{obj} to @var{proc}.
+Set the object procedure of @var{obj} to @var{proc}.
@var{obj} must be either an entity or an operator.
@end deffn
diff --git a/doc/ref/scheme-options.texi b/doc/ref/scheme-options.texi
index d591008fe..d009a4d01 100644
--- a/doc/ref/scheme-options.texi
+++ b/doc/ref/scheme-options.texi
@@ -335,8 +335,8 @@ Guile's configuration at run time.
@deffnx primitive major-version
@deffnx primitive minor-version
@deffnx primitive micro-version
-Return a string describing Guile's version number, or its major or minor
-version numbers, respectively.
+Return a string describing Guile's version number, or its major, minor
+and micro version numbers, respectively.
@lisp
(version) @result{} "1.6.5"
diff --git a/doc/ref/scm.texi b/doc/ref/scm.texi
index 2cda191d8..948823afb 100644
--- a/doc/ref/scm.texi
+++ b/doc/ref/scm.texi
@@ -101,358 +101,3 @@ argumements, both required and optional; if the Scheme procedure takes a
``rest'' argument, that will be a final argument to the C function. The
C function's arguments, as well as its return type, will be @code{SCM}.
-@c @node Exceptions to the regularity
-@c @section Exceptions to the regularity
-@c
-@c There are some exceptions to the regular structure described above.
-
-
-@page
-@node I/O Extensions
-@chapter Using and Extending Ports in C
-
-@menu
-* C Port Interface:: Using ports from C.
-* Port Implementation:: How to implement a new port type in C.
-@end menu
-
-
-@node C Port Interface
-@section C Port Interface
-
-This section describes how to use Scheme ports from C.
-
-@subsection Port basics
-
-There are two main data structures. A port type object (ptob) is of
-type @code{scm_ptob_descriptor}. A port instance is of type
-@code{scm_port}. Given an @code{SCM} variable which points to a port,
-the corresponding C port object can be obtained using the
-@code{SCM_PTAB_ENTRY} macro. The ptob can be obtained by using
-@code{SCM_PTOBNUM} to give an index into the @code{scm_ptobs}
-global array.
-
-@subsection Port buffers
-
-An input port always has a read buffer and an output port always has a
-write buffer. However the size of these buffers is not guaranteed to be
-more than one byte (e.g., the @code{shortbuf} field in @code{scm_port}
-which is used when no other buffer is allocated). The way in which the
-buffers are allocated depends on the implementation of the ptob. For
-example in the case of an fport, buffers may be allocated with malloc
-when the port is created, but in the case of an strport the underlying
-string is used as the buffer.
-
-@subsection The @code{rw_random} flag
-
-Special treatment is required for ports which can be seeked at random.
-Before various operations, such as seeking the port or changing from
-input to output on a bidirectional port or vice versa, the port
-implemention must be given a chance to update its state. The write
-buffer is updated by calling the @code{flush} ptob procedure and the
-input buffer is updated by calling the @code{end_input} ptob procedure.
-In the case of an fport, @code{flush} causes buffered output to be
-written to the file descriptor, while @code{end_input} causes the
-descriptor position to be adjusted to account for buffered input which
-was never read.
-
-The special treatment must be performed if the @code{rw_random} flag in
-the port is non-zero.
-
-@subsection The @code{rw_active} variable
-
-The @code{rw_active} variable in the port is only used if
-@code{rw_random} is set. It's defined as an enum with the following
-values:
-
-@table @code
-@item SCM_PORT_READ
-the read buffer may have unread data.
-
-@item SCM_PORT_WRITE
-the write buffer may have unwritten data.
-
-@item SCM_PORT_NEITHER
-neither the write nor the read buffer has data.
-@end table
-
-@subsection Reading from a port.
-
-To read from a port, it's possible to either call existing libguile
-procedures such as @code{scm_getc} and @code{scm_read_line} or to read
-data from the read buffer directly. Reading from the buffer involves
-the following steps:
-
-@enumerate
-@item
-Flush output on the port, if @code{rw_active} is @code{SCM_PORT_WRITE}.
-
-@item
-Fill the read buffer, if it's empty, using @code{scm_fill_input}.
-
-@item Read the data from the buffer and update the read position in
-the buffer. Steps 2) and 3) may be repeated as many times as required.
-
-@item Set rw_active to @code{SCM_PORT_READ} if @code{rw_random} is set.
-
-@item update the port's line and column counts.
-@end enumerate
-
-@subsection Writing to a port.
-
-To write data to a port, calling @code{scm_lfwrite} should be sufficient for
-most purposes. This takes care of the following steps:
-
-@enumerate
-@item
-End input on the port, if @code{rw_active} is @code{SCM_PORT_READ}.
-
-@item
-Pass the data to the ptob implementation using the @code{write} ptob
-procedure. The advantage of using the ptob @code{write} instead of
-manipulating the write buffer directly is that it allows the data to be
-written in one operation even if the port is using the single-byte
-@code{shortbuf}.
-
-@item
-Set @code{rw_active} to @code{SCM_PORT_WRITE} if @code{rw_random}
-is set.
-@end enumerate
-
-
-@node Port Implementation
-@section Port Implementation
-
-This section describes how to implement a new port type in C.
-
-As described in the previous section, a port type object (ptob) is
-a structure of type @code{scm_ptob_descriptor}. A ptob is created by
-calling @code{scm_make_port_type}.
-
-All of the elements of the ptob, apart from @code{name}, are procedures
-which collectively implement the port behaviour. Creating a new port
-type mostly involves writing these procedures.
-
-@code{scm_make_port_type} initializes three elements of the structure
-(@code{name}, @code{fill_input} and @code{write}) from its arguments.
-The remaining elements are initialized with default values and can be
-set later if required.
-
-@table @code
-@item name
-A pointer to a NUL terminated string: the name of the port type. This
-is the only element of @code{scm_ptob_descriptor} which is not
-a procedure. Set via the first argument to @code{scm_make_port_type}.
-
-@item mark
-Called during garbage collection to mark any SCM objects that a port
-object may contain. It doesn't need to be set unless the port has
-@code{SCM} components. Set using @code{scm_set_port_mark}.
-
-@item free
-Called when the port is collected during gc. It
-should free any resources used by the port.
-Set using @code{scm_set_port_free}.
-
-@item print
-Called when @code{write} is called on the port object, to print a
-port description. e.g., for an fport it may produce something like:
-@code{#<input: /etc/passwd 3>}. Set using @code{scm_set_port_print}.
-
-@item equalp
-Not used at present. Set using @code{scm_set_port_equalp}.
-
-@item close
-Called when the port is closed, unless it was collected during gc. It
-should free any resources used by the port.
-Set using @code{scm_set_port_close}.
-
-@item write
-Accept data which is to be written using the port. The port implementation
-may choose to buffer the data instead of processing it directly.
-Set via the third argument to @code{scm_make_port_type}.
-
-@item flush
-Complete the processing of buffered output data. Reset the value of
-@code{rw_active} to @code{SCM_PORT_NEITHER}.
-Set using @code{scm_set_port_flush}.
-
-@item end_input
-Perform any synchronisation required when switching from input to output
-on the port. Reset the value of @code{rw_active} to @code{SCM_PORT_NEITHER}.
-Set using @code{scm_set_port_end_input}.
-
-@item fill_input
-Read new data into the read buffer and return the first character. It
-can be assumed that the read buffer is empty when this procedure is called.
-Set via the second argument to @code{scm_make_port_type}.
-
-@item input_waiting
-Return a lower bound on the number of bytes that could be read from the
-port without blocking. It can be assumed that the current state of
-@code{rw_active} is @code{SCM_PORT_NEITHER}.
-Set using @code{scm_set_port_input_waiting}.
-
-@item seek
-Set the current position of the port. The procedure can not make
-any assumptions about the value of @code{rw_active} when it's
-called. It can reset the buffers first if desired by using something
-like:
-
-@example
- if (pt->rw_active == SCM_PORT_READ)
- scm_end_input (object);
- else if (pt->rw_active == SCM_PORT_WRITE)
- ptob->flush (object);
-@end example
-
-However note that this will have the side effect of discarding any data
-in the unread-char buffer, in addition to any side effects from the
-@code{end_input} and @code{flush} ptob procedures. This is undesirable
-when seek is called to measure the current position of the port, i.e.,
-@code{(seek p 0 SEEK_CUR)}. The libguile fport and string port
-implementations take care to avoid this problem.
-
-The procedure is set using @code{scm_set_port_seek}.
-
-@item truncate
-Truncate the port data to be specified length. It can be assumed that the
-current state of @code{rw_active} is @code{SCM_PORT_NEITHER}.
-Set using @code{scm_set_port_truncate}.
-
-@end table
-
-
-@node Handling Errors
-@chapter How to Handle Errors in C Code
-
-Error handling is based on @code{catch} and @code{throw}. Errors are
-always thrown with a @var{key} and four arguments:
-
-@itemize @bullet
-@item
-@var{key}: a symbol which indicates the type of error. The symbols used
-by libguile are listed below.
-
-@item
-@var{subr}: the name of the procedure from which the error is thrown, or
-@code{#f}.
-
-@item
-@var{message}: a string (possibly language and system dependent)
-describing the error. The tokens @code{~A} and @code{~S} can be
-embedded within the message: they will be replaced with members of the
-@var{args} list when the message is printed. @code{~A} indicates an
-argument printed using @code{display}, while @code{~S} indicates an
-argument printed using @code{write}. @var{message} can also be
-@code{#f}, to allow it to be derived from the @var{key} by the error
-handler (may be useful if the @var{key} is to be thrown from both C and
-Scheme).
-
-@item
-@var{args}: a list of arguments to be used to expand @code{~A} and
-@code{~S} tokens in @var{message}. Can also be @code{#f} if no
-arguments are required.
-
-@item
-@var{rest}: a list of any additional objects required. e.g., when the
-key is @code{'system-error}, this contains the C errno value. Can also
-be @code{#f} if no additional objects are required.
-@end itemize
-
-In addition to @code{catch} and @code{throw}, the following Scheme
-facilities are available:
-
-@deffn primitive scm-error key subr message args rest
-Throw an error, with arguments
-as described above.
-@end deffn
-
-@deffn procedure error msg arg @dots{}
-Throw an error using the key @code{'misc-error}. The error
-message is created by displaying @var{msg} and writing the @var{args}.
-@end deffn
-
-The following are the error keys defined by libguile and the situations
-in which they are used:
-
-@itemize @bullet
-@item
-@code{error-signal}: thrown after receiving an unhandled fatal signal
-such as SIGSEV, SIGBUS, SIGFPE etc. The @var{rest} argument in the throw
-contains the coded signal number (at present this is not the same as the
-usual Unix signal number).
-
-@item
-@code{system-error}: thrown after the operating system indicates an
-error condition. The @var{rest} argument in the throw contains the
-errno value.
-
-@item
-@code{numerical-overflow}: numerical overflow.
-
-@item
-@code{out-of-range}: the arguments to a procedure do not fall within the
-accepted domain.
-
-@item
-@code{wrong-type-arg}: an argument to a procedure has the wrong thpe.
-
-@item
-@code{wrong-number-of-args}: a procedure was called with the wrong number
-of arguments.
-
-@item
-@code{memory-allocation-error}: memory allocation error.
-
-@item
-@code{stack-overflow}: stack overflow error.
-
-@item
-@code{regex-error}: errors generated by the regular expression library.
-
-@item
-@code{misc-error}: other errors.
-@end itemize
-
-
-@section C Support
-
-SCM scm_error (SCM key, char *subr, char *message, SCM args, SCM rest)
-
-Throws an error, after converting the char * arguments to Scheme strings.
-subr is the Scheme name of the procedure, NULL is converted to #f.
-Likewise a NULL message is converted to #f.
-
-The following procedures invoke scm_error with various error keys and
-arguments. The first three call scm_error with the system-error key
-and automatically supply errno in the "rest" argument: scm_syserror
-generates messages using strerror, scm_sysmissing is used when
-facilities are not available. Care should be taken that the errno
-value is not reset (e.g. due to an interrupt).
-
-@itemize @bullet
-@item
-void scm_syserror (char *subr);
-@item
-void scm_syserror_msg (char *subr, char *message, SCM args);
-@item
-void scm_sysmissing (char *subr);
-@item
-void scm_num_overflow (char *subr);
-@item
-void scm_out_of_range (char *subr, SCM bad_value);
-@item
-void scm_wrong_num_args (SCM proc);
-@item
-void scm_wrong_type_arg (char *subr, int pos, SCM bad_value);
-@item
-void scm_memory_error (char *subr);
-@item
-static void scm_regex_error (char *subr, int code); (only used in rgx.c).
-@end itemize
-
-Exception handlers can also be installed from C, using
-scm_internal_catch, scm_lazy_catch, or scm_stack_catch from
-libguile/throw.c. These have not yet been documented, however the
-source contains some useful comments.
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index 660d22307..0d958e2ae 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,28 @@
+2001-11-07 Neil Jerram <neil@ossau.uklinux.net>
+
+ * extensions.c (scm_load_extension): Canonicalize docstring
+ whitespace.
+
+ * unif.c (scm_uniform_array_write), ports.c
+ (scm_current_output_port, scm_force_output), dynwind.c
+ (scm_dynamic_wind), scmsigs.c (scm_setitimer, scm_getitimer),
+ filesys.c (scm_open, scm_lstat), struct.c
+ (scm_make_struct_layout), random.c (scm_random,
+ scm_random_solid_sphere_x, scm_random_hollow_sphere_x, strop.c
+ (scm_i_index): Remove superfluous whitespace from end of docstring
+ lines.
+
+ * filesys.c (scm_select), guardians.c (scm_guardian_greedy_p),
+ strings.c (scm_make_string), variable.c (scm_make_variable,
+ scm_make_undefined_variable, scm_variable_p, scm_variable_set_x,
+ scm_variable_bound_p), scmsigs.c (scm_setitimer, scm_getitimer),
+ posix.c (scm_crypt), struct.c (scm_make_vtable_vtable), hashtab.c
+ (scm_hash_fold), ports.c (scm_port_for_each): Remove superfluous
+ newline at end of docstrings.
+
+ * modules.c (scm_set_current_module): Add missing newline to
+ docstring.
+
2001-11-07 Stefan Jahn <stefan@lkcc.org>
* win32-socket.[ch]: New files. Defines Winsock-API error codes
diff --git a/libguile/dynwind.c b/libguile/dynwind.c
index d093861cf..5970dc455 100644
--- a/libguile/dynwind.c
+++ b/libguile/dynwind.c
@@ -82,7 +82,7 @@ SCM_DEFINE (scm_dynamic_wind, "dynamic-wind", 3, 0, 0,
"@lisp\n"
"(define x 'normal-binding)\n"
"@result{} x\n"
- "(define a-cont (call-with-current-continuation \n"
+ "(define a-cont (call-with-current-continuation\n"
" (lambda (escape)\n"
" (let ((old-x x))\n"
" (dynamic-wind\n"
@@ -101,7 +101,7 @@ SCM_DEFINE (scm_dynamic_wind, "dynamic-wind", 3, 0, 0,
" ;;\n"
" (lambda () (set! x old-x)))))))\n"
"\n"
- ";; Prints: \n"
+ ";; Prints:\n"
"special-binding\n"
";; Evaluates to:\n"
"@result{} a-cont\n"
diff --git a/libguile/extensions.c b/libguile/extensions.c
index b549f0fc7..48e39420c 100644
--- a/libguile/extensions.c
+++ b/libguile/extensions.c
@@ -117,36 +117,40 @@ scm_c_load_extension (const char *lib, const char *init)
SCM_DEFINE (scm_load_extension, "load-extension", 2, 0, 0,
(SCM lib, SCM init),
- "Load and initilize the extension designated by LIB and INIT."
-"When there is no pre-registered function for LIB/INIT, this is "
-"equivalent to "
-" "
-" (dynamic-call INIT (dynamic-link LIB)) "
-" "
-"When there is a pre-registered function, that function is called "
-"instead. "
-" "
-"Normally, there is no pre-registered function. This option exists "
-"only for situations where dynamic linking is unavailable or unwanted. "
-"In that case, you would statically link your program with the desired "
-"library, and register its init function right after Guile has been "
-"initialized. "
-" "
-"LIB should be a string denoting a shared library without any file type "
-"suffix such as \".so\". The suffix is provided automatically. It "
-"should also not contain any directory components. Libraries that "
-"implement Guile Extensions should be put into the normal locations for "
-"shared libraries. We recommend to use the naming convention "
-"libguile-bla-blum for a extension related to a module `(bla blum)'. "
-" "
-"The normal way for a extension to be used is to write a small Scheme "
-"file that defines a module, and to load the extension into this "
-"module. When the module is auto-loaded, the extension is loaded as "
-"well. For example, "
-" "
-" (define-module (bla blum)) "
-" "
-" (load-extension \"libguile-bla-blum\" \"bla_init_blum\")")
+ "Load and initilize the extension designated by LIB and INIT.\n"
+ "When there is no pre-registered function for LIB/INIT, this is\n"
+ "equivalent to\n"
+ "\n"
+ "@lisp\n"
+ "(dynamic-call INIT (dynamic-link LIB))\n"
+ "@end lisp\n"
+ "\n"
+ "When there is a pre-registered function, that function is called\n"
+ "instead.\n"
+ "\n"
+ "Normally, there is no pre-registered function. This option exists\n"
+ "only for situations where dynamic linking is unavailable or unwanted.\n"
+ "In that case, you would statically link your program with the desired\n"
+ "library, and register its init function right after Guile has been\n"
+ "initialized.\n"
+ "\n"
+ "LIB should be a string denoting a shared library without any file type\n"
+ "suffix such as \".so\". The suffix is provided automatically. It\n"
+ "should also not contain any directory components. Libraries that\n"
+ "implement Guile Extensions should be put into the normal locations for\n"
+ "shared libraries. We recommend to use the naming convention\n"
+ "libguile-bla-blum for a extension related to a module `(bla blum)'.\n"
+ "\n"
+ "The normal way for a extension to be used is to write a small Scheme\n"
+ "file that defines a module, and to load the extension into this\n"
+ "module. When the module is auto-loaded, the extension is loaded as\n"
+ "well. For example,\n"
+ "\n"
+ "@lisp\n"
+ "(define-module (bla blum))\n"
+ "\n"
+ "(load-extension \"libguile-bla-blum\" \"bla_init_blum\")\n"
+ "@end lisp")
#define FUNC_NAME s_scm_load_extension
{
SCM_VALIDATE_STRING (1, lib);
diff --git a/libguile/filesys.c b/libguile/filesys.c
index 806c8c10f..f891be40e 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -336,7 +336,7 @@ SCM_DEFINE (scm_open, "open", 2, 1, 0,
"Open the file read-only.\n"
"@end defvar\n"
"@defvar O_WRONLY\n"
- "Open the file write-only. \n"
+ "Open the file write-only.\n"
"@end defvar\n"
"@defvar O_RDWR\n"
"Open the file read/write.\n"
@@ -1129,8 +1129,7 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0,
"The @var{usecs} argument is not supported.\n"
"Multiple values are returned instead of a list.\n"
"Duplicates in the input vectors appear only once in output.\n"
- "An additional @code{select!} interface is provided.\n"
- )
+ "An additional @code{select!} interface is provided.")
#define FUNC_NAME s_scm_select
{
struct timeval timeout;
@@ -1387,7 +1386,7 @@ SCM_DEFINE (scm_readlink, "readlink", 1, 0, 0,
SCM_DEFINE (scm_lstat, "lstat", 1, 0, 0,
(SCM str),
"Similar to @code{stat}, but does not follow symbolic links, i.e.,\n"
- "it will return information about a symbolic link itself, not the \n"
+ "it will return information about a symbolic link itself, not the\n"
"file it points to. @var{path} must be a string.")
#define FUNC_NAME s_scm_lstat
{
diff --git a/libguile/guardians.c b/libguile/guardians.c
index 4703bee74..ad9832539 100644
--- a/libguile/guardians.c
+++ b/libguile/guardians.c
@@ -374,7 +374,7 @@ SCM_DEFINE (scm_guardian_destroyed_p, "guardian-destroyed?", 1, 0, 0,
SCM_DEFINE (scm_guardian_greedy_p, "guardian-greedy?", 1, 0, 0,
(SCM guardian),
- "Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.\n")
+ "Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.")
#define FUNC_NAME s_scm_guardian_greedy_p
{
return SCM_BOOL (GREEDY_P (GUARDIAN_DATA (guardian)));
diff --git a/libguile/hashtab.c b/libguile/hashtab.c
index dc5545390..4cf250fae 100644
--- a/libguile/hashtab.c
+++ b/libguile/hashtab.c
@@ -525,7 +525,7 @@ SCM_DEFINE (scm_hash_fold, "hash-fold", 3, 0, 0,
"prior-result is either INIT (for the first application of PROC)\n"
"or the return value of the previous application of PROC.\n"
"For example, @code{(hash-fold acons () tab)} will convert a hash\n"
- "table into an a-list of key-value pairs.\n")
+ "table into an a-list of key-value pairs.")
#define FUNC_NAME s_scm_hash_fold
{
SCM_VALIDATE_PROC (1,proc);
diff --git a/libguile/modules.c b/libguile/modules.c
index 1c458683e..f304df3df 100644
--- a/libguile/modules.c
+++ b/libguile/modules.c
@@ -77,7 +77,7 @@ static void scm_post_boot_init_modules (void);
SCM_DEFINE (scm_set_current_module, "set-current-module", 1, 0, 0,
(SCM module),
- "Set the current module to @var{module} and return"
+ "Set the current module to @var{module} and return\n"
"the previous current module.")
#define FUNC_NAME s_scm_set_current_module
{
diff --git a/libguile/ports.c b/libguile/ports.c
index 7a02b1308..0250f503c 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -364,7 +364,7 @@ SCM_DEFINE (scm_current_input_port, "current-input-port", 0, 0, 0,
SCM_DEFINE (scm_current_output_port, "current-output-port", 0, 0, 0,
(),
"Return the current output port. This is the default port used\n"
- "by many output procedures. Initially, \n"
+ "by many output procedures. Initially,\n"
"@code{current-output-port} returns the @dfn{standard output} in\n"
"Unix and C terminology.")
#define FUNC_NAME s_scm_current_output_port
@@ -724,7 +724,7 @@ SCM_DEFINE (scm_port_for_each, "port-for-each", 1, 0, 0,
"@var{proc} is applied exactly once to every port that exists\n"
"in the system at the time @var{port-for-each} is invoked.\n"
"Changes to the port table while @var{port-for-each} is running\n"
- "have no effect as far as @var{port-for-each} is concerned.\n")
+ "have no effect as far as @var{port-for-each} is concerned.")
#define FUNC_NAME s_scm_port_for_each
{
long i;
@@ -819,7 +819,7 @@ SCM_DEFINE (scm_eof_object_p, "eof-object?", 1, 0, 0,
SCM_DEFINE (scm_force_output, "force-output", 0, 1, 0,
(SCM port),
"Flush the specified output port, or the current output port if @var{port}\n"
- "is omitted. The current output buffer contents are passed to the \n"
+ "is omitted. The current output buffer contents are passed to the\n"
"underlying port implementation (e.g., in the case of fports, the\n"
"data will be written to the file and the output buffer will be cleared.)\n"
"It has no effect on an unbuffered port.\n\n"
diff --git a/libguile/posix.c b/libguile/posix.c
index 033678947..acec88b08 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -1328,7 +1328,7 @@ SCM_DEFINE (scm_sync, "sync", 0, 0, 0,
SCM_DEFINE (scm_crypt, "crypt", 2, 0, 0,
(SCM key, SCM salt),
"Encrypt @var{key} using @var{salt} as the salt value to the\n"
- "crypt(3) library call\n")
+ "crypt(3) library call.")
#define FUNC_NAME s_scm_crypt
{
char * p;
diff --git a/libguile/random.c b/libguile/random.c
index 4883ff16f..ba64d1ab2 100644
--- a/libguile/random.c
+++ b/libguile/random.c
@@ -364,9 +364,9 @@ SCM_DEFINE (scm_random, "random", 1, 1, 0,
(SCM n, SCM state),
"Return a number in [0,N).\n"
"\n"
- "Accepts a positive integer or real n and returns a \n"
- "number of the same type between zero (inclusive) and \n"
- "N (exclusive). The values returned have a uniform \n"
+ "Accepts a positive integer or real n and returns a\n"
+ "number of the same type between zero (inclusive) and\n"
+ "N (exclusive). The values returned have a uniform\n"
"distribution.\n"
"\n"
"The optional argument @var{state} must be of the type produced\n"
@@ -490,8 +490,8 @@ SCM_DEFINE (scm_random_solid_sphere_x, "random:solid-sphere!", 1, 1, 0,
(SCM v, SCM state),
"Fills vect with inexact real random numbers\n"
"the sum of whose squares is less than 1.0.\n"
- "Thinking of vect as coordinates in space of \n"
- "dimension n = (vector-length vect), the coordinates \n"
+ "Thinking of vect as coordinates in space of\n"
+ "dimension n = (vector-length vect), the coordinates\n"
"are uniformly distributed within the unit n-shere.\n"
"The sum of the squares of the numbers is returned.")
#define FUNC_NAME s_scm_random_solid_sphere_x
@@ -513,9 +513,9 @@ SCM_DEFINE (scm_random_hollow_sphere_x, "random:hollow-sphere!", 1, 1, 0,
(SCM v, SCM state),
"Fills vect with inexact real random numbers\n"
"the sum of whose squares is equal to 1.0.\n"
- "Thinking of vect as coordinates in space of \n"
+ "Thinking of vect as coordinates in space of\n"
"dimension n = (vector-length vect), the coordinates\n"
- "are uniformly distributed over the surface of the \n"
+ "are uniformly distributed over the surface of the\n"
"unit n-shere.")
#define FUNC_NAME s_scm_random_hollow_sphere_x
{
diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index 55439f2e5..5ee384995 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -434,13 +434,13 @@ SCM_DEFINE (scm_setitimer, "setitimer", 5, 0, 0,
"Errors are handled as described in the guile info pages under ``POSIX\n"
"Interface Conventions''.\n"
"\n"
- "The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL}, \n"
+ "The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},\n"
"and @code{ITIMER_PROF}.\n"
"\n"
"The return value will be a list of two cons pairs representing the\n"
"current state of the given timer. The first pair is the seconds and\n"
"microseconds of the timer @code{it_interval}, and the second pair is\n"
- "the seconds and microseconds of the timer @code{it_value}.\n")
+ "the seconds and microseconds of the timer @code{it_value}.")
#define FUNC_NAME s_scm_setitimer
{
int rv;
@@ -475,13 +475,13 @@ SCM_DEFINE (scm_getitimer, "getitimer", 1, 0, 0,
"Errors are handled as described in the guile info pages under ``POSIX\n"
"Interface Conventions''.\n"
"\n"
- "The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL}, \n"
+ "The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},\n"
"and @code{ITIMER_PROF}.\n"
"\n"
"The return value will be a list of two cons pairs representing the\n"
"current state of the given timer. The first pair is the seconds and\n"
"microseconds of the timer @code{it_interval}, and the second pair is\n"
- "the seconds and microseconds of the timer @code{it_value}.\n")
+ "the seconds and microseconds of the timer @code{it_value}.")
#define FUNC_NAME s_scm_getitimer
{
int rv;
diff --git a/libguile/strings.c b/libguile/strings.c
index 41cb50005..eef9f4a7f 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -211,7 +211,7 @@ SCM_DEFINE (scm_make_string, "make-string", 1, 1, 0,
"Return a newly allocated string of\n"
"length @var{k}. If @var{chr} is given, then all elements of\n"
"the string are initialized to @var{chr}, otherwise the contents\n"
- "of the @var{string} are unspecified.\n")
+ "of the @var{string} are unspecified.")
#define FUNC_NAME s_scm_make_string
{
if (SCM_INUMP (k))
diff --git a/libguile/strop.c b/libguile/strop.c
index a173cacea..9369c3ec8 100644
--- a/libguile/strop.c
+++ b/libguile/strop.c
@@ -64,7 +64,7 @@ If you do not wish that, delete this exception notice. */
/*
xSCM_DEFINE (scm_i_index, "i-index", 2, 2, 0,
(SCM str, SCM chr, SCM frm, SCM to),
- "@deftypefn {Internal C Function} {static int} scm_i_index (SCM *@var{str}, \n"
+ "@deftypefn {Internal C Function} {static int} scm_i_index (SCM *@var{str},\n"
"SCM @var{chr}, int @var{direction}, SCM @var{sub_start}, SCM @var{sub_end}, char *@var{why})
"This is a workhorse function that performs either an @code{index} or\n"
"@code{rindex} function, depending on the value of @var{direction}."
diff --git a/libguile/struct.c b/libguile/struct.c
index 27eecebe4..f24fefdb2 100644
--- a/libguile/struct.c
+++ b/libguile/struct.c
@@ -72,7 +72,7 @@ SCM_DEFINE (scm_make_struct_layout, "make-struct-layout", 1, 0, 0,
"type, the second a field protection. Allowed types are 'p' for\n"
"GC-protected Scheme data, 'u' for unprotected binary data, and 's' for\n"
"a field that points to the structure itself. Allowed protections\n"
- "are 'w' for mutable fields, 'r' for read-only fields, and 'o' for opaque \n"
+ "are 'w' for mutable fields, 'r' for read-only fields, and 'o' for opaque\n"
"fields. The last field protection specification may be capitalized to\n"
"indicate that the field is a tail-array.")
#define FUNC_NAME s_scm_make_struct_layout
@@ -521,7 +521,7 @@ SCM_DEFINE (scm_make_vtable_vtable, "make-vtable-vtable", 2, 0, 1,
"(define (make-ball type owner) (make-struct type 0 owner))\n\n"
"(define ball (make-ball green 'Nisse))\n"
"ball @result{} #<a green ball owned by Nisse>\n"
- "@end lisp\n")
+ "@end lisp")
#define FUNC_NAME s_scm_make_vtable_vtable
{
SCM fields;
diff --git a/libguile/unif.c b/libguile/unif.c
index 392e376b2..138fe36a8 100644
--- a/libguile/unif.c
+++ b/libguile/unif.c
@@ -1656,7 +1656,7 @@ SCM_DEFINE (scm_uniform_array_write, "uniform-array-write", 1, 3, 0,
"The optional arguments @var{start}\n"
"and @var{end} allow\n"
"a specified region of a vector (or linearized array) to be written.\n\n"
- "The number of objects actually written is returned. \n"
+ "The number of objects actually written is returned.\n"
"@var{port-or-fdes} may be\n"
"omitted, in which case it defaults to the value returned by\n"
"@code{(current-output-port)}.")
diff --git a/libguile/variable.c b/libguile/variable.c
index 7a4763b00..b0e9b61d9 100644
--- a/libguile/variable.c
+++ b/libguile/variable.c
@@ -78,7 +78,7 @@ make_variable (SCM init)
SCM_DEFINE (scm_make_variable, "make-variable", 1, 0, 0,
(SCM init),
- "Return a variable initialized to value @var{init}.\n")
+ "Return a variable initialized to value @var{init}.")
#define FUNC_NAME s_scm_make_variable
{
return make_variable (init);
@@ -88,7 +88,7 @@ SCM_DEFINE (scm_make_variable, "make-variable", 1, 0, 0,
SCM_DEFINE (scm_make_undefined_variable, "make-undefined-variable", 0, 0, 0,
(),
- "Return a variable that is initially unbound.\n")
+ "Return a variable that is initially unbound.")
#define FUNC_NAME s_scm_make_undefined_variable
{
return make_variable (SCM_UNDEFINED);
@@ -99,7 +99,7 @@ SCM_DEFINE (scm_make_undefined_variable, "make-undefined-variable", 0, 0, 0,
SCM_DEFINE (scm_variable_p, "variable?", 1, 0, 0,
(SCM obj),
"Return @code{#t} iff @var{obj} is a variable object, else\n"
- "return @code{#f}\n")
+ "return @code{#f}.")
#define FUNC_NAME s_scm_variable_p
{
return SCM_BOOL (SCM_VARIABLEP (obj));
@@ -127,7 +127,7 @@ SCM_DEFINE (scm_variable_set_x, "variable-set!", 2, 0, 0,
(SCM var, SCM val),
"Set the value of the variable @var{var} to @var{val}.\n"
"@var{var} must be a variable object, @var{val} can be any\n"
- "value. Return an unspecified value.\n")
+ "value. Return an unspecified value.")
#define FUNC_NAME s_scm_variable_set_x
{
SCM_VALIDATE_VARIABLE (1, var);
@@ -139,7 +139,7 @@ SCM_DEFINE (scm_variable_set_x, "variable-set!", 2, 0, 0,
SCM_DEFINE (scm_variable_bound_p, "variable-bound?", 1, 0, 0,
(SCM var),
"Return @code{#t} iff @var{var} is bound to a value.\n"
- "Throws an error if @var{var} is not a variable object.\n")
+ "Throws an error if @var{var} is not a variable object.")
#define FUNC_NAME s_scm_variable_bound_p
{
SCM_VALIDATE_VARIABLE (1, var);
diff --git a/srfi/ChangeLog b/srfi/ChangeLog
index 287f65bf6..85125714f 100644
--- a/srfi/ChangeLog
+++ b/srfi/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-07 Neil Jerram <neil@ossau.uklinux.net>
+
+ * srfi-13.c (scm_string_unfold, scm_string_unfold_right),
+ srfi-14.c (scm_char_set_unfold, scm_char_set_unfold_x): Remove
+ superfluous whitespace at end of docstring lines.
+
2001-11-06 Thien-Thi Nguyen <ttn@glug.org>
* srfi-19.scm (time-monotonic->time-monotonic): Spurious;
diff --git a/srfi/srfi-13.c b/srfi/srfi-13.c
index 231e2adaa..3d32cf744 100644
--- a/srfi/srfi-13.c
+++ b/srfi/srfi-13.c
@@ -2521,7 +2521,7 @@ SCM_DEFINE (scm_string_unfold, "string-unfold", 4, 2, 0,
"@dots{}\n"
"@item @var{p} tells us when to stop -- when it returns true\n"
"when applied to one of these seed values.\n"
- "@item @var{f} maps each seed value to the corresponding \n"
+ "@item @var{f} maps each seed value to the corresponding\n"
"character in the result string. These chars are assembled\n"
"into the string in a left-to-right order.\n"
"@item @var{base} is the optional initial/leftmost portion\n"
@@ -2583,7 +2583,7 @@ SCM_DEFINE (scm_string_unfold_right, "string-unfold-right", 4, 2, 0,
"@dots{}\n"
"@item @var{p} tells us when to stop -- when it returns true\n"
"when applied to one of these seed values.\n"
- "@item @var{f} maps each seed value to the corresponding \n"
+ "@item @var{f} maps each seed value to the corresponding\n"
"character in the result string. These chars are assembled\n"
"into the string in a right-to-left order.\n"
"@item @var{base} is the optional initial/rightmost portion\n"
diff --git a/srfi/srfi-14.c b/srfi/srfi-14.c
index c5a491786..1f3abae7d 100644
--- a/srfi/srfi-14.c
+++ b/srfi/srfi-14.c
@@ -317,11 +317,11 @@ SCM_DEFINE (scm_char_set_unfold, "char-set-unfold", 4, 1, 0,
(SCM p, SCM f, SCM g, SCM seed, SCM base_cs),
"This is a fundamental constructor for character sets.\n"
"@itemize @bullet\n"
- "@item @var{g} is used to generate a series of ``seed'' values \n"
+ "@item @var{g} is used to generate a series of ``seed'' values\n"
"from the initial seed: @var{seed}, (@var{g} @var{seed}),\n"
"(@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}\n"
"@item @var{p} tells us when to stop -- when it returns true\n"
- "when applied to one of the seed values. \n"
+ "when applied to one of the seed values.\n"
"@item @var{f} maps each seed value to a character. These\n"
"characters are added to the base character set @var{base_cs} to\n"
"form the result; @var{base_cs} defaults to the empty set.\n"
@@ -362,10 +362,10 @@ SCM_DEFINE (scm_char_set_unfold_x, "char-set-unfold!", 5, 0, 0,
"This is a fundamental constructor for character sets.\n"
"@itemize @bullet\n"
"@item @var{g} is used to generate a series of ``seed'' values\n"
- "from the initial seed: @var{seed}, (@var{g} @var{seed}), \n"
+ "from the initial seed: @var{seed}, (@var{g} @var{seed}),\n"
"(@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}\n"
"@item @var{p} tells us when to stop -- when it returns true\n"
- "when applied to one of the seed values. \n"
+ "when applied to one of the seed values.\n"
"@item @var{f} maps each seed value to a character. These\n"
"characters are added to the base character set @var{base_cs} to\n"
"form the result; @var{base_cs} defaults to the empty set.\n"