[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
guile/guile-core doc/ChangeLog doc/new-docstrin...
From: |
Neil Jerram |
Subject: |
guile/guile-core doc/ChangeLog doc/new-docstrin... |
Date: |
Fri, 04 May 2001 14:54:01 -0700 |
CVSROOT: /cvs
Module name: guile
Changes by: Neil Jerram <address@hidden> 01/05/04 14:54:00
Modified files:
guile-core/doc : ChangeLog new-docstrings.texi posix.texi
scheme-control.texi scheme-data.texi
scheme-debug.texi scheme-evaluation.texi
scheme-io.texi scheme-memory.texi
scheme-modules.texi scheme-procedures.texi
guile-core/doc/maint: guile.texi
guile-core/libguile: ChangeLog eval.c guile-snarf.awk.in list.c
scmsigs.c symbols.c throw.c vports.c
Log message:
* eval.c (scm_promise_p), list.c (scm_append_x, scm_reverse_x),
symbols.c (scm_symbol_to_string), vports.c (scm_make_soft_port):
Change R4RS references to R5RS.
* guile-snarf.awk.in: Fixes so that (i) blank lines in the
docstring source are correctly reproduced in the output (ii)
we don't anymore get occasional trailing quotes. Also reorganized
and commented the code a little.
* scmsigs.c (scm_raise), throw.c (scm_throw): Docstring format
fixes.
* new-docstrings.texi, posix.texi, scheme-control.texi,
scheme-data.texi, scheme-debug.texi, scheme-evaluation.texi,
scheme-io.texi, scheme-memory.texi, scheme-procedures.texi:
Automatic docstring updates (mostly argument name updates and
blank lines).
* scheme-modules.texi: Change double hyphens to single.
* scheme-control.texi (Lazy Catch): Completed.
* posix.texi (Network Databases and Address Conversion): New
subsubsection `IPv6 Address Conversion'.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/ChangeLog.diff?cvsroot=OldCVS&tr1=1.81&tr2=1.82&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/new-docstrings.texi.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/posix.texi.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/scheme-control.texi.diff?cvsroot=OldCVS&tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/scheme-data.texi.diff?cvsroot=OldCVS&tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/scheme-debug.texi.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/scheme-evaluation.texi.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/scheme-io.texi.diff?cvsroot=OldCVS&tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/scheme-memory.texi.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/scheme-modules.texi.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/scheme-procedures.texi.diff?cvsroot=OldCVS&tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/maint/guile.texi.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/ChangeLog.diff?cvsroot=OldCVS&tr1=1.1374&tr2=1.1375&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/eval.c.diff?cvsroot=OldCVS&tr1=1.216&tr2=1.217&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/guile-snarf.awk.in.diff?cvsroot=OldCVS&tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/list.c.diff?cvsroot=OldCVS&tr1=1.53&tr2=1.54&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/scmsigs.c.diff?cvsroot=OldCVS&tr1=1.55&tr2=1.56&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/symbols.c.diff?cvsroot=OldCVS&tr1=1.84&tr2=1.85&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/throw.c.diff?cvsroot=OldCVS&tr1=1.79&tr2=1.80&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/vports.c.diff?cvsroot=OldCVS&tr1=1.43&tr2=1.44&r1=text&r2=text
Patches:
Index: guile/guile-core/doc/ChangeLog
diff -u guile/guile-core/doc/ChangeLog:1.81 guile/guile-core/doc/ChangeLog:1.82
--- guile/guile-core/doc/ChangeLog:1.81 Fri May 4 14:03:43 2001
+++ guile/guile-core/doc/ChangeLog Fri May 4 14:53:59 2001
@@ -1,3 +1,18 @@
+2001-05-04 Neil Jerram <address@hidden>
+
+ * new-docstrings.texi, posix.texi, scheme-control.texi,
+ scheme-data.texi, scheme-debug.texi, scheme-evaluation.texi,
+ scheme-io.texi, scheme-memory.texi, scheme-procedures.texi:
+ Automatic docstring updates (mostly argument name updates and
+ blank lines).
+
+ * scheme-modules.texi: Change double hyphens to single.
+
+ * scheme-control.texi (Lazy Catch): Completed.
+
+ * posix.texi (Network Databases and Address Conversion): New
+ subsubsection `IPv6 Address Conversion'.
+
2001-05-04 Thien-Thi Nguyen <address@hidden>
* preface.texi (iff): Use proper texi markup.
Index: guile/guile-core/doc/maint/guile.texi
diff -u guile/guile-core/doc/maint/guile.texi:1.6
guile/guile-core/doc/maint/guile.texi:1.7
--- guile/guile-core/doc/maint/guile.texi:1.6 Sun Apr 22 09:34:28 2001
+++ guile/guile-core/doc/maint/guile.texi Fri May 4 14:54:00 2001
@@ -462,6 +462,23 @@
Return @code{#t} if @var{obj} is a debug object.
@end deffn
+issue-deprecation-warning
address@hidden snarfed from deprecation.c:78
address@hidden 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.
address@hidden deffn
+
+include-deprecated-features
address@hidden snarfed from deprecation.c:120
address@hidden primitive include-deprecated-features
+Return @code{#t} iff deprecated features should be included
+in public interfaces.
address@hidden deffn
+
c-registered-modules
@c snarfed from dynl.c:183
@deffn primitive c-registered-modules
@@ -562,6 +579,7 @@
All three arguments must be 0-argument procedures.
@var{in_guard} is called, then @var{thunk}, then
@var{out_guard}.
+
If, any time during the execution of @var{thunk}, the
continuation of the @code{dynamic_wind} expression is escaped
non-locally, @var{out_guard} is called. If the continuation of
@@ -578,15 +596,18 @@
;; in-guard:
;;
(lambda () (set! x 'special-binding))
+
;; thunk
;;
(lambda () (display x) (newline)
(call-with-current-continuation escape)
(display x) (newline)
x)
+
;; out-guard:
;;
(lambda () (set! x old-x)))))))
+
;; Prints:
special-binding
;; Evaluates to:
@@ -1051,14 +1072,14 @@
@end deffn
primitive-eval
address@hidden snarfed from eval.c:3940
address@hidden snarfed from eval.c:3938
@deffn primitive primitive-eval exp
Evaluate @var{exp} in the top-level environment specified by
the current module.
@end deffn
eval
address@hidden snarfed from eval.c:4009
address@hidden snarfed from eval.c:4007
@deffn primitive eval exp module
Evaluate @var{exp}, a list representing a Scheme expression,
in the top-level environment specified by @var{module}.
@@ -1068,10 +1089,10 @@
@end deffn
eval2
address@hidden snarfed from eval.c:4052
address@hidden 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."
+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.
@@ -1219,9 +1240,11 @@
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.
@@ -1256,8 +1279,10 @@
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
@@ -2136,6 +2161,7 @@
that takes two arguments, a key to be hashed and a table size.
@code{assoc} must be an associator function, like @code{assoc},
@code{assq} or @code{assv}.
+
By way of illustration, @code{hashq-ref table key} is
equivalent to @code{hashx-ref hashq assq table key}.
@end deffn
@@ -2149,6 +2175,7 @@
that takes two arguments, a key to be hashed and a table size.
@code{assoc} must be an associator function, like @code{assoc},
@code{assq} or @code{assv}.
+
By way of illustration, @code{hashq-set! table key} is
equivalent to @code{hashx-set! hashq assq table key}.
@end deffn
@@ -2228,61 +2255,19 @@
Convert the procedure list of @var{hook} to a list.
@end deffn
-read-string!/partial
address@hidden snarfed from ioext.c:114
address@hidden 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:
-
address@hidden
address@hidden
-attempt to fill 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
address@hidden(string-length str)}
address@hidden
-use the current input port if @var{port_or_fdes} is not
-supplied.
address@hidden
-read any characters that are currently available,
-without waiting for the rest (short reads are possible).
-
address@hidden
-wait for as long as it needs to for the first character to
-become available, unless the port is in non-blocking mode
address@hidden
-return @code{#f} if end-of-file is encountered before reading
-any characters, otherwise return the number of characters
-read.
address@hidden
-return 0 if the port is in non-blocking mode and no characters
-are immediately available.
address@hidden
-return 0 if the request is for 0 bytes, with no
-end-of-file check
address@hidden itemize
address@hidden deffn
-
ftell
address@hidden snarfed from ioext.c:174
address@hidden snarfed from ioext.c:71
@deffn primitive ftell fd_port
Return an integer representing the current position of
@var{fd/port}, measured from the beginning. Equivalent to:
+
@lisp
(seek port 0 SEEK_CUR)
@end lisp
@end deffn
-fseek
address@hidden snarfed from ioext.c:187
address@hidden primitive fseek fd_port offset whence
-Obsolete. Almost the same as @code{seek}, but the return value
-is unspecified.
address@hidden deffn
-
redirect-port
address@hidden snarfed from ioext.c:209
address@hidden snarfed from ioext.c:89
@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
@@ -2300,7 +2285,7 @@
@end deffn
dup->fdes
address@hidden snarfed from ioext.c:248
address@hidden snarfed from ioext.c:128
@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
@@ -2308,7 +2293,7 @@
@end deffn
dup2
address@hidden snarfed from ioext.c:295
address@hidden snarfed from ioext.c:175
@deffn primitive dup2 oldfd newfd
A simple wrapper for the @code{dup2} system call.
Copies the file descriptor @var{oldfd} to descriptor
@@ -2321,21 +2306,21 @@
@end deffn
fileno
address@hidden snarfed from ioext.c:314
address@hidden snarfed from ioext.c:194
@deffn primitive fileno port
Return the integer file descriptor underlying @var{port}. Does
not change its revealed count.
@end deffn
isatty?
address@hidden snarfed from ioext.c:330
address@hidden snarfed from ioext.c:210
@deffn primitive isatty? port
Return @code{#t} if @var{port} is using a serial non--file
device, otherwise @code{#f}.
@end deffn
fdopen
address@hidden snarfed from ioext.c:352
address@hidden snarfed from ioext.c:232
@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
@@ -2344,7 +2329,7 @@
@end deffn
primitive-move->fdes
address@hidden snarfed from ioext.c:377
address@hidden snarfed from ioext.c:257
@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}.
@@ -2355,7 +2340,7 @@
@end deffn
fdes->ports
address@hidden snarfed from ioext.c:411
address@hidden snarfed from ioext.c:291
@deffn primitive fdes->ports fd
Return a list of existing ports which have @var{fdes} as an
underlying file descriptor, without changing their revealed
@@ -2807,6 +2792,7 @@
environment. The value returned from @var{code} which has been
passed to @code{procedure->memoizing-macro} replaces the form
passed to @var{code}. For example:
+
@lisp
(define trace
(procedure->macro
@@ -2825,6 +2811,7 @@
environment. The value returned from @var{proc} which has been
passed to @code{procedure->memoizing-macro} replaces the form
passed to @var{proc}. For example:
+
@lisp
(define trace
(procedure->macro
@@ -2863,8 +2850,21 @@
Return the transformer of the macro @var{m}.
@end deffn
+current-module
address@hidden snarfed from modules.c:78
address@hidden primitive current-module
+Return the current module.
address@hidden deffn
+
+set-current-module
address@hidden snarfed from modules.c:95
address@hidden primitive set-current-module module
+Set the current module to @var{module} and return
+the previous current module.
address@hidden deffn
+
interaction-environment
address@hidden snarfed from modules.c:102
address@hidden snarfed from modules.c:128
@deffn primitive interaction-environment
Return a specifier for the environment that contains
implementation--defined bindings, typically a superset of those
@@ -2874,64 +2874,13 @@
@end deffn
standard-eval-closure
address@hidden snarfed from modules.c:271
address@hidden snarfed from modules.c:312
@deffn primitive standard-eval-closure module
Return an eval closure for the module @var{module}.
@end deffn
-inet-aton
address@hidden snarfed from net_db.c:96
address@hidden primitive inet-aton address
-Converts a string containing an Internet host address in the
-traditional dotted decimal notation into an integer.
address@hidden
-(inet-aton "127.0.0.1") @result{} 2130706433
address@hidden lisp
address@hidden deffn
-
-inet-ntoa
address@hidden snarfed from net_db.c:116
address@hidden primitive inet-ntoa inetid
-Converts an integer Internet host address into a string with
-the traditional dotted decimal representation.
address@hidden
-(inet-ntoa 2130706433) @result{} "127.0.0.1"
address@hidden lisp
address@hidden deffn
-
-inet-netof
address@hidden snarfed from net_db.c:136
address@hidden primitive inet-netof address
-Return the network number part of the given integer Internet
-address.
address@hidden
-(inet-netof 2130706433) @result{} 127
address@hidden lisp
address@hidden deffn
-
-inet-lnaof
address@hidden snarfed from net_db.c:153
address@hidden primitive inet-lnaof address
-Return the local-address-with-network part of the given
-Internet address.
address@hidden
-(inet-lnaof 2130706433) @result{} 1
address@hidden lisp
address@hidden deffn
-
-inet-makeaddr
address@hidden snarfed from net_db.c:171
address@hidden primitive inet-makeaddr net lna
-Makes an Internet host address by combining the network number
address@hidden with the local-address-within-network number
address@hidden
address@hidden
-(inet-makeaddr 127 1) @result{} 2130706433
address@hidden lisp
address@hidden deffn
-
gethost
address@hidden snarfed from net_db.c:256
address@hidden snarfed from net_db.c:146
@deffn primitive gethost [host]
@deffnx procedure gethostbyname hostname
@deffnx procedure gethostbyaddr address
@@ -2947,7 +2896,7 @@
@end deffn
getnet
address@hidden snarfed from net_db.c:337
address@hidden snarfed from net_db.c:227
@deffn primitive getnet [net]
@deffnx procedure getnetbyname net-name
@deffnx procedure getnetbyaddr net-number
@@ -2959,7 +2908,7 @@
@end deffn
getproto
address@hidden snarfed from net_db.c:387
address@hidden snarfed from net_db.c:277
@deffn primitive getproto [protocol]
@deffnx procedure getprotobyname name
@deffnx procedure getprotobynumber number
@@ -2970,7 +2919,7 @@
@end deffn
getserv
address@hidden snarfed from net_db.c:454
address@hidden snarfed from net_db.c:344
@deffn primitive getserv [name [protocol]]
@deffnx procedure getservbyname name protocol
@deffnx procedure getservbyport port protocol
@@ -2985,59 +2934,60 @@
@end deffn
sethost
address@hidden snarfed from net_db.c:493
address@hidden 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
address@hidden snarfed from net_db.c:509
address@hidden 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
address@hidden snarfed from net_db.c:525
address@hidden 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
address@hidden snarfed from net_db.c:541
address@hidden 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}.
@end deffn
exact?
address@hidden snarfed from numbers.c:106
address@hidden snarfed from numbers.c:107
@deffn primitive exact? x
Return @code{#t} if @var{x} is an exact number, @code{#f}
otherwise.
@end deffn
odd?
address@hidden snarfed from numbers.c:123
address@hidden snarfed from numbers.c:124
@deffn primitive odd? n
Return @code{#t} if @var{n} is an odd number, @code{#f}
otherwise.
@end deffn
even?
address@hidden snarfed from numbers.c:140
address@hidden snarfed from numbers.c:141
@deffn primitive even? n
Return @code{#t} if @var{n} is an even number, @code{#f}
otherwise.
@end deffn
logand
address@hidden snarfed from numbers.c:755
address@hidden snarfed from numbers.c:756
@deffn primitive logand n1 n2
Return the integer which is the bit-wise AND of the two integer
arguments.
+
@lisp
(number->string (logand #b1100 #b1010) 2)
@result{} "1000"
@@ -3045,10 +2995,11 @@
@end deffn
logior
address@hidden snarfed from numbers.c:842
address@hidden snarfed from numbers.c:843
@deffn primitive logior n1 n2
Return the integer which is the bit-wise OR of the two integer
arguments.
+
@lisp
(number->string (logior #b1100 #b1010) 2)
@result{} "1110"
@@ -3056,10 +3007,11 @@
@end deffn
logxor
address@hidden snarfed from numbers.c:928
address@hidden snarfed from numbers.c:929
@deffn primitive logxor n1 n2
Return the integer which is the bit-wise XOR of the two integer
arguments.
+
@lisp
(number->string (logxor #b1100 #b1010) 2)
@result{} "110"
@@ -3067,7 +3019,7 @@
@end deffn
logtest
address@hidden snarfed from numbers.c:997
address@hidden snarfed from numbers.c:998
@deffn primitive logtest j k
@lisp
(logtest j k) @equiv{} (not (zero? (logand j k)))
@@ -3078,7 +3030,7 @@
@end deffn
logbit?
address@hidden snarfed from numbers.c:1054
address@hidden snarfed from numbers.c:1055
@deffn primitive logbit? index j
@lisp
(logbit? index j) @equiv{} (logtest (integer-expt 2 index) j)
@@ -3092,10 +3044,11 @@
@end deffn
lognot
address@hidden snarfed from numbers.c:1103
address@hidden snarfed from numbers.c:1104
@deffn primitive lognot n
Return the integer which is the 2s-complement of the integer
argument.
+
@lisp
(number->string (lognot #b10000000) 2)
@result{} "-10000001"
@@ -3105,10 +3058,11 @@
@end deffn
integer-expt
address@hidden snarfed from numbers.c:1120
address@hidden snarfed from numbers.c:1121
@deffn primitive integer-expt n k
Return @var{n} raised to the non-negative integer exponent
@var{k}.
+
@lisp
(integer-expt 2 5)
@result{} 32
@@ -3118,7 +3072,7 @@
@end deffn
ash
address@hidden snarfed from numbers.c:1167
address@hidden snarfed from numbers.c:1168
@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'
@@ -3127,8 +3081,10 @@
will always be rounded towards minus infinity. Therefore, the
results of ash and a corresponding bitwise shift will differ if
@var{n} is negative.
+
Formally, the function returns an integer equivalent to
@code{(inexact->exact (floor (* @var{n} (expt 2 @var{cnt}))))}.
+
@lisp
(number->string (ash #b1 3) 2) @result{} "1000"
(number->string (ash #b1010 -1) 2) @result{} "101"
@@ -3136,11 +3092,12 @@
@end deffn
bit-extract
address@hidden snarfed from numbers.c:1220
address@hidden snarfed from numbers.c:1221
@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
@var{start}th bit becomes the 0-th bit in the result.
+
@lisp
(number->string (bit-extract #b1101101010 0 4) 2)
@result{} "1010"
@@ -3150,12 +3107,13 @@
@end deffn
logcount
address@hidden snarfed from numbers.c:1292
address@hidden snarfed from numbers.c:1293
@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.
If negative, the 0-bits in its two's-complement binary
representation are counted. If 0, 0 is returned.
+
@lisp
(logcount #b10101010)
@result{} 4
@@ -3167,9 +3125,10 @@
@end deffn
integer-length
address@hidden snarfed from numbers.c:1343
address@hidden snarfed from numbers.c:1344
@deffn primitive integer-length n
Return the number of bits neccessary to represent @var{n}.
+
@lisp
(integer-length #b10101010)
@result{} 8
@@ -3181,7 +3140,7 @@
@end deffn
number->string
address@hidden snarfed from numbers.c:2289
address@hidden snarfed from numbers.c:2290
@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
@@ -3189,7 +3148,7 @@
@end deffn
string->number
address@hidden snarfed from numbers.c:2874
address@hidden snarfed from numbers.c:2875
@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
@@ -3202,13 +3161,13 @@
@end deffn
number?
address@hidden snarfed from numbers.c:2941
address@hidden snarfed from numbers.c:2942
@deffn primitive number?
scm_number_p
@end deffn
complex?
address@hidden snarfed from numbers.c:2953
address@hidden snarfed from numbers.c:2954
@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
@@ -3218,13 +3177,13 @@
@end deffn
real?
address@hidden snarfed from numbers.c:2961
address@hidden snarfed from numbers.c:2962
@deffn primitive real?
scm_real_p
@end deffn
rational?
address@hidden snarfed from numbers.c:2974
address@hidden snarfed from numbers.c:2975
@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
@@ -3235,28 +3194,28 @@
@end deffn
integer?
address@hidden snarfed from numbers.c:2995
address@hidden snarfed from numbers.c:2996
@deffn primitive integer? x
Return @code{#t} if @var{x} is an integer number, @code{#f}
else.
@end deffn
inexact?
address@hidden snarfed from numbers.c:3020
address@hidden snarfed from numbers.c:3021
@deffn primitive inexact? x
Return @code{#t} if @var{x} is an inexact number, @code{#f}
else.
@end deffn
$expt
address@hidden snarfed from numbers.c:4072
address@hidden snarfed from numbers.c:4073
@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
address@hidden snarfed from numbers.c:4088
address@hidden snarfed from numbers.c:4089
@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
@@ -3266,20 +3225,20 @@
@end deffn
make-rectangular
address@hidden snarfed from numbers.c:4101
address@hidden snarfed from numbers.c:4102
@deffn primitive make-rectangular real imaginary
Return a complex number constructed of the given @var{real} and
@var{imaginary} parts.
@end deffn
make-polar
address@hidden snarfed from numbers.c:4114
address@hidden snarfed from numbers.c:4115
@deffn primitive make-polar x y
Return the complex number @var{x} * e^(i * @var{y}).
@end deffn
inexact->exact
address@hidden snarfed from numbers.c:4232
address@hidden snarfed from numbers.c:4233
@deffn primitive inexact->exact z
Return an exact number that is numerically closest to @var{z}.
@end deffn
@@ -3642,6 +3601,7 @@
Sets the current position of @var{fd/port} to the integer
@var{offset}, which is interpreted according to the value of
@var{whence}.
+
One of the following variables should be supplied for
@var{whence}:
@defvar SEEK_SET
@@ -3655,6 +3615,7 @@
@end defvar
If @var{fd/port} is a file descriptor, the underlying system
call is @code{lseek}. @var{port} may be a string port.
+
The value returned is the new position in the file. This means
that the current position of a port can be obtained using:
@lisp
@@ -3743,6 +3704,7 @@
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
@@ -4008,6 +3970,7 @@
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
@@ -4139,9 +4102,11 @@
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
@@ -4185,6 +4150,7 @@
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,
@@ -4572,10 +4538,12 @@
@c snarfed from random.c:370
@deffn primitive random n [state]
Return a number in [0,N).
+
Accepts a positive integer or real n and returns a
number of the same type between zero (inclusive) and
N (exclusive). The values returned have a uniform
distribution.
+
The optional argument @var{state} must be of the type produced
by @code{seed->random-state}. It defaults to the value of the
variable @var{*random-state*}. This object is used to maintain
@@ -4661,6 +4629,7 @@
specified, store data only into the substring of @var{str}
bounded by @var{start} and @var{end} (which default to the
beginning and end of the string, respectively).
+
Return a pair consisting of the delimiter that terminated the
string and the number of characters read. If reading stopped
at the end of file, the delimiter returned is the
@@ -4731,8 +4700,10 @@
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
@@ -4831,6 +4802,42 @@
in no way depend on this.
@end deffn
+read-string!/partial
address@hidden snarfed from rw.c:110
address@hidden 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:
+
address@hidden
address@hidden
+attempt to fill 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
address@hidden(string-length str)}
address@hidden
+use the current input port if @var{port_or_fdes} is not
+supplied.
address@hidden
+read any characters that are currently available,
+without waiting for the rest (short reads are possible).
+
address@hidden
+wait for as long as it needs to for the first character to
+become available, unless the port is in non-blocking mode
address@hidden
+return @code{#f} if end-of-file is encountered before reading
+any characters, otherwise return the number of characters
+read.
address@hidden
+return 0 if the port is in non-blocking mode and no characters
+are immediately available.
address@hidden
+return 0 if the request is for 0 bytes, with no
+end-of-file check
address@hidden itemize
address@hidden deffn
+
sigaction
@c snarfed from scmsigs.c:201
@deffn primitive sigaction signum [handler [flags]]
@@ -4907,7 +4914,7 @@
@end deffn
raise
address@hidden snarfed from scmsigs.c:475
address@hidden snarfed from scmsigs.c:474
@deffn primitive raise sig
Sends a specified signal @var{sig} to the current process, where
@var{sig} is as described for the kill procedure.
@@ -4921,6 +4928,7 @@
@code{sh}. The value returned is @var{cmd}'s exit status as
returned by @code{waitpid}, which can be interpreted using the
functions above.
+
If @code{system} is called without arguments, return a boolean
indicating whether the command processor is available.
@end deffn
@@ -4943,80 +4951,170 @@
htons
@c snarfed from socket.c:89
address@hidden primitive htons in
-Return a new integer from @var{value} by converting from host
-to network order. @var{value} must be within the range of a C
-unsigned short integer.
address@hidden primitive htons value
+Convert a 16 bit quantity from host to network byte ordering.
address@hidden is packed into 2 bytes, which are then converted
+and returned as a new integer.
@end deffn
ntohs
@c snarfed from socket.c:106
address@hidden primitive ntohs in
-Return a new integer from @var{value} by converting from
-network to host order. @var{value} must be within the range of
-a C unsigned short integer.
address@hidden primitive ntohs value
+Convert a 16 bit quantity from network to host byte ordering.
address@hidden is packed into 2 bytes, which are then converted
+and returned as a new integer.
@end deffn
htonl
@c snarfed from socket.c:123
address@hidden primitive htonl in
-Return a new integer from @var{value} by converting from host
-to network order. @var{value} must be within the range of a C
-unsigned long integer.
address@hidden primitive htonl value
+Convert a 32 bit quantity from host to network byte ordering.
address@hidden is packed into 4 bytes, which are then converted
+and returned as a new integer.
@end deffn
ntohl
address@hidden snarfed from socket.c:135
address@hidden primitive ntohl in
-Return a new integer from @var{value} by converting from
-network to host order. @var{value} must be within the range of
-a C unsigned long integer.
address@hidden snarfed from socket.c:136
address@hidden primitive ntohl value
+Convert a 32 bit quantity from network to host byte ordering.
address@hidden is packed into 4 bytes, which are then converted
+and returned as a new integer.
address@hidden deffn
+
+inet-aton
address@hidden snarfed from socket.c:156
address@hidden primitive inet-aton address
+Convert an IPv4 Internet address from printable string
+(dotted decimal notation) to an integer. E.g.,
+
address@hidden
+(inet-aton "127.0.0.1") @result{} 2130706433
address@hidden lisp
address@hidden deffn
+
+inet-ntoa
address@hidden snarfed from socket.c:176
address@hidden primitive inet-ntoa inetid
+Convert an IPv4 Internet address to a printable
+(dotted decimal notation) string. E.g.,
+
address@hidden
+(inet-ntoa 2130706433) @result{} "127.0.0.1"
address@hidden lisp
@end deffn
+inet-netof
address@hidden snarfed from socket.c:196
address@hidden primitive inet-netof address
+Return the network number part of the given IPv4
+Internet address. E.g.,
+
address@hidden
+(inet-netof 2130706433) @result{} 127
address@hidden lisp
address@hidden deffn
+
+inet-lnaof
address@hidden snarfed from socket.c:214
address@hidden 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.,
+
address@hidden
+(inet-lnaof 2130706433) @result{} 1
address@hidden lisp
address@hidden deffn
+
+inet-makeaddr
address@hidden snarfed from socket.c:232
address@hidden primitive inet-makeaddr net lna
+Make an IPv4 Internet address by combining the network number
address@hidden with the local-address-within-network number
address@hidden E.g.,
+
address@hidden
+(inet-makeaddr 127 1) @result{} 2130706433
address@hidden lisp
address@hidden deffn
+
+inet-pton
address@hidden snarfed from socket.c:350
address@hidden 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.
address@hidden can be @code{AF_INET} or @code{AF_INET6}. E.g.,
+
address@hidden
+(inet-pton AF_INET "127.0.0.1") @result{} 2130706433
+(inet-pton AF_INET6 "::1") @result{} 1
address@hidden lisp
address@hidden deffn
+
+inet-ntop
address@hidden snarfed from socket.c:385
address@hidden 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.
address@hidden can be @code{AF_INET} or @code{AF_INET6}. E.g.,
+
address@hidden
+(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
address@hidden lisp
address@hidden deffn
+
socket
address@hidden snarfed from socket.c:161
address@hidden snarfed from socket.c:430
@deffn primitive socket family style proto
Return a new socket port of the type specified by @var{family},
address@hidden and @var{protocol}. All three parameters are
address@hidden 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}.
address@hidden can be obtained from a protocol name using
+
address@hidden 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
address@hidden snarfed from socket.c:183
address@hidden 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{protocol}.
+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
address@hidden
address@hidden
@end deffn
getsockopt
address@hidden snarfed from socket.c:213
address@hidden snarfed from socket.c:481
@deffn primitive getsockopt sock level optname
Return the value of a particular socket option for the socket
-port @var{socket}. @var{level} is an integer code for type of
+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
address@hidden snarfed from socket.c:281
address@hidden snarfed from socket.c:549
@deffn primitive setsockopt sock level optname value
-Sets the value of a particular socket option for the socket
-port @var{socket}. @var{level} is an integer code for type of option
+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
@@ -5029,7 +5127,7 @@
@end deffn
shutdown
address@hidden snarfed from socket.c:403
address@hidden 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
@@ -5051,9 +5149,9 @@
@end deffn
connect
address@hidden snarfed from socket.c:569
address@hidden snarfed from socket.c:797
@deffn primitive connect sock fam address . args
-Initiates a connection from a socket using a specified address
+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}
@@ -5077,26 +5175,27 @@
@end deffn
bind
address@hidden snarfed from socket.c:623
address@hidden snarfed from socket.c:857
@deffn primitive bind sock fam address . args
-Assigns an address to the socket port @var{socket}.
+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{ARG} @dots{} depends on the family
-of the socket.
+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.
+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
-Internet host address and @var{arg} @dots{} must be a single integer
-port number.
+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}:
+The values of the following variables can also be used for
address@hidden:
@defvar INADDR_ANY
Allow connections from any address.
@@ -5114,126 +5213,155 @@
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
address@hidden snarfed from socket.c:656
address@hidden snarfed from socket.c:891
@deffn primitive listen sock backlog
-This procedure enables @var{socket} to accept connection
+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.
+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
address@hidden snarfed from socket.c:793
address@hidden snarfed from socket.c:997
@deffn primitive accept sock
-Accepts a connection on a bound, listening socket @var{socket}. If there
-are no pending connections in the queue, it waits until
-one is available unless the non-blocking option has been set on the
-socket.
+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 CAR is a new socket port for the connection and
-the CDR is an object with address information about the client which
-initiated the connection.
+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.
-If the address is not available then the CDR will be an empty vector.
-
address@hidden does not become part of the
address@hidden does not become part of the
connection and will continue to accept new requests.
@end deffn
getsockname
address@hidden snarfed from socket.c:824
address@hidden snarfed from socket.c:1024
@deffn primitive getsockname sock
-Return the address of @var{socket}, in the same form as the
+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
address@hidden snarfed from socket.c:851
address@hidden snarfed from socket.c:1046
@deffn primitive getpeername sock
-Return the address of the socket that the socket @var{socket}
+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!
address@hidden snarfed from socket.c:886
address@hidden snarfed from socket.c:1081
@deffn primitive recv! sock buf [flags]
-Receives data from the socket port @var{socket}. @var{socket} must already
+Receive data from a socket port.
address@hidden 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
+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
+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.
+The value returned is the number of bytes read from the
+socket.
-Note that the data is read directly from the socket file descriptor:
+Note that the data is read directly from the socket file
+descriptor:
any unread buffered port data is ignored.
@end deffn
send
address@hidden snarfed from socket.c:915
address@hidden snarfed from socket.c:1114
@deffn primitive send sock message [flags]
-Transmits the string @var{message} on the socket port @var{socket}.
address@hidden 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
+Transmit the string @var{message} on a socket port @var{sock}.
address@hidden 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:
+Note that the data is written directly to the socket
+file descriptor:
any unflushed buffered port data is ignored.
@end deffn
recvfrom!
address@hidden snarfed from socket.c:957
address@hidden snarfed from socket.c:1154
@deffn primitive recvfrom! sock str [flags [start [end]]]
-Return data from the socket port @var{socket} and also
+Return data from the socket port @var{sock} and also
information about where the data was received from.
address@hidden must already be bound to the address from which
address@hidden 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}.
+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
address@hidden snarfed from socket.c:1008
address@hidden snarfed from socket.c:1212
@deffn primitive sendto sock message fam address . args_and_flags
-Transmits the string @var{message} on the socket port @var{socket}. The
-destination address is specified using the @var{family}, @var{address} and
address@hidden arguments, in a similar way to the @code{connect}
-procedure. 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
+Transmit the string @var{message} on the socket port
address@hidden The
+destination address is specified using the @var{fam},
address@hidden and
address@hidden arguments, in a similar way to the
address@hidden 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.
-Note that the data is written directly to the socket file descriptor:
+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
@@ -5369,7 +5497,7 @@
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).
address@hidden must be a list if integers and specifies how the
address@hidden must be a list of integers and specifies how the
resulting stack will be narrowed.
@end deffn
@@ -5481,6 +5609,7 @@
Return an object with information about real and processor
time. The following procedures accept such an object as an
argument and return a selected component:
+
@table @code
@item tms:clock
The current real time, expressed as time units relative to an
@@ -5688,6 +5817,7 @@
@var{to} limit the search to a portion of the string. This
procedure essentially implements the @code{index} or
@code{strchr} functions from the C library.
+
@lisp
(string-index "weiner" #\e)
@result{} 1
@@ -5707,6 +5837,7 @@
string rather than from the left. This procedure essentially
implements the @code{rindex} or @code{strrchr} functions from
the C library.
+
@lisp
(string-rindex "weiner" #\e)
@result{} 4
@@ -5759,6 +5890,7 @@
@deffn primitive substring-fill! str start end fill
Change every character in @var{str} between @var{start} and
@var{end} to @var{fill}.
+
@lisp
(define y "abcdefg")
(substring-fill! y 1 3 #\r)
@@ -5844,6 +5976,7 @@
@deffn primitive string-capitalize! str
Upcase the first character of every word in @var{str}
destructively and return @var{str}.
+
@lisp
y @result{} "hello world"
(string-capitalize! y) @result{} "Hello World"
@@ -5873,6 +6006,7 @@
Lexicographic equality predicate; return @code{#t} if the two
strings are the same length and contain the same characters in
the same positions, otherwise return @code{#f}.
+
The procedure @code{string-ci=?} treats upper and lower case
letters as though they were the same character, but
@code{string=?} treats upper and lower case as distinct
@@ -6194,8 +6328,10 @@
passed to @code{string->symbol}. It is an error to apply
mutation procedures like @code{string-set!} to strings returned
by this procedure.
+
The following examples assume that the implementation's
standard case is lower case:
+
@lisp
(symbol->string 'flying-fish) @result{} "flying-fish"
(symbol->string 'Martin) @result{} "martin"
@@ -6213,8 +6349,10 @@
to create such symbols because in some implementations of
Scheme they cannot be read as themselves. See
@code{symbol->string}.
+
The following examples assume that the implementation's
standard case is lower case:
+
@lisp
(eq? 'mISSISSIppi 'mississippi) @result{} #t
(string->symbol "mISSISSIppi") @result{} @r{the symbol with name "mISSISSIppi"}
@@ -6355,12 +6493,6 @@
call. There is no provision for resetting the counter.
@end deffn
-tag
address@hidden snarfed from tag.c:98
address@hidden primitive tag x
-Return an integer corresponding to the type of X. Deprecated.
address@hidden deffn
-
catch
@c snarfed from throw.c:535
@deffn primitive catch key thunk handler
@@ -6370,12 +6502,16 @@
@lisp
(handler key args ...)
@end lisp
+
@var{key} is a symbol or @code{#t}.
+
@var{thunk} takes no arguments. If @var{thunk} returns
normally, that is the return value of @code{catch}.
+
Handler is invoked outside the scope of its own @code{catch}.
If @var{handler} again throws to the same key, a new handler
from further up the call chain is invoked.
+
If the key is @code{#t}, then a throw to @emph{any} symbol will
match this call to @code{catch}.
@end deffn
@@ -6395,9 +6531,9 @@
@var{handler}.
@var{key} is a symbol. It will match catches of the same symbol or of
-#t.
address@hidden
-If there is no handler at all, an error is signaled.
+If there is no handler at all, Guile prints an error and then exits.
@end deffn
uniform-vector-length
@@ -6488,11 +6624,13 @@
@var{dim0}, @var{dim1}, @dots{} should be integers between 0
and the rank of the array to be returned. Each integer in that
range must appear at least once in the argument list.
+
The values of @var{dim0}, @var{dim1}, @dots{} correspond to
dimensions in the array to be returned, their positions in the
argument list to dimensions of @var{array}. Several @var{dim}s
may have the same value, in which case the returned array will
have smaller rank than @var{array}.
+
@lisp
(transpose-array '#2((a b) (c d)) 1 0) @result{} #2((a c) (b d))
(transpose-array '#2((a b) (c d)) 0 0) @result{} #1(a d)
@@ -6772,6 +6910,7 @@
@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
@@ -6791,6 +6930,7 @@
@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)
@@ -6852,6 +6992,7 @@
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
@@ -6864,14 +7005,17 @@
@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?, ,r4rs, The Revised^4 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
@@ -6882,6 +7026,7 @@
(lambda () (char-upcase (read-char)))
(lambda () (display "@@" stdout)))
"rw"))
+
(write p p) @result{} #<input-output: soft 8081e20>
@end lisp
@end deffn
@@ -6926,6 +7071,7 @@
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
Index: guile/guile-core/doc/new-docstrings.texi
diff -u guile/guile-core/doc/new-docstrings.texi:1.4
guile/guile-core/doc/new-docstrings.texi:1.5
--- guile/guile-core/doc/new-docstrings.texi:1.4 Tue Apr 17 08:34:32 2001
+++ guile/guile-core/doc/new-docstrings.texi Fri May 4 14:53:59 2001
@@ -492,3 +492,41 @@
@deffn primitive list*
scm_cons_star
@end deffn
+
address@hidden primitive set-current-module module
+Set the current module to @var{module} and return
+the previous current module.
address@hidden deffn
+
address@hidden primitive current-module
+Return the current module.
address@hidden deffn
+
address@hidden 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.
address@hidden deffn
+
address@hidden 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.
address@hidden deffn
+
address@hidden primitive include-deprecated-features
+Return @code{#t} iff deprecated features should be included
+in public interfaces.
address@hidden deffn
+
address@hidden 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.
address@hidden deffn
Index: guile/guile-core/doc/posix.texi
diff -u guile/guile-core/doc/posix.texi:1.6 guile/guile-core/doc/posix.texi:1.7
--- guile/guile-core/doc/posix.texi:1.6 Sun Apr 22 09:34:28 2001
+++ guile/guile-core/doc/posix.texi Fri May 4 14:53:59 2001
@@ -295,6 +295,7 @@
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
@@ -511,9 +512,11 @@
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
@@ -535,9 +538,11 @@
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.
@@ -572,8 +577,10 @@
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
@@ -993,6 +1000,7 @@
Return an object with information about real and processor
time. The following procedures accept such an object as an
argument and return a selected component:
+
@table @code
@item tms:clock
The current real time, expressed as time units relative to an
@@ -1262,6 +1270,7 @@
@code{sh}. The value returned is @var{cmd}'s exit status as
returned by @code{waitpid}, which can be interpreted using the
functions above.
+
If @code{system} is called without arguments, return a boolean
indicating whether the command processor is available.
@end deffn
@@ -1475,6 +1484,7 @@
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
@@ -1546,24 +1556,27 @@
@subsubsection Address Conversion
@deffn primitive inet-aton address
-Converts a string containing an Internet host address in the
-traditional dotted decimal notation into an integer.
+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
@deffn primitive inet-ntoa inetid
-Converts an integer Internet host address into a string with
-the traditional dotted decimal representation.
+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
@deffn primitive inet-netof address
-Return the network number part of the given integer Internet
-address.
+Return the network number part of the given IPv4
+Internet address. E.g.,
+
@lisp
(inet-netof 2130706433) @result{} 127
@end lisp
@@ -1571,21 +1584,52 @@
@deffn primitive inet-lnaof address
Return the local-address-with-network part of the given
-Internet address.
+IPv4 Internet address, using the obsolete class A/B/C system.
+E.g.,
+
@lisp
(inet-lnaof 2130706433) @result{} 1
@end lisp
@end deffn
@deffn primitive inet-makeaddr net lna
-Makes an Internet host address by combining the network number
+Make an IPv4 Internet address by combining the network number
@var{net} with the local-address-within-network number
address@hidden
address@hidden E.g.,
+
@lisp
(inet-makeaddr 127 1) @result{} 2130706433
@end lisp
@end deffn
address@hidden IPv6 Address Conversion
+
address@hidden 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.
address@hidden can be @code{AF_INET} or @code{AF_INET6}. E.g.,
+
address@hidden
+(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
address@hidden lisp
address@hidden deffn
+
address@hidden 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.
address@hidden can be @code{AF_INET} or @code{AF_INET6}. E.g.,
+
address@hidden
+(inet-pton AF_INET "127.0.0.1") @result{} 2130706433
+(inet-pton AF_INET6 "::1") @result{} 1
address@hidden lisp
address@hidden deffn
+
@subsubsection The Host Database
A @dfn{host object} is a structure that represents what is known about a
@@ -1836,40 +1880,43 @@
@deffn primitive socket family style proto
Return a new socket port of the type specified by @var{family},
address@hidden and @var{protocol}. All three parameters are
address@hidden 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}.
address@hidden can be obtained from a protocol name using
+
address@hidden 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
@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{protocol}.
+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
address@hidden
address@hidden
@end deffn
@deffn primitive getsockopt sock level optname
Return the value of a particular socket option for the socket
-port @var{socket}. @var{level} is an integer code for type of
+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
@deffn primitive setsockopt sock level optname value
-Sets the value of a particular socket option for the socket
-port @var{socket}. @var{level} is an integer code for type of option
+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
@@ -1902,7 +1949,7 @@
@end deffn
@deffn primitive connect sock fam address . args
-Initiates a connection from a socket using a specified address
+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}
@@ -1926,24 +1973,25 @@
@end deffn
@deffn primitive bind sock fam address . args
-Assigns an address to the socket port @var{socket}.
+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{ARG} @dots{} depends on the family
-of the socket.
+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
-Internet host address and @var{arg} @dots{} must be a single integer
-port number.
+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}:
+The values of the following variables can also be used for
address@hidden:
@defvar INADDR_ANY
Allow connections from any address.
@@ -1961,33 +2009,40 @@
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
@deffn primitive listen sock backlog
-This procedure enables @var{socket} to accept connection
+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.
+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
@deffn primitive accept sock
-Accepts a connection on a bound, listening socket @var{socket}. If there
-are no pending connections in the queue, it waits until
-one is available unless the non-blocking option has been set on the
-socket.
+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 CAR is a new socket port for the connection and
-the CDR is an object with address information about the client which
-initiated the connection.
-
-If the address is not available then the CDR will be an empty vector.
+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.
address@hidden does not become part of the
address@hidden does not become part of the
connection and will continue to accept new requests.
@end deffn
@@ -2010,79 +2065,101 @@
@end table
@deffn primitive getsockname sock
-Return the address of @var{socket}, in the same form as the
+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
@deffn primitive getpeername sock
-Return the address of the socket that the socket @var{socket}
+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
@deffn primitive recv! sock buf [flags]
-Receives data from the socket port @var{socket}. @var{socket} must already
+Receive data from a socket port.
address@hidden 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
+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
+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.
+The value returned is the number of bytes read from the
+socket.
-Note that the data is read directly from the socket file descriptor:
+Note that the data is read directly from the socket file
+descriptor:
any unread buffered port data is ignored.
@end deffn
@deffn primitive send sock message [flags]
-Transmits the string @var{message} on the socket port @var{socket}.
address@hidden 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
+Transmit the string @var{message} on a socket port @var{sock}.
address@hidden 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:
+Note that the data is written directly to the socket
+file descriptor:
any unflushed buffered port data is ignored.
@end deffn
@deffn primitive recvfrom! sock str [flags [start [end]]]
-Return data from the socket port @var{socket} and also
+Return data from the socket port @var{sock} and also
information about where the data was received from.
address@hidden must already be bound to the address from which
address@hidden 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}.
+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
@deffn primitive sendto sock message fam address . args_and_flags
-Transmits the string @var{message} on the socket port @var{socket}. The
-destination address is specified using the @var{family}, @var{address} and
address@hidden arguments, in a similar way to the @code{connect}
-procedure. 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
+Transmit the string @var{message} on the socket port
address@hidden The
+destination address is specified using the @var{fam},
address@hidden and
address@hidden arguments, in a similar way to the
address@hidden 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.
-Note that the data is written directly to the socket file descriptor:
+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
@@ -2091,28 +2168,28 @@
this automatically for addresses, the conversion will still need to
be done when sending or receiving encoded integer data from the network.
address@hidden primitive htons in
-Return a new integer from @var{value} by converting from host
-to network order. @var{value} must be within the range of a C
-unsigned short integer.
address@hidden primitive htons value
+Convert a 16 bit quantity from host to network byte ordering.
address@hidden is packed into 2 bytes, which are then converted
+and returned as a new integer.
@end deffn
address@hidden primitive ntohs in
-Return a new integer from @var{value} by converting from
-network to host order. @var{value} must be within the range of
-a C unsigned short integer.
address@hidden primitive ntohs value
+Convert a 16 bit quantity from network to host byte ordering.
address@hidden is packed into 2 bytes, which are then converted
+and returned as a new integer.
@end deffn
address@hidden primitive htonl in
-Return a new integer from @var{value} by converting from host
-to network order. @var{value} must be within the range of a C
-unsigned long integer.
address@hidden primitive htonl value
+Convert a 32 bit quantity from host to network byte ordering.
address@hidden is packed into 4 bytes, which are then converted
+and returned as a new integer.
@end deffn
address@hidden primitive ntohl in
-Return a new integer from @var{value} by converting from
-network to host order. @var{value} must be within the range of
-a C unsigned long integer.
address@hidden primitive ntohl value
+Convert a 32 bit quantity from network to host byte ordering.
address@hidden is packed into 4 bytes, which are then converted
+and returned as a new integer.
@end deffn
These procedures are inconvenient to use at present, but consider:
@@ -2190,6 +2267,7 @@
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,
Index: guile/guile-core/doc/scheme-control.texi
diff -u guile/guile-core/doc/scheme-control.texi:1.11
guile/guile-core/doc/scheme-control.texi:1.12
--- guile/guile-core/doc/scheme-control.texi:1.11 Sun Apr 22 15:11:05 2001
+++ guile/guile-core/doc/scheme-control.texi Fri May 4 14:53:59 2001
@@ -409,8 +409,7 @@
* Exception Terminology:: Different ways to say the same thing.
* Catch:: Setting up to catch exceptions.
* Throw:: Throwing an exception.
-* Lazy Catch:: Catch without unwinding.
-* Stack Catch:: Capturing the stack at a throw.
+* Lazy Catch:: Catch without unwinding the stack.
* Exception Implementation:: How Guile implements exceptions.
@end menu
@@ -497,12 +496,16 @@
@lisp
(handler key args ...)
@end lisp
+
@var{key} is a symbol or @code{#t}.
+
@var{thunk} takes no arguments. If @var{thunk} returns
normally, that is the return value of @code{catch}.
+
Handler is invoked outside the scope of its own @code{catch}.
If @var{handler} again throws to the same key, a new handler
from further up the call chain is invoked.
+
If the key is @code{#t}, then a throw to @emph{any} symbol will
match this call to @code{catch}.
@end deffn
@@ -543,10 +546,10 @@
@deffn primitive throw key . args
Invoke the catch form matching @var{key}, passing @var{args} to the
address@hidden
address@hidden
@var{key} is a symbol. It will match catches of the same symbol or of
-#t.
address@hidden
If there is no handler at all, Guile prints an error and then exits.
@end deffn
@@ -596,28 +599,115 @@
@node Lazy Catch
@subsection Catch Without Unwinding
+A @dfn{lazy catch} is used in the same way as a normal @code{catch},
+with @var{key}, @var{thunk} and @var{handler} arguments specifying the
+exception type, normal case code and handler procedure, but differs in
+two important respects.
+
address@hidden
address@hidden
+The handler procedure is executed without unwinding the call stack from
+the context of the @code{throw} expression that caused the handler to be
+invoked.
+
address@hidden
+If the handler returns normally --- i.e. does not @emph{itself} throw an
+exception --- then the @code{throw} expression returns normally to its
+caller with the handler's value.
address@hidden itemize
+
@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.
@end deffn
+The net result is that throwing an exception that is caught by a
address@hidden is @emph{almost} equivalent to calling the
address@hidden's handler inline instead of each @code{throw}, and
+then omitting the surrounding @code{lazy-catch}. In other words,
+
@lisp
-(lazy-catch 'badex
+(lazy-catch 'key
+ (lambda () @dots{} (throw 'key args @dots{}) @dots{})
+ handler)
address@hidden lisp
+
address@hidden
+is @emph{almost} equivalent to
+
address@hidden
+((lambda () @dots{} (handler 'key args @dots{}) @dots{}))
address@hidden lisp
+
address@hidden
+But why only @emph{almost}? The difference is that with
address@hidden, the dynamic context is unwound back to just outside
+the @code{lazy-catch} expression before invoking the handler. (For an
+introduction to what is meant by dynamic context, @xref{Dynamic Wind}.)
+
+Then, if the handler @emph{itself} throws an exception, that exception
+must be caught by some kind of @code{catch} (including perhaps another
address@hidden) higher up the call stack. On the other hand, if the
+handler returns normally, the dynamic context is wound back to that of
+the @code{throw} expression before passing the handler's return value to
+the continuation of the @code{throw}.
+
+In most cases where @code{lazy-catch} is used, the handler does indeed
+throw another exception, which is caught by a higher-level @code{catch}.
+But this pattern is not mandatory, and it can be useful for the handler
+to return normally. In the following example, the @code{lazy-catch}
+handler is called twice and the results of the two calls added together.
+
address@hidden
+(lazy-catch 'foo
(lambda ()
- (+ (throw 'badex 1)
- (throw 'badex 2)))
+ (+ (throw 'foo 1)
+ (throw 'foo 2)))
(lambda args
(cadr args)))
@result{}
3
@end lisp
+To see the point about dynamic context, consider the case where the
+normal case thunk uses @code{with-fluids} (REFFIXME) to temporarily
+change the value of a fluid:
address@hidden Stack Catch
address@hidden Capturing the Stack at a Throw
address@hidden
+(define f (make-fluid))
+(fluid-set! f "top level value")
+(define (handler . args)
+ (cons (fluid-ref f) args))
+(lazy-catch 'foo
+ (lambda ()
+ (with-fluids ((f "local value"))
+ (throw 'foo)))
+ handler)
address@hidden
+("top level value" foo)
+
+((lambda ()
+ (with-fluids ((f "local value"))
+ (handler 'foo))))
address@hidden
+("local value" foo)
address@hidden lisp
+
address@hidden
+In the @code{lazy-catch} version, the unwinding of dynamic context
+restores @code{f} to its value outside the @code{with-fluids} block
+before the handler is invoked, so the handler's @code{(fluid-ref f)}
+returns the external value.
+
address@hidden is useful because it permits the implementation of
+debuggers and other reflective programming tools that need to access the
+state of the call stack at the exact point where an exception or an
+error is thrown. For an example of this, see REFFIXME:stack-catch.
+
+
@node Exception Implementation
@subsection How Guile Implements Exceptions
@@ -702,6 +792,7 @@
All three arguments must be 0-argument procedures.
@var{in_guard} is called, then @var{thunk}, then
@var{out_guard}.
+
If, any time during the execution of @var{thunk}, the
continuation of the @code{dynamic_wind} expression is escaped
non-locally, @var{out_guard} is called. If the continuation of
@@ -718,15 +809,18 @@
;; in-guard:
;;
(lambda () (set! x 'special-binding))
+
;; thunk
;;
(lambda () (display x) (newline)
(call-with-current-continuation escape)
(display x) (newline)
x)
+
;; out-guard:
;;
(lambda () (set! x old-x)))))))
+
;; Prints:
special-binding
;; Evaluates to:
Index: guile/guile-core/doc/scheme-data.texi
diff -u guile/guile-core/doc/scheme-data.texi:1.15
guile/guile-core/doc/scheme-data.texi:1.16
--- guile/guile-core/doc/scheme-data.texi:1.15 Thu May 3 21:57:39 2001
+++ guile/guile-core/doc/scheme-data.texi Fri May 4 14:53:59 2001
@@ -943,6 +943,7 @@
@deffn primitive logand n1 n2
Return the integer which is the bit-wise AND of the two integer
arguments.
+
@lisp
(number->string (logand #b1100 #b1010) 2)
@result{} "1000"
@@ -952,6 +953,7 @@
@deffn primitive logior n1 n2
Return the integer which is the bit-wise OR of the two integer
arguments.
+
@lisp
(number->string (logior #b1100 #b1010) 2)
@result{} "1110"
@@ -961,6 +963,7 @@
@deffn primitive logxor n1 n2
Return the integer which is the bit-wise XOR of the two integer
arguments.
+
@lisp
(number->string (logxor #b1100 #b1010) 2)
@result{} "110"
@@ -970,6 +973,7 @@
@deffn primitive lognot n
Return the integer which is the 2s-complement of the integer
argument.
+
@lisp
(number->string (lognot #b10000000) 2)
@result{} "-10000001"
@@ -1007,8 +1011,10 @@
will always be rounded towards minus infinity. Therefore, the
results of ash and a corresponding bitwise shift will differ if
@var{n} is negative.
+
Formally, the function returns an integer equivalent to
@code{(inexact->exact (floor (* @var{n} (expt 2 @var{cnt}))))}.
+
@lisp
(number->string (ash #b1 3) 2) @result{} "1000"
(number->string (ash #b1010 -1) 2) @result{} "101"
@@ -1020,6 +1026,7 @@
positive, the 1-bits in its binary representation are counted.
If negative, the 0-bits in its two's-complement binary
representation are counted. If 0, 0 is returned.
+
@lisp
(logcount #b10101010)
@result{} 4
@@ -1032,6 +1039,7 @@
@deffn primitive integer-length n
Return the number of bits neccessary to represent @var{n}.
+
@lisp
(integer-length #b10101010)
@result{} 8
@@ -1045,6 +1053,7 @@
@deffn primitive integer-expt n k
Return @var{n} raised to the non-negative integer exponent
@var{k}.
+
@lisp
(integer-expt 2 5)
@result{} 32
@@ -1057,6 +1066,7 @@
Return the integer composed of the @var{start} (inclusive)
through @var{end} (exclusive) bits of @var{n}. The
@var{start}th bit becomes the 0-th bit in the result.
+
@lisp
(number->string (bit-extract #b1101101010 0 4) 2)
@result{} "1010"
@@ -1075,10 +1085,12 @@
@deffn primitive random n [state]
Return a number in [0,N).
+
Accepts a positive integer or real n and returns a
number of the same type between zero (inclusive) and
N (exclusive). The values returned have a uniform
distribution.
+
The optional argument @var{state} must be of the type produced
by @code{seed->random-state}. It defaults to the value of the
variable @var{*random-state*}. This object is used to maintain
@@ -1514,6 +1526,7 @@
@deffn primitive substring-fill! str start end fill
Change every character in @var{str} between @var{start} and
@var{end} to @var{fill}.
+
@lisp
(define y "abcdefg")
(substring-fill! y 1 3 #\r)
@@ -1610,6 +1623,7 @@
Lexicographic equality predicate; return @code{#t} if the two
strings are the same length and contain the same characters in
the same positions, otherwise return @code{#f}.
+
The procedure @code{string-ci=?} treats upper and lower case
letters as though they were the same character, but
@code{string=?} treats upper and lower case as distinct
@@ -1689,6 +1703,7 @@
@var{to} limit the search to a portion of the string. This
procedure essentially implements the @code{index} or
@code{strchr} functions from the C library.
+
@lisp
(string-index "weiner" #\e)
@result{} 1
@@ -1706,6 +1721,7 @@
string rather than from the left. This procedure essentially
implements the @code{rindex} or @code{strrchr} functions from
the C library.
+
@lisp
(string-rindex "weiner" #\e)
@result{} 4
@@ -1763,6 +1779,7 @@
@deffn primitive string-capitalize! str
Upcase the first character of every word in @var{str}
destructively and return @var{str}.
+
@lisp
y @result{} "hello world"
(string-capitalize! y) @result{} "Hello World"
@@ -1862,8 +1879,10 @@
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
@@ -2354,8 +2373,10 @@
to create such symbols because in some implementations of
Scheme they cannot be read as themselves. See
@code{symbol->string}.
+
The following examples assume that the implementation's
standard case is lower case:
+
@lisp
(eq? 'mISSISSIppi 'mississippi) @result{} #t
(string->symbol "mISSISSIppi") @result{} @r{the symbol with name "mISSISSIppi"}
@@ -2383,8 +2404,10 @@
passed to @code{string->symbol}. It is an error to apply
mutation procedures like @code{string-set!} to strings returned
by this procedure.
+
The following examples assume that the implementation's
standard case is lower case:
+
@lisp
(symbol->string 'flying-fish) @result{} "flying-fish"
(symbol->string 'Martin) @result{} "martin"
@@ -3804,11 +3827,13 @@
@var{dim0}, @var{dim1}, @dots{} should be integers between 0
and the rank of the array to be returned. Each integer in that
range must appear at least once in the argument list.
+
The values of @var{dim0}, @var{dim1}, @dots{} correspond to
dimensions in the array to be returned, their positions in the
argument list to dimensions of @var{array}. Several @var{dim}s
may have the same value, in which case the returned array will
have smaller rank than @var{array}.
+
@lisp
(transpose-array '#2((a b) (c d)) 1 0) @result{} #2((a c) (b d))
(transpose-array '#2((a b) (c d)) 0 0) @result{} #1(a d)
@@ -4705,6 +4730,7 @@
that takes two arguments, a key to be hashed and a table size.
@code{assoc} must be an associator function, like @code{assoc},
@code{assq} or @code{assv}.
+
By way of illustration, @code{hashq-ref table key} is
equivalent to @code{hashx-ref hashq assq table key}.
@end deffn
@@ -4716,6 +4742,7 @@
that takes two arguments, a key to be hashed and a table size.
@code{assoc} must be an associator function, like @code{assoc},
@code{assq} or @code{assv}.
+
By way of illustration, @code{hashq-set! table key} is
equivalent to @code{hashx-set! hashq assq table key}.
@end deffn
@@ -4849,6 +4876,7 @@
@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
@@ -4858,6 +4886,7 @@
@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)
Index: guile/guile-core/doc/scheme-debug.texi
diff -u guile/guile-core/doc/scheme-debug.texi:1.2
guile/guile-core/doc/scheme-debug.texi:1.3
--- guile/guile-core/doc/scheme-debug.texi:1.2 Mon Apr 9 11:36:39 2001
+++ guile/guile-core/doc/scheme-debug.texi Fri May 4 14:54:00 2001
@@ -139,7 +139,7 @@
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).
address@hidden must be a list if integers and specifies how the
address@hidden must be a list of integers and specifies how the
resulting stack will be narrowed.
@end deffn
Index: guile/guile-core/doc/scheme-evaluation.texi
diff -u guile/guile-core/doc/scheme-evaluation.texi:1.9
guile/guile-core/doc/scheme-evaluation.texi:1.10
--- guile/guile-core/doc/scheme-evaluation.texi:1.9 Sun Apr 22 07:56:52 2001
+++ guile/guile-core/doc/scheme-evaluation.texi Fri May 4 14:54:00 2001
@@ -226,7 +226,7 @@
@deffn primitive eval2 obj env_thunk
Evaluate @var{exp}, a Scheme expression, in the environment
-designated by @var{lookup}, a symbol-lookup function."
+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.
Index: guile/guile-core/doc/scheme-io.texi
diff -u guile/guile-core/doc/scheme-io.texi:1.12
guile/guile-core/doc/scheme-io.texi:1.13
--- guile/guile-core/doc/scheme-io.texi:1.12 Thu May 3 21:57:39 2001
+++ guile/guile-core/doc/scheme-io.texi Fri May 4 14:54:00 2001
@@ -249,6 +249,7 @@
Sets the current position of @var{fd/port} to the integer
@var{offset}, which is interpreted according to the value of
@var{whence}.
+
One of the following variables should be supplied for
@var{whence}:
@defvar SEEK_SET
@@ -262,6 +263,7 @@
@end defvar
If @var{fd/port} is a file descriptor, the underlying system
call is @code{lseek}. @var{port} may be a string port.
+
The value returned is the new position in the file. This means
that the current position of a port can be obtained using:
@lisp
@@ -272,6 +274,7 @@
@deffn primitive ftell fd_port
Return an integer representing the current position of
@var{fd/port}, measured from the beginning. Equivalent to:
+
@lisp
(seek port 0 SEEK_CUR)
@end lisp
@@ -378,6 +381,7 @@
specified, store data only into the substring of @var{str}
bounded by @var{start} and @var{end} (which default to the
beginning and end of the string, respectively).
+
Return a pair consisting of the delimiter that terminated the
string and the number of characters read. If reading stopped
at the end of file, the delimiter returned is the
@@ -714,6 +718,7 @@
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
@@ -726,14 +731,17 @@
@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
@@ -744,6 +752,7 @@
(lambda () (char-upcase (read-char)))
(lambda () (display "@@" stdout)))
"rw"))
+
(write p p) @result{} #<input-output: soft 8081e20>
@end lisp
@end deffn
Index: guile/guile-core/doc/scheme-memory.texi
diff -u guile/guile-core/doc/scheme-memory.texi:1.4
guile/guile-core/doc/scheme-memory.texi:1.5
--- guile/guile-core/doc/scheme-memory.texi:1.4 Mon Apr 9 11:36:40 2001
+++ guile/guile-core/doc/scheme-memory.texi Fri May 4 14:54:00 2001
@@ -90,6 +90,7 @@
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
Index: guile/guile-core/doc/scheme-modules.texi
diff -u guile/guile-core/doc/scheme-modules.texi:1.6
guile/guile-core/doc/scheme-modules.texi:1.7
--- guile/guile-core/doc/scheme-modules.texi:1.6 Wed May 2 07:44:38 2001
+++ guile/guile-core/doc/scheme-modules.texi Fri May 4 14:54:00 2001
@@ -99,7 +99,7 @@
* General Information about Modules:: Guile module basics.
* Loading Guile Modules:: How to use existing modules.
* Creating Guile Modules:: How to package your code into modules.
-* More Module Procedures:: Low--level module code.
+* More Module Procedures:: Low-level module code.
* Included Guile Modules:: Which modules come with Guile?
@end menu
@@ -108,7 +108,7 @@
A Guile module is a collection of procedures, variables and syntactic
forms (macros), which are either public or private. Public bindings are
-in the so--called @dfn{export list} of a module and can be made visible
+in the so-called @dfn{export list} of a module and can be made visible
to other modules, which import them. This @dfn{module import} is called
@dfn{using} of a module, and consists of loading of the module code (if
it has not already been loaded) and making all exported items of the
@@ -132,7 +132,7 @@
Guile and in all other directories in the load path.
@c FIXME::martin: Not sure about this, maybe someone knows better?
-Every module has a so--called syntax transformer associated with it.
+Every module has a so-called syntax transformer associated with it.
This is a procedure which performs all syntax transformation for the
time the module is read in and evaluated. When working with modules,
you can manipulate the current syntax transformer using the
@@ -150,7 +150,7 @@
When two or more modules are imported, and they export bindings with the
same names, the last imported module wins, and the exported binding of
that last module will silently be used. This might lead to
-hard--to--find errors because wrong procedures or variables are used.
+hard-to-find errors because wrong procedures or variables are used.
@node Loading Guile Modules
@@ -225,7 +225,7 @@
@code{define-module} makes this module available to Guile programs under
the given @var{module-specification}.
-The @var{options} are keyword/value--pairs which specify more about the
+The @var{options} are keyword/value pairs which specify more about the
defined module. The recognized options and their meaning is shown in
the following table.
@@ -315,7 +315,7 @@
Guile's support for multi threaded execution (@pxref{Scheduling}).
@item (ice-9 rdelim)
-Line-- and character--delimited input (REFFIXME).
+Line- and character-delimited input (REFFIXME).
@item (ice-9 documentation)
Online documentation (REFFIXME).
@@ -327,26 +327,26 @@
Support for some additional string port procedures (REFFIXME).
@item (srfi srfi-8)
-Multiple--value handling with @code{receive} (REFFIXME).
+Multiple-value handling with @code{receive} (REFFIXME).
@item (srfi srfi-9)
Record definition with @code{define-record-type} (REFFIXME).
@item (srfi srfi-10)
-Read--hash extension @code{#,()} (REFFIXME).
+Read hash extension @code{#,()} (REFFIXME).
@item (srfi srfi-11)
-Multiple--value handling with @code{let-values} and @code{let-values*}
+Multiple-value handling with @code{let-values} and @code{let-values*}
(REFFIXME).
@item (srfi srfi-13)
String library (REFFIXME).
@item (srfi srfi-14)
-Character--set library (REFFIXME).
+Character-set library (REFFIXME).
@item (srfi srfi-17)
-Getter--with--setter support (REFFIXME).
+Getter-with-setter support (REFFIXME).
@item (ice-9 slib)
This module contains hooks for using Aubrey Jaffer's portable Scheme
Index: guile/guile-core/doc/scheme-procedures.texi
diff -u guile/guile-core/doc/scheme-procedures.texi:1.8
guile/guile-core/doc/scheme-procedures.texi:1.9
--- guile/guile-core/doc/scheme-procedures.texi:1.8 Tue Apr 17 12:29:52 2001
+++ guile/guile-core/doc/scheme-procedures.texi Fri May 4 14:54:00 2001
@@ -521,6 +521,7 @@
environment. The value returned from @var{code} which has been
passed to @code{procedure->memoizing-macro} replaces the form
passed to @var{code}. For example:
+
@lisp
(define trace
(procedure->macro
@@ -537,6 +538,7 @@
environment. The value returned from @var{proc} which has been
passed to @code{procedure->memoizing-macro} replaces the form
passed to @var{proc}. For example:
+
@lisp
(define trace
(procedure->macro
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1374
guile/guile-core/libguile/ChangeLog:1.1375
--- guile/guile-core/libguile/ChangeLog:1.1374 Thu May 3 21:59:05 2001
+++ guile/guile-core/libguile/ChangeLog Fri May 4 14:54:00 2001
@@ -1,3 +1,17 @@
+2001-05-04 Neil Jerram <address@hidden>
+
+ * eval.c (scm_promise_p), list.c (scm_append_x, scm_reverse_x),
+ symbols.c (scm_symbol_to_string), vports.c (scm_make_soft_port):
+ Change R4RS references to R5RS.
+
+ * guile-snarf.awk.in: Fixes so that (i) blank lines in the
+ docstring source are correctly reproduced in the output (ii)
+ we don't anymore get occasional trailing quotes. Also reorganized
+ and commented the code a little.
+
+ * scmsigs.c (scm_raise), throw.c (scm_throw): Docstring format
+ fixes.
+
2001-05-04 Martin Grabmueller <address@hidden>
* strop.c (scm_string_split): New procedure.
Index: guile/guile-core/libguile/eval.c
diff -u guile/guile-core/libguile/eval.c:1.216
guile/guile-core/libguile/eval.c:1.217
--- guile/guile-core/libguile/eval.c:1.216 Tue Apr 24 16:27:13 2001
+++ guile/guile-core/libguile/eval.c Fri May 4 14:54:00 2001
@@ -3809,7 +3809,7 @@
SCM_DEFINE (scm_promise_p, "promise?", 1, 0, 0,
(SCM obj),
"Return true if @var{obj} is a promise, i.e. a delayed
computation\n"
- "(@pxref{Delayed evaluation,,,r4rs.info,The Revised^4 Report on
Scheme}).")
+ "(@pxref{Delayed evaluation,,,r5rs.info,The Revised^5 Report on
Scheme}).")
#define FUNC_NAME s_scm_promise_p
{
return SCM_BOOL (SCM_TYP16_PREDICATE (scm_tc16_promise, obj));
Index: guile/guile-core/libguile/guile-snarf.awk.in
diff -u guile/guile-core/libguile/guile-snarf.awk.in:1.13
guile/guile-core/libguile/guile-snarf.awk.in:1.14
--- guile/guile-core/libguile/guile-snarf.awk.in:1.13 Fri Mar 23 09:24:28 2001
+++ guile/guile-core/libguile/guile-snarf.awk.in Fri May 4 14:54:00 2001
@@ -96,17 +96,35 @@
print "@deffn primitive " nicer_function_proto > dot_doc_file;
}
-/SCM_SNARF_DOCSTRING_START/,/SCM_SNARF_DOCSTRING_END.*$/ { copy = $0;
- gsub(/.*SCM_SNARF_DOCSTRING_START/,"",copy);
- sub(/^\#.*/,"", copy);
- sub(/^[ \t]*\"?/,"", copy);
- sub(/\"?[ \t]*SCM_SNARF_DOCSTRING_END.*$/,"", copy);
- gsub(/\\n\\n\"?/,"\n",copy);
- gsub(/\\n\"?[ \t]*$/,"",copy);
- gsub(/\\\"/,"\"",copy);
- gsub(/\\\\/,"\\",copy);
- gsub(/[ \t]*$/,"", copy);
- if (copy != "") { print copy > dot_doc_file }
+/SCM_SNARF_DOCSTRING_START/,/SCM_SNARF_DOCSTRING_END.*$/ { copy = $0;
+
+ # Trim everything up to and including
+ # SCM_SNARF_DOCSTRING_START marker.
+ gsub(/.*SCM_SNARF_DOCSTRING_START/,"",copy);
+
+ # Trim leading whitespace and opening quote.
+ sub(/^[ \t]*\"?/,"", copy);
+
+ # Trim closing quote and trailing whitespace, or
+ # closing quote and whitespace followed by the
+ # SCM_SNARF_DOCSTRING_END marker.
+ sub(/[ \t]*\"?[ \t]*$/,"", copy);
+ sub(/[ \t]*\"?[ \t]*SCM_SNARF_DOCSTRING_END.*$/,"", copy);
+
+ # Replace escaped characters.
+ gsub(/\\n/,"\n",copy);
+ gsub(/\\\"/,"\"",copy);
+ gsub(/\\\\/,"\\",copy);
+
+ # Some docstrings end each line with "\n", while
+ # others don't. Therefore we always strip off one "\n"
+ # if present at the end of the line. Docstrings must
+ # therefore always use "\n\n" to indicate a blank line.
+ if (copy != "")
+ {
+ sub(/[ \t]*\n$/, "", copy);
+ print copy > dot_doc_file;
+ }
}
/SCM_SNARF_DOCSTRING_END[ \t]*/ { print "@end deffn" >> dot_doc_file; }
Index: guile/guile-core/libguile/list.c
diff -u guile/guile-core/libguile/list.c:1.53
guile/guile-core/libguile/list.c:1.54
--- guile/guile-core/libguile/list.c:1.53 Tue Apr 3 06:19:04 2001
+++ guile/guile-core/libguile/list.c Fri May 4 14:54:00 2001
@@ -237,7 +237,7 @@
SCM_DEFINE (scm_append_x, "append!", 0, 0, 1,
(SCM lists),
"A destructive version of @code{append} (@pxref{Pairs and\n"
- "Lists,,,r4rs, The Revised^4 Report on Scheme}). The cdr field\n"
+ "Lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr field\n"
"of each list's final pair is changed to point to the head of\n"
"the next list, so no consing is performed. Return a pointer to\n"
"the mutated list.")
@@ -321,8 +321,8 @@
SCM_DEFINE (scm_reverse_x, "reverse!", 1, 1, 0,
(SCM lst, SCM new_tail),
- "A destructive version of @code{reverse} (@pxref{Pairs and
Lists,,,r4rs,\n"
- "The Revised^4 Report on Scheme}). The cdr of each cell in
@var{lst} is\n"
+ "A destructive version of @code{reverse} (@pxref{Pairs and
Lists,,,r5rs,\n"
+ "The Revised^5 Report on Scheme}). The cdr of each cell in
@var{lst} is\n"
"modified to point to the previous list element. Return a pointer
to the\n"
"head of the reversed list.\n\n"
"Caveat: because the list is modified in place, the tail of the
original\n"
Index: guile/guile-core/libguile/scmsigs.c
diff -u guile/guile-core/libguile/scmsigs.c:1.55
guile/guile-core/libguile/scmsigs.c:1.56
--- guile/guile-core/libguile/scmsigs.c:1.55 Tue Apr 10 00:57:05 2001
+++ guile/guile-core/libguile/scmsigs.c Fri May 4 14:54:00 2001
@@ -470,7 +470,6 @@
SCM_DEFINE (scm_raise, "raise", 1, 0, 0,
(SCM sig),
- "\n"
"Sends a specified signal @var{sig} to the current process, where\n"
"@var{sig} is as described for the kill procedure.")
#define FUNC_NAME s_scm_raise
Index: guile/guile-core/libguile/symbols.c
diff -u guile/guile-core/libguile/symbols.c:1.84
guile/guile-core/libguile/symbols.c:1.85
--- guile/guile-core/libguile/symbols.c:1.84 Tue Apr 3 06:19:05 2001
+++ guile/guile-core/libguile/symbols.c Fri May 4 14:54:00 2001
@@ -430,7 +430,7 @@
(SCM s),
"Return the name of @var{symbol} as a string. If the symbol was\n"
"part of an object returned as the value of a literal expression\n"
- "(section @pxref{Literal expressions,,,r4rs, The Revised^4\n"
+ "(section @pxref{Literal expressions,,,r5rs, The Revised^5\n"
"Report on Scheme}) or by a call to the @code{read} procedure,\n"
"and its name contains alphabetic characters, then the string\n"
"returned will contain characters in the implementation's\n"
Index: guile/guile-core/libguile/throw.c
diff -u guile/guile-core/libguile/throw.c:1.79
guile/guile-core/libguile/throw.c:1.80
--- guile/guile-core/libguile/throw.c:1.79 Sun Apr 22 15:16:07 2001
+++ guile/guile-core/libguile/throw.c Fri May 4 14:54:00 2001
@@ -591,7 +591,7 @@
"Invoke the catch form matching @var{key}, passing @var{args} to
the\n"
"@var{handler}. \n\n"
"@var{key} is a symbol. It will match catches of the same symbol
or of\n"
- "#t.\n\n"
+ "@code{#t}.\n\n"
"If there is no handler at all, Guile prints an error and then
exits.")
#define FUNC_NAME s_scm_throw
{
Index: guile/guile-core/libguile/vports.c
diff -u guile/guile-core/libguile/vports.c:1.43
guile/guile-core/libguile/vports.c:1.44
--- guile/guile-core/libguile/vports.c:1.43 Tue Apr 3 06:19:05 2001
+++ guile/guile-core/libguile/vports.c Fri May 4 14:54:00 2001
@@ -171,7 +171,7 @@
"there is no useful operation for them to perform.\n"
"\n"
"If thunk 3 returns @code{#f} or an @code{eof-object}\n"
- "(@pxref{Input, eof-object?, ,r4rs, The Revised^4 Report on\n"
+ "(@pxref{Input, eof-object?, ,r5rs, The Revised^5 Report on\n"
"Scheme}) it indicates that the port has reached end-of-file.\n"
"For example:\n"
"\n"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- guile/guile-core doc/ChangeLog doc/new-docstrin...,
Neil Jerram <=