2001-03-23 15:05:40 +00:00
acons
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:35
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} acons key value alist
@deffnx {C Function} scm_acons (key, value, alist)
Add a new key-value pair to @var{alist}. A new pair is
2001-03-23 15:05:40 +00:00
created whose car is @var{key} and whose cdr is @var{value}, and the
pair is consed onto @var{alist}, and the new list is returned. This
function is @emph{not} destructive; @var{alist} is not modified.
@end deffn
sloppy-assq
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:49
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sloppy-assq key alist
@deffnx {C Function} scm_sloppy_assq (key, alist)
2001-03-23 15:05:40 +00:00
Behaves like @code{assq} but does not do any error checking.
Recommended only for use in Guile internals.
@end deffn
sloppy-assv
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:67
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sloppy-assv key alist
@deffnx {C Function} scm_sloppy_assv (key, alist)
2001-03-23 15:05:40 +00:00
Behaves like @code{assv} but does not do any error checking.
Recommended only for use in Guile internals.
@end deffn
sloppy-assoc
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:85
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sloppy-assoc key alist
@deffnx {C Function} scm_sloppy_assoc (key, alist)
2001-03-23 15:05:40 +00:00
Behaves like @code{assoc} but does not do any error checking.
Recommended only for use in Guile internals.
@end deffn
assq
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:112
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assq key alist
@deffnx {Scheme Procedure} assv key alist
@deffnx {Scheme Procedure} assoc key alist
@deffnx {C Function} scm_assq (key, alist)
Fetch the entry in @var{alist} that is associated with @var{key}. To
2001-03-23 15:05:40 +00:00
decide whether the argument @var{key} matches a particular entry in
@var{alist}, @code{assq} compares keys with @code{eq?}, @code{assv}
uses @code{eqv?} and @code{assoc} uses @code{equal?}. If @var{key}
cannot be found in @var{alist} (according to whichever equality
2001-11-16 15:04:17 +00:00
predicate is in use), then return @code{#f}. These functions
2001-03-23 15:05:40 +00:00
return the entire alist entry found (i.e. both the key and the value).
@end deffn
assv
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:133
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assv key alist
@deffnx {C Function} scm_assv (key, alist)
2001-03-23 15:05:40 +00:00
Behaves like @code{assq} but uses @code{eqv?} for key comparison.
@end deffn
assoc
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:154
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assoc key alist
@deffnx {C Function} scm_assoc (key, alist)
2001-03-23 15:05:40 +00:00
Behaves like @code{assq} but uses @code{equal?} for key comparison.
@end deffn
assq-ref
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:198
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assq-ref alist key
@deffnx {Scheme Procedure} assv-ref alist key
@deffnx {Scheme Procedure} assoc-ref alist key
@deffnx {C Function} scm_assq_ref (alist, key)
2001-03-23 15:05:40 +00:00
Like @code{assq}, @code{assv} and @code{assoc}, except that only the
value associated with @var{key} in @var{alist} is returned. These
functions are equivalent to
@lisp
(let ((ent (@var{associator} @var{key} @var{alist})))
(and ent (cdr ent)))
@end lisp
where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}.
@end deffn
assv-ref
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:215
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assv-ref alist key
@deffnx {C Function} scm_assv_ref (alist, key)
2001-03-23 15:05:40 +00:00
Behaves like @code{assq-ref} but uses @code{eqv?} for key comparison.
@end deffn
assoc-ref
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:232
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assoc-ref alist key
@deffnx {C Function} scm_assoc_ref (alist, key)
2001-03-23 15:05:40 +00:00
Behaves like @code{assq-ref} but uses @code{equal?} for key comparison.
@end deffn
assq-set!
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:261
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assq-set! alist key val
@deffnx {Scheme Procedure} assv-set! alist key value
@deffnx {Scheme Procedure} assoc-set! alist key value
@deffnx {C Function} scm_assq_set_x (alist, key, val)
2001-03-23 15:05:40 +00:00
Reassociate @var{key} in @var{alist} with @var{value}: find any existing
@var{alist} entry for @var{key} and associate it with the new
@var{value}. If @var{alist} does not contain an entry for @var{key},
add a new one. Return the (possibly new) alist.
These functions do not attempt to verify the structure of @var{alist},
and so may cause unusual results if passed an object that is not an
association list.
@end deffn
assv-set!
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:279
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assv-set! alist key val
@deffnx {C Function} scm_assv_set_x (alist, key, val)
2001-03-23 15:05:40 +00:00
Behaves like @code{assq-set!} but uses @code{eqv?} for key comparison.
@end deffn
assoc-set!
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:297
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assoc-set! alist key val
@deffnx {C Function} scm_assoc_set_x (alist, key, val)
2001-03-23 15:05:40 +00:00
Behaves like @code{assq-set!} but uses @code{equal?} for key comparison.
@end deffn
assq-remove!
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:321
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assq-remove! alist key
@deffnx {Scheme Procedure} assv-remove! alist key
@deffnx {Scheme Procedure} assoc-remove! alist key
@deffnx {C Function} scm_assq_remove_x (alist, key)
2001-03-23 15:05:40 +00:00
Delete the first entry in @var{alist} associated with @var{key}, and return
the resulting alist.
@end deffn
assv-remove!
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:337
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assv-remove! alist key
@deffnx {C Function} scm_assv_remove_x (alist, key)
2001-03-23 15:05:40 +00:00
Behaves like @code{assq-remove!} but uses @code{eqv?} for key comparison.
@end deffn
assoc-remove!
2004-08-24 16:43:07 +00:00
@c snarfed from alist.c:353
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assoc-remove! alist key
@deffnx {C Function} scm_assoc_remove_x (alist, key)
2001-03-23 15:05:40 +00:00
Behaves like @code{assq-remove!} but uses @code{equal?} for key comparison.
@end deffn
make-arbiter
2004-08-24 16:43:07 +00:00
@c snarfed from arbiters.c:99
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-arbiter name
@deffnx {C Function} scm_make_arbiter (name)
2004-08-24 16:43:07 +00:00
Return an arbiter object, initially unlocked. Currently
@var{name} is only used for diagnostic output.
2001-03-23 15:05:40 +00:00
@end deffn
try-arbiter
2004-08-24 16:43:07 +00:00
@c snarfed from arbiters.c:116
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} try-arbiter arb
@deffnx {C Function} scm_try_arbiter (arb)
2004-08-24 16:43:07 +00:00
If @var{arb} is unlocked, then lock it and return @code{#t}.
If @var{arb} is already locked, then do nothing and return
@code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
release-arbiter
2004-08-24 16:43:07 +00:00
@c snarfed from arbiters.c:142
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} release-arbiter arb
@deffnx {C Function} scm_release_arbiter (arb)
2004-08-24 16:43:07 +00:00
If @var{arb} is locked, then unlock it and return @code{#t}.
If @var{arb} is already unlocked, then do nothing and return
@code{#f}.
Typical usage is for the thread which locked an arbiter to
later release it, but that's not required, any thread can
release it.
2001-03-23 15:05:40 +00:00
@end deffn
async
2004-08-24 16:43:07 +00:00
@c snarfed from async.c:97
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} async thunk
@deffnx {C Function} scm_async (thunk)
2001-03-23 15:05:40 +00:00
Create a new async for the procedure @var{thunk}.
@end deffn
async-mark
2004-08-24 16:43:07 +00:00
@c snarfed from async.c:106
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} async-mark a
@deffnx {C Function} scm_async_mark (a)
2001-03-23 15:05:40 +00:00
Mark the async @var{a} for future execution.
@end deffn
run-asyncs
2004-08-24 16:43:07 +00:00
@c snarfed from async.c:117
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} run-asyncs list_of_a
@deffnx {C Function} scm_run_asyncs (list_of_a)
2001-03-23 15:05:40 +00:00
Execute all thunks from the asyncs of the list @var{list_of_a}.
@end deffn
2002-10-19 16:33:25 +00:00
system-async-mark
2004-08-24 16:43:07 +00:00
@c snarfed from async.c:222
2002-10-19 16:33:25 +00:00
@deffn {Scheme Procedure} system-async-mark proc [thread]
@deffnx {C Function} scm_system_async_mark_for_thread (proc, thread)
2004-08-24 16:43:07 +00:00
Mark @var{proc} (a procedure with zero arguments) for future execution
in @var{thread}. If @var{proc} has already been marked for
@var{thread} but has not been executed yet, this call has no effect.
If @var{thread} is omitted, the thread that called
@code{system-async-mark} is used.
This procedure is not safe to be called from C signal handlers. Use
@code{scm_sigaction} or @code{scm_sigaction_for_thread} to install
signal handlers.
2002-10-19 16:33:25 +00:00
@end deffn
2001-03-23 15:05:40 +00:00
noop
2004-08-24 16:43:07 +00:00
@c snarfed from async.c:253
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} noop . args
@deffnx {C Function} scm_noop (args)
2001-03-23 15:05:40 +00:00
Do nothing. When called without arguments, return @code{#f},
otherwise return the first argument.
@end deffn
2002-10-19 16:33:25 +00:00
call-with-blocked-asyncs
2004-08-24 16:43:07 +00:00
@c snarfed from async.c:319
2002-10-19 16:33:25 +00:00
@deffn {Scheme Procedure} call-with-blocked-asyncs proc
@deffnx {C Function} scm_call_with_blocked_asyncs (proc)
Call @var{proc} with no arguments and block the execution
of system asyncs by one level for the current thread while
it is running. Return the value returned by @var{proc}.
@end deffn
call-with-unblocked-asyncs
2004-08-24 16:43:07 +00:00
@c snarfed from async.c:343
2002-10-19 16:33:25 +00:00
@deffn {Scheme Procedure} call-with-unblocked-asyncs proc
@deffnx {C Function} scm_call_with_unblocked_asyncs (proc)
Call @var{proc} with no arguments and unblock the execution
of system asyncs by one level for the current thread while
it is running. Return the value returned by @var{proc}.
@end deffn
2001-03-23 15:05:40 +00:00
display-error
2004-08-24 16:43:07 +00:00
@c snarfed from backtrace.c:303
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} display-error stack port subr message args rest
@deffnx {C Function} scm_display_error (stack, port, subr, message, args, rest)
2001-03-23 15:05:40 +00:00
Display an error message to the output port @var{port}.
@var{stack} is the saved stack for the error, @var{subr} is
2002-03-15 14:03:53 +00:00
the name of the procedure in which the error occurred and
2001-03-23 15:05:40 +00:00
@var{message} is the actual error message, which may contain
formatting instructions. These will format the arguments in
the list @var{args} accordingly. @var{rest} is currently
ignored.
@end deffn
display-application
2004-08-24 16:43:07 +00:00
@c snarfed from backtrace.c:446
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} display-application frame [port [indent]]
@deffnx {C Function} scm_display_application (frame, port, indent)
2001-03-23 15:05:40 +00:00
Display a procedure application @var{frame} to the output port
@var{port}. @var{indent} specifies the indentation of the
output.
@end deffn
display-backtrace
2004-08-24 16:43:07 +00:00
@c snarfed from backtrace.c:756
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} display-backtrace stack port [first [depth]]
@deffnx {C Function} scm_display_backtrace (stack, port, first, depth)
2001-03-23 15:05:40 +00:00
Display a backtrace to the output port @var{port}. @var{stack}
is the stack to take the backtrace from, @var{first} specifies
where in the stack to start and @var{depth} how much frames
to display. Both @var{first} and @var{depth} can be @code{#f},
which means that default values will be used.
@end deffn
backtrace
2004-08-24 16:43:07 +00:00
@c snarfed from backtrace.c:779
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} backtrace
@deffnx {C Function} scm_backtrace ()
2001-03-23 15:05:40 +00:00
Display a backtrace of the stack saved by the last error
to the current output port.
@end deffn
not
2004-08-24 16:43:07 +00:00
@c snarfed from boolean.c:33
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} not x
@deffnx {C Function} scm_not (x)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is @code{#f}, else return @code{#f}.
@end deffn
boolean?
2004-08-24 16:43:07 +00:00
@c snarfed from boolean.c:43
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} boolean? obj
@deffnx {C Function} scm_boolean_p (obj)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{obj} is either @code{#t} or @code{#f}.
@end deffn
char?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:31
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char? x
@deffnx {C Function} scm_char_p (x)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is a character, else @code{#f}.
@end deffn
char=?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:40
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char=? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is the same character as @var{y}, else @code{#f}.
@end deffn
char<?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:53
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char<? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence,
else @code{#f}.
@end deffn
char<=?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:65
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char<=? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
ASCII sequence, else @code{#f}.
@end deffn
char>?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:77
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char>? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
sequence, else @code{#f}.
@end deffn
char>=?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:89
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char>=? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
ASCII sequence, else @code{#f}.
@end deffn
char-ci=?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:101
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-ci=? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is the same character as @var{y} ignoring
case, else @code{#f}.
@end deffn
char-ci<?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:113
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-ci<? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence
ignoring case, else @code{#f}.
@end deffn
char-ci<=?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:125
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-ci<=? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
ASCII sequence ignoring case, else @code{#f}.
@end deffn
char-ci>?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:137
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-ci>? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
sequence ignoring case, else @code{#f}.
@end deffn
char-ci>=?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:149
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-ci>=? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
ASCII sequence ignoring case, else @code{#f}.
@end deffn
char-alphabetic?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:162
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-alphabetic? chr
@deffnx {C Function} scm_char_alphabetic_p (chr)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{chr} is alphabetic, else @code{#f}.
Alphabetic means the same thing as the isalpha C library function.
@end deffn
char-numeric?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:173
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-numeric? chr
@deffnx {C Function} scm_char_numeric_p (chr)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{chr} is numeric, else @code{#f}.
Numeric means the same thing as the isdigit C library function.
@end deffn
char-whitespace?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:184
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-whitespace? chr
@deffnx {C Function} scm_char_whitespace_p (chr)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{chr} is whitespace, else @code{#f}.
Whitespace means the same thing as the isspace C library function.
@end deffn
char-upper-case?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:197
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-upper-case? chr
@deffnx {C Function} scm_char_upper_case_p (chr)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{chr} is uppercase, else @code{#f}.
Uppercase means the same thing as the isupper C library function.
@end deffn
char-lower-case?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:209
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-lower-case? chr
@deffnx {C Function} scm_char_lower_case_p (chr)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{chr} is lowercase, else @code{#f}.
Lowercase means the same thing as the islower C library function.
@end deffn
char-is-both?
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:223
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-is-both? chr
@deffnx {C Function} scm_char_is_both_p (chr)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{chr} is either uppercase or lowercase, else @code{#f}.
Uppercase and lowercase are as defined by the isupper and islower
C library functions.
@end deffn
char->integer
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:237
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char->integer chr
@deffnx {C Function} scm_char_to_integer (chr)
2001-03-23 15:05:40 +00:00
Return the number corresponding to ordinal position of @var{chr} in the
ASCII sequence.
@end deffn
integer->char
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:249
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} integer->char n
@deffnx {C Function} scm_integer_to_char (n)
2001-03-23 15:05:40 +00:00
Return the character at position @var{n} in the ASCII sequence.
@end deffn
char-upcase
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:259
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-upcase chr
@deffnx {C Function} scm_char_upcase (chr)
2001-03-23 15:05:40 +00:00
Return the uppercase character version of @var{chr}.
@end deffn
char-downcase
2004-08-24 16:43:07 +00:00
@c snarfed from chars.c:270
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-downcase chr
@deffnx {C Function} scm_char_downcase (chr)
2001-03-23 15:05:40 +00:00
Return the lowercase character version of @var{chr}.
@end deffn
debug-options-interface
2004-08-24 16:43:07 +00:00
@c snarfed from debug.c:53
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} debug-options-interface [setting]
@deffnx {C Function} scm_debug_options (setting)
2001-03-23 15:05:40 +00:00
Option interface for the debug options. Instead of using
this procedure directly, use the procedures @code{debug-enable},
2002-03-15 14:03:53 +00:00
@code{debug-disable}, @code{debug-set!} and @code{debug-options}.
2001-03-23 15:05:40 +00:00
@end deffn
with-traps
2004-08-24 16:43:07 +00:00
@c snarfed from debug.c:96
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} with-traps thunk
@deffnx {C Function} scm_with_traps (thunk)
2001-03-23 15:05:40 +00:00
Call @var{thunk} with traps enabled.
@end deffn
memoized?
2004-08-24 16:43:07 +00:00
@c snarfed from debug.c:134
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} memoized? obj
@deffnx {C Function} scm_memoized_p (obj)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{obj} is memoized.
@end deffn
2004-08-24 16:43:07 +00:00
unmemoize-expr
@c snarfed from debug.c:271
@deffn {Scheme Procedure} unmemoize-expr m
@deffnx {C Function} scm_i_unmemoize_expr (m)
2001-03-23 15:05:40 +00:00
Unmemoize the memoized expression @var{m},
@end deffn
memoized-environment
2004-08-24 16:43:07 +00:00
@c snarfed from debug.c:281
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} memoized-environment m
@deffnx {C Function} scm_memoized_environment (m)
2001-03-23 15:05:40 +00:00
Return the environment of the memoized expression @var{m}.
@end deffn
procedure-name
2004-08-24 16:43:07 +00:00
@c snarfed from debug.c:291
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure-name proc
@deffnx {C Function} scm_procedure_name (proc)
2001-03-23 15:05:40 +00:00
Return the name of the procedure @var{proc}
@end deffn
procedure-source
2004-08-24 16:43:07 +00:00
@c snarfed from debug.c:317
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure-source proc
@deffnx {C Function} scm_procedure_source (proc)
2001-03-23 15:05:40 +00:00
Return the source of the procedure @var{proc}.
@end deffn
procedure-environment
2004-08-24 16:43:07 +00:00
@c snarfed from debug.c:374
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure-environment proc
@deffnx {C Function} scm_procedure_environment (proc)
2001-03-23 15:05:40 +00:00
Return the environment of the procedure @var{proc}.
@end deffn
local-eval
2004-08-24 16:43:07 +00:00
@c snarfed from debug.c:406
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} local-eval exp [env]
@deffnx {C Function} scm_local_eval (exp, env)
2001-03-23 15:05:40 +00:00
Evaluate @var{exp} in its environment. If @var{env} is supplied,
it is the environment in which to evaluate @var{exp}. Otherwise,
@var{exp} must be a memoized code object (in which case, its environment
is implicit).
@end deffn
debug-object?
2004-08-24 16:43:07 +00:00
@c snarfed from debug.c:493
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} debug-object? obj
@deffnx {C Function} scm_debug_object_p (obj)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{obj} is a debug object.
@end deffn
2004-08-24 16:43:07 +00:00
include-deprecated-features
@c snarfed from deprecation.c:144
@deffn {Scheme Procedure} include-deprecated-features
@deffnx {C Function} scm_include_deprecated_features ()
Return @code{#t} iff deprecated features should be included in public interfaces.
@end deffn
2001-03-23 15:05:40 +00:00
dynamic-link
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:149
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dynamic-link filename
@deffnx {C Function} scm_dynamic_link (filename)
2002-07-10 22:21:25 +00:00
Find the shared object (shared library) denoted by
@var{filename} and link it into the running Guile
application. The returned
scheme object is a ``handle'' for the library which can
be passed to @code{dynamic-func}, @code{dynamic-call} etc.
Searching for object files is system dependent. Normally,
if @var{filename} does have an explicit directory it will
be searched for in locations
such as @file{/usr/lib} and @file{/usr/local/lib}.
2001-03-23 15:05:40 +00:00
@end deffn
dynamic-object?
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:168
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dynamic-object? obj
@deffnx {C Function} scm_dynamic_object_p (obj)
2002-07-10 22:21:25 +00:00
Return @code{#t} if @var{obj} is a dynamic object handle,
or @code{#f} otherwise.
2001-03-23 15:05:40 +00:00
@end deffn
dynamic-unlink
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:182
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dynamic-unlink dobj
@deffnx {C Function} scm_dynamic_unlink (dobj)
2002-07-10 22:21:25 +00:00
Unlink a dynamic object from the application, if possible. The
object must have been linked by @code{dynamic-link}, with
@var{dobj} the corresponding handle. After this procedure
is called, the handle can no longer be used to access the
object.
2001-03-23 15:05:40 +00:00
@end deffn
dynamic-func
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:207
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dynamic-func name dobj
@deffnx {C Function} scm_dynamic_func (name, dobj)
2002-07-10 22:21:25 +00:00
Return a ``handle'' for the function @var{name} in the
shared object referred to by @var{dobj}. The handle
can be passed to @code{dynamic-call} to actually
call the function.
2001-03-23 15:05:40 +00:00
2002-07-10 22:21:25 +00:00
Regardless whether your C compiler prepends an underscore
@samp{_} to the global names in a program, you should
@strong{not} include this underscore in @var{name}
since it will be added automatically when necessary.
2001-03-23 15:05:40 +00:00
@end deffn
dynamic-call
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:253
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dynamic-call func dobj
@deffnx {C Function} scm_dynamic_call (func, dobj)
2002-07-09 22:40:03 +00:00
Call a C function in a dynamic object. Two styles of
invocation are supported:
@itemize @bullet
@item @var{func} can be a function handle returned by
@code{dynamic-func}. In this case @var{dobj} is
ignored
@item @var{func} can be a string with the name of the
function to call, with @var{dobj} the handle of the
dynamic object in which to find the function.
This is equivalent to
2001-03-23 15:05:40 +00:00
@smallexample
2002-07-09 22:40:03 +00:00
(dynamic-call (dynamic-func @var{func} @var{dobj}) #f)
2001-03-23 15:05:40 +00:00
@end smallexample
2002-07-09 22:40:03 +00:00
@end itemize
2001-03-23 15:05:40 +00:00
2002-07-09 22:40:03 +00:00
In either case, the function is passed no arguments
and its return value is ignored.
2001-03-23 15:05:40 +00:00
@end deffn
dynamic-args-call
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:285
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dynamic-args-call func dobj args
@deffnx {C Function} scm_dynamic_args_call (func, dobj, args)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Call the C function indicated by @var{func} and @var{dobj},
just like @code{dynamic-call}, but pass it some arguments and
return its return value. The C function is expected to take
two arguments and return an @code{int}, just like @code{main}:
2001-03-23 15:05:40 +00:00
@smallexample
int c_func (int argc, char **argv);
@end smallexample
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
The parameter @var{args} must be a list of strings and is
converted into an array of @code{char *}. The array is passed
in @var{argv} and its size in @var{argc}. The return value is
converted to a Scheme number and returned from the call to
@code{dynamic-args-call}.
2001-03-23 15:05:40 +00:00
@end deffn
dynamic-wind
2004-08-24 16:43:07 +00:00
@c snarfed from dynwind.c:97
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dynamic-wind in_guard thunk out_guard
@deffnx {C Function} scm_dynamic_wind (in_guard, thunk, out_guard)
2001-03-23 15:05:40 +00:00
All three arguments must be 0-argument procedures.
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@var{in_guard} is called, then @var{thunk}, then
@var{out_guard}.
* 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'.
2001-05-04 21:54:00 +00:00
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
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
the dynamic-wind is re-entered, @var{in_guard} is called. Thus
@var{in_guard} and @var{out_guard} may be called any number of
times.
@lisp
2001-03-23 15:05:40 +00:00
(define x 'normal-binding)
@result{} x
(define a-cont (call-with-current-continuation
(lambda (escape)
(let ((old-x x))
(dynamic-wind
;; in-guard:
;;
(lambda () (set! x 'special-binding))
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
;; thunk
;;
(lambda () (display x) (newline)
(call-with-current-continuation escape)
(display x) (newline)
x)
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
;; out-guard:
;;
(lambda () (set! x old-x)))))))
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
;; Prints:
special-binding
;; Evaluates to:
@result{} a-cont
x
@result{} normal-binding
(a-cont #f)
;; Prints:
special-binding
;; Evaluates to:
@result{} a-cont ;; the value of the (define a-cont...)
x
@result{} normal-binding
a-cont
@result{} special-binding
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
environment?
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:106
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment? obj
@deffnx {C Function} scm_environment_p (obj)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{obj} is an environment, or @code{#f}
otherwise.
@end deffn
environment-bound?
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:117
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-bound? env sym
@deffnx {C Function} scm_environment_bound_p (env, sym)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{sym} is bound in @var{env}, or
@code{#f} otherwise.
@end deffn
environment-ref
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:132
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-ref env sym
@deffnx {C Function} scm_environment_ref (env, sym)
2001-03-23 15:05:40 +00:00
Return the value of the location bound to @var{sym} in
@var{env}. If @var{sym} is unbound in @var{env}, signal an
@code{environment:unbound} error.
@end deffn
environment-fold
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:202
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-fold env proc init
@deffnx {C Function} scm_environment_fold (env, proc, init)
2001-03-23 15:05:40 +00:00
Iterate over all the bindings in @var{env}, accumulating some
value.
For each binding in @var{env}, apply @var{proc} to the symbol
bound, its value, and the result from the previous application
of @var{proc}.
Use @var{init} as @var{proc}'s third argument the first time
@var{proc} is applied.
If @var{env} contains no bindings, this function simply returns
@var{init}.
If @var{env} binds the symbol sym1 to the value val1, sym2 to
val2, and so on, then this procedure computes:
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-03-23 15:05:40 +00:00
(proc sym1 val1
(proc sym2 val2
...
(proc symn valn
init)))
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
Each binding in @var{env} will be processed exactly once.
@code{environment-fold} makes no guarantees about the order in
which the bindings are processed.
Here is a function which, given an environment, constructs an
association list representing that environment's bindings,
using environment-fold:
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-03-23 15:05:40 +00:00
(define (environment->alist env)
(environment-fold env
(lambda (sym val tail)
(cons (cons sym val) tail))
'()))
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
environment-define
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:237
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-define env sym val
@deffnx {C Function} scm_environment_define (env, sym, val)
2001-03-23 15:05:40 +00:00
Bind @var{sym} to a new location containing @var{val} in
@var{env}. If @var{sym} is already bound to another location
in @var{env} and the binding is mutable, that binding is
replaced. The new binding and location are both mutable. The
return value is unspecified.
If @var{sym} is already bound in @var{env}, and the binding is
immutable, signal an @code{environment:immutable-binding} error.
@end deffn
environment-undefine
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:263
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-undefine env sym
@deffnx {C Function} scm_environment_undefine (env, sym)
2001-03-23 15:05:40 +00:00
Remove any binding for @var{sym} from @var{env}. If @var{sym}
is unbound in @var{env}, do nothing. The return value is
unspecified.
If @var{sym} is already bound in @var{env}, and the binding is
immutable, signal an @code{environment:immutable-binding} error.
@end deffn
environment-set!
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:291
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-set! env sym val
@deffnx {C Function} scm_environment_set_x (env, sym, val)
2001-03-23 15:05:40 +00:00
If @var{env} binds @var{sym} to some location, change that
location's value to @var{val}. The return value is
unspecified.
If @var{sym} is not bound in @var{env}, signal an
@code{environment:unbound} error. If @var{env} binds @var{sym}
to an immutable location, signal an
@code{environment:immutable-location} error.
@end deffn
environment-cell
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:326
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-cell env sym for_write
@deffnx {C Function} scm_environment_cell (env, sym, for_write)
2001-03-23 15:05:40 +00:00
Return the value cell which @var{env} binds to @var{sym}, or
@code{#f} if the binding does not live in a value cell.
The argument @var{for-write} indicates whether the caller
intends to modify the variable's value by mutating the value
cell. If the variable is immutable, then
@code{environment-cell} signals an
@code{environment:immutable-location} error.
If @var{sym} is unbound in @var{env}, signal an
@code{environment:unbound} error.
If you use this function, you should consider using
@code{environment-observe}, to be notified when @var{sym} gets
re-bound to a new value cell, or becomes undefined.
@end deffn
environment-observe
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:378
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-observe env proc
@deffnx {C Function} scm_environment_observe (env, proc)
2001-03-23 15:05:40 +00:00
Whenever @var{env}'s bindings change, apply @var{proc} to
@var{env}.
This function returns an object, token, which you can pass to
@code{environment-unobserve} to remove @var{proc} from the set
of procedures observing @var{env}. The type and value of
token is unspecified.
@end deffn
environment-observe-weak
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:395
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-observe-weak env proc
@deffnx {C Function} scm_environment_observe_weak (env, proc)
2001-03-23 15:05:40 +00:00
This function is the same as environment-observe, except that
the reference @var{env} retains to @var{proc} is a weak
reference. This means that, if there are no other live,
non-weak references to @var{proc}, it will be
garbage-collected, and dropped from @var{env}'s
list of observing procedures.
@end deffn
environment-unobserve
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:431
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environment-unobserve token
@deffnx {C Function} scm_environment_unobserve (token)
2001-03-23 15:05:40 +00:00
Cancel the observation request which returned the value
@var{token}. The return value is unspecified.
If a call @code{(environment-observe env proc)} returns
@var{token}, then the call @code{(environment-unobserve token)}
will cause @var{proc} to no longer be called when @var{env}'s
bindings change.
@end deffn
make-leaf-environment
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1015
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-leaf-environment
@deffnx {C Function} scm_make_leaf_environment ()
2001-03-23 15:05:40 +00:00
Create a new leaf environment, containing no bindings.
All bindings and locations created in the new environment
will be mutable.
@end deffn
leaf-environment?
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1038
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} leaf-environment? object
@deffnx {C Function} scm_leaf_environment_p (object)
2001-03-23 15:05:40 +00:00
Return @code{#t} if object is a leaf environment, or @code{#f}
otherwise.
@end deffn
make-eval-environment
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1403
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-eval-environment local imported
@deffnx {C Function} scm_make_eval_environment (local, imported)
2001-03-23 15:05:40 +00:00
Return a new environment object eval whose bindings are the
union of the bindings in the environments @var{local} and
@var{imported}, with bindings from @var{local} taking
precedence. Definitions made in eval are placed in @var{local}.
Applying @code{environment-define} or
@code{environment-undefine} to eval has the same effect as
applying the procedure to @var{local}.
Note that eval incorporates @var{local} and @var{imported} by
reference:
If, after creating eval, the program changes the bindings of
@var{local} or @var{imported}, those changes will be visible
in eval.
Since most Scheme evaluation takes place in eval environments,
they transparently cache the bindings received from @var{local}
and @var{imported}. Thus, the first time the program looks up
a symbol in eval, eval may make calls to @var{local} or
@var{imported} to find their bindings, but subsequent
references to that symbol will be as fast as references to
bindings in finite environments.
In typical use, @var{local} will be a finite environment, and
@var{imported} will be an import environment
@end deffn
eval-environment?
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1440
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eval-environment? object
@deffnx {C Function} scm_eval_environment_p (object)
2001-03-23 15:05:40 +00:00
Return @code{#t} if object is an eval environment, or @code{#f}
otherwise.
@end deffn
eval-environment-local
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1450
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eval-environment-local env
@deffnx {C Function} scm_eval_environment_local (env)
2001-03-23 15:05:40 +00:00
Return the local environment of eval environment @var{env}.
@end deffn
eval-environment-set-local!
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1462
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eval-environment-set-local! env local
@deffnx {C Function} scm_eval_environment_set_local_x (env, local)
2001-03-23 15:05:40 +00:00
Change @var{env}'s local environment to @var{local}.
@end deffn
eval-environment-imported
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1488
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eval-environment-imported env
@deffnx {C Function} scm_eval_environment_imported (env)
2001-03-23 15:05:40 +00:00
Return the imported environment of eval environment @var{env}.
@end deffn
eval-environment-set-imported!
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1500
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eval-environment-set-imported! env imported
@deffnx {C Function} scm_eval_environment_set_imported_x (env, imported)
2001-03-23 15:05:40 +00:00
Change @var{env}'s imported environment to @var{imported}.
@end deffn
make-import-environment
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1823
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-import-environment imports conflict_proc
@deffnx {C Function} scm_make_import_environment (imports, conflict_proc)
2001-03-23 15:05:40 +00:00
Return a new environment @var{imp} whose bindings are the union
of the bindings from the environments in @var{imports};
@var{imports} must be a list of environments. That is,
@var{imp} binds a symbol to a location when some element of
@var{imports} does.
If two different elements of @var{imports} have a binding for
the same symbol, the @var{conflict-proc} is called with the
following parameters: the import environment, the symbol and
the list of the imported environments that bind the symbol.
If the @var{conflict-proc} returns an environment @var{env},
the conflict is considered as resolved and the binding from
@var{env} is used. If the @var{conflict-proc} returns some
non-environment object, the conflict is considered unresolved
and the symbol is treated as unspecified in the import
environment.
The checking for conflicts may be performed lazily, i. e. at
the moment when a value or binding for a certain symbol is
requested instead of the moment when the environment is
created or the bindings of the imports change.
All bindings in @var{imp} are immutable. If you apply
@code{environment-define} or @code{environment-undefine} to
@var{imp}, Guile will signal an
@code{environment:immutable-binding} error. However,
notice that the set of bindings in @var{imp} may still change,
if one of its imported environments changes.
@end deffn
import-environment?
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1852
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} import-environment? object
@deffnx {C Function} scm_import_environment_p (object)
2001-03-23 15:05:40 +00:00
Return @code{#t} if object is an import environment, or
@code{#f} otherwise.
@end deffn
import-environment-imports
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1863
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} import-environment-imports env
@deffnx {C Function} scm_import_environment_imports (env)
2001-03-23 15:05:40 +00:00
Return the list of environments imported by the import
environment @var{env}.
@end deffn
import-environment-set-imports!
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:1876
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} import-environment-set-imports! env imports
@deffnx {C Function} scm_import_environment_set_imports_x (env, imports)
2001-03-23 15:05:40 +00:00
Change @var{env}'s list of imported environments to
@var{imports}, and check for conflicts.
@end deffn
make-export-environment
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:2143
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-export-environment private signature
@deffnx {C Function} scm_make_export_environment (private, signature)
2001-03-23 15:05:40 +00:00
Return a new environment @var{exp} containing only those
bindings in private whose symbols are present in
@var{signature}. The @var{private} argument must be an
environment.
The environment @var{exp} binds symbol to location when
@var{env} does, and symbol is exported by @var{signature}.
@var{signature} is a list specifying which of the bindings in
@var{private} should be visible in @var{exp}. Each element of
@var{signature} should be a list of the form:
(symbol attribute ...)
where each attribute is one of the following:
@table @asis
@item the symbol @code{mutable-location}
@var{exp} should treat the
location bound to symbol as mutable. That is, @var{exp}
will pass calls to @code{environment-set!} or
@code{environment-cell} directly through to private.
@item the symbol @code{immutable-location}
@var{exp} should treat
the location bound to symbol as immutable. If the program
applies @code{environment-set!} to @var{exp} and symbol, or
calls @code{environment-cell} to obtain a writable value
cell, @code{environment-set!} will signal an
@code{environment:immutable-location} error. Note that, even
if an export environment treats a location as immutable, the
underlying environment may treat it as mutable, so its
value may change.
@end table
It is an error for an element of signature to specify both
@code{mutable-location} and @code{immutable-location}. If
neither is specified, @code{immutable-location} is assumed.
As a special case, if an element of signature is a lone
symbol @var{sym}, it is equivalent to an element of the form
@code{(sym)}.
All bindings in @var{exp} are immutable. If you apply
@code{environment-define} or @code{environment-undefine} to
@var{exp}, Guile will signal an
@code{environment:immutable-binding} error. However,
notice that the set of bindings in @var{exp} may still change,
if the bindings in private change.
@end deffn
export-environment?
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:2178
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} export-environment? object
@deffnx {C Function} scm_export_environment_p (object)
2001-03-23 15:05:40 +00:00
Return @code{#t} if object is an export environment, or
@code{#f} otherwise.
@end deffn
export-environment-private
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:2188
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} export-environment-private env
@deffnx {C Function} scm_export_environment_private (env)
2001-03-23 15:05:40 +00:00
Return the private environment of export environment @var{env}.
@end deffn
export-environment-set-private!
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:2200
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} export-environment-set-private! env private
@deffnx {C Function} scm_export_environment_set_private_x (env, private)
2001-03-23 15:05:40 +00:00
Change the private environment of export environment @var{env}.
@end deffn
export-environment-signature
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:2222
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} export-environment-signature env
@deffnx {C Function} scm_export_environment_signature (env)
2001-03-23 15:05:40 +00:00
Return the signature of export environment @var{env}.
@end deffn
export-environment-set-signature!
2004-08-24 16:43:07 +00:00
@c snarfed from environments.c:2296
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} export-environment-set-signature! env signature
@deffnx {C Function} scm_export_environment_set_signature_x (env, signature)
2001-03-23 15:05:40 +00:00
Change the signature of export environment @var{env}.
@end deffn
eq?
2004-08-24 16:43:07 +00:00
@c snarfed from eq.c:47
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eq? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} references the same object as @var{y}.
@code{eq?} is similar to @code{eqv?} except that in some cases it is
capable of discerning distinctions finer than those detectable by
@code{eqv?}.
@end deffn
eqv?
2004-08-24 16:43:07 +00:00
@c snarfed from eq.c:71
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eqv? x y
2001-03-23 15:05:40 +00:00
The @code{eqv?} procedure defines a useful equivalence relation on objects.
Briefly, it returns @code{#t} if @var{x} and @var{y} should normally be
regarded as the same object. This relation is left slightly open to
interpretation, but works for comparing immediate integers, characters,
and inexact numbers.
@end deffn
equal?
2004-08-24 16:43:07 +00:00
@c snarfed from eq.c:138
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} equal? x y
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} and @var{y} are recursively @code{eqv?} equivalent.
@code{equal?} recursively compares the contents of pairs,
vectors, and strings, applying @code{eqv?} on other objects such as
numbers and symbols. A rule of thumb is that objects are generally
@code{equal?} if they print the same. @code{equal?} may fail to
terminate if its arguments are circular data structures.
@end deffn
scm-error
2004-08-24 16:43:07 +00:00
@c snarfed from error.c:81
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} scm-error key subr message args data
@deffnx {C Function} scm_error_scm (key, subr, message, args, data)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Raise an error with key @var{key}. @var{subr} can be a string
naming the procedure associated with the error, or @code{#f}.
@var{message} is the error message string, possibly containing
@code{~S} and @code{~A} escapes. When an error is reported,
these are replaced by formatting the corresponding members of
@var{args}: @code{~A} (was @code{%s} in older versions of
Guile) formats using @code{display} and @code{~S} (was
@code{%S}) formats using @code{write}. @var{data} is a list or
@code{#f} depending on @var{key}: if @var{key} is
@code{system-error} then it should be a list containing the
Unix @code{errno} value; If @var{key} is @code{signal} then it
should be a list containing the Unix signal number; otherwise
it will usually be @code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
strerror
2004-08-24 16:43:07 +00:00
@c snarfed from error.c:128
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} strerror err
@deffnx {C Function} scm_strerror (err)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return the Unix error message corresponding to @var{err}, which
must be an integer value.
2001-03-23 15:05:40 +00:00
@end deffn
apply:nconc2last
2004-08-24 16:43:07 +00:00
@c snarfed from eval.c:4697
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} apply:nconc2last lst
@deffnx {C Function} scm_nconc2last (lst)
2001-03-23 15:05:40 +00:00
Given a list (@var{arg1} @dots{} @var{args}), this function
conses the @var{arg1} @dots{} arguments onto the front of
@var{args}, and returns the resulting list. Note that
@var{args} is a list; thus, the argument to this function is
a list whose last element is a list.
Note: Rather than do new consing, @code{apply:nconc2last}
destroys its argument, so use with care.
@end deffn
force
2004-08-24 16:43:07 +00:00
@c snarfed from eval.c:5625
@deffn {Scheme Procedure} force promise
@deffnx {C Function} scm_force (promise)
2001-03-23 15:05:40 +00:00
If the promise @var{x} has not been computed yet, compute and
return @var{x}, otherwise just return the previously computed
value.
@end deffn
promise?
2004-08-24 16:43:07 +00:00
@c snarfed from eval.c:5648
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} promise? obj
@deffnx {C Function} scm_promise_p (obj)
2001-03-23 15:05:40 +00:00
Return true if @var{obj} is a promise, i.e. a delayed computation
2001-11-11 15:01:52 +00:00
(@pxref{Delayed evaluation,,,r5rs.info,The Revised^5 Report on Scheme}).
2001-03-23 15:05:40 +00:00
@end deffn
cons-source
2004-08-24 16:43:07 +00:00
@c snarfed from eval.c:5660
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} cons-source xorig x y
@deffnx {C Function} scm_cons_source (xorig, x, y)
2001-03-23 15:05:40 +00:00
Create and return a new pair whose car and cdr are @var{x} and @var{y}.
Any source properties associated with @var{xorig} are also associated
with the new pair.
@end deffn
copy-tree
2004-08-24 16:43:07 +00:00
@c snarfed from eval.c:5817
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} copy-tree obj
@deffnx {C Function} scm_copy_tree (obj)
2001-03-23 15:05:40 +00:00
Recursively copy the data tree that is bound to @var{obj}, and return a
2004-08-24 16:43:07 +00:00
the new data structure. @code{copy-tree} recurses down the
2001-03-23 15:05:40 +00:00
contents of both pairs and vectors (since both cons cells and vector
cells may point to arbitrary objects), and stops recursing when it hits
any other object.
@end deffn
primitive-eval
2004-08-24 16:43:07 +00:00
@c snarfed from eval.c:5903
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-eval exp
@deffnx {C Function} scm_primitive_eval (exp)
2001-03-23 15:05:40 +00:00
Evaluate @var{exp} in the top-level environment specified by
the current module.
@end deffn
eval
2004-08-24 16:43:07 +00:00
@c snarfed from eval.c:5972
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eval exp module
@deffnx {C Function} scm_eval (exp, module)
2001-03-23 15:05:40 +00:00
Evaluate @var{exp}, a list representing a Scheme expression,
in the top-level environment specified by @var{module}.
2001-11-16 15:04:17 +00:00
While @var{exp} is evaluated (using @code{primitive-eval}),
2001-03-23 15:05:40 +00:00
@var{module} is made the current module. The current module
is reset to its previous value when @var{eval} returns.
@end deffn
eval-options-interface
2004-08-24 16:43:07 +00:00
@c snarfed from eval.c:3087
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eval-options-interface [setting]
@deffnx {C Function} scm_eval_options_interface (setting)
2001-03-23 15:05:40 +00:00
Option interface for the evaluation options. Instead of using
this procedure directly, use the procedures @code{eval-enable},
2002-03-15 14:03:53 +00:00
@code{eval-disable}, @code{eval-set!} and @code{eval-options}.
2001-03-23 15:05:40 +00:00
@end deffn
evaluator-traps-interface
2004-08-24 16:43:07 +00:00
@c snarfed from eval.c:3105
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} evaluator-traps-interface [setting]
@deffnx {C Function} scm_evaluator_traps (setting)
2001-03-23 15:05:40 +00:00
Option interface for the evaluator trap options.
@end deffn
defined?
2004-08-24 16:43:07 +00:00
@c snarfed from evalext.c:34
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} defined? sym [env]
2002-10-19 16:33:25 +00:00
@deffnx {C Function} scm_defined_p (sym, env)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{sym} is defined in the lexical environment @var{env}. When @var{env} is not specified, look in the top-level environment as defined by the current module.
2001-03-23 15:05:40 +00:00
@end deffn
map-in-order
2004-08-24 16:43:07 +00:00
@c snarfed from evalext.c:80
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} map-in-order
2001-11-11 15:01:52 +00:00
implemented by the C function "scm_map"
@end deffn
2004-08-24 16:43:07 +00:00
self-evaluating?
@c snarfed from evalext.c:85
@deffn {Scheme Procedure} self-evaluating? obj
@deffnx {C Function} scm_self_evaluating_p (obj)
Return #t for objects which Guile considers self-evaluating
@end deffn
2001-11-11 15:01:52 +00:00
load-extension
2004-08-24 16:43:07 +00:00
@c snarfed from extensions.c:143
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} load-extension lib init
@deffnx {C Function} scm_load_extension (lib, init)
2001-11-13 23:44:29 +00:00
Load and initialize the extension designated by LIB and INIT.
2001-11-11 15:01:52 +00:00
When there is no pre-registered function for LIB/INIT, this is
equivalent to
@lisp
(dynamic-call INIT (dynamic-link LIB))
@end lisp
When there is a pre-registered function, that function is called
instead.
Normally, there is no pre-registered function. This option exists
only for situations where dynamic linking is unavailable or unwanted.
In that case, you would statically link your program with the desired
library, and register its init function right after Guile has been
initialized.
LIB should be a string denoting a shared library without any file type
suffix such as ".so". The suffix is provided automatically. It
should also not contain any directory components. Libraries that
implement Guile Extensions should be put into the normal locations for
shared libraries. We recommend to use the naming convention
libguile-bla-blum for a extension related to a module `(bla blum)'.
The normal way for a extension to be used is to write a small Scheme
file that defines a module, and to load the extension into this
module. When the module is auto-loaded, the extension is loaded as
well. For example,
@lisp
(define-module (bla blum))
(load-extension "libguile-bla-blum" "bla_init_blum")
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
program-arguments
2004-08-24 16:43:07 +00:00
@c snarfed from feature.c:56
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} program-arguments
@deffnx {Scheme Procedure} command-line
@deffnx {C Function} scm_program_arguments ()
2001-03-23 15:05:40 +00:00
Return the list of command line arguments passed to Guile, as a list of
strings. The list includes the invoked program name, which is usually
@code{"guile"}, but excludes switches and parameters for command line
options like @code{-e} and @code{-l}.
@end deffn
2001-11-11 15:01:52 +00:00
make-fluid
2004-08-24 16:43:07 +00:00
@c snarfed from fluids.c:100
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-fluid
@deffnx {C Function} scm_make_fluid ()
2001-11-11 15:01:52 +00:00
Return a newly created fluid.
Fluids are objects of a certain type (a smob) that can hold one SCM
value per dynamic root. That is, modifications to this value are
only visible to code that executes within the same dynamic root as
the modifying code. When a new dynamic root is constructed, it
inherits the values from its parent. Because each thread executes
in its own dynamic root, you can use fluids for thread local storage.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
fluid?
2004-08-24 16:43:07 +00:00
@c snarfed from fluids.c:113
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} fluid? obj
@deffnx {C Function} scm_fluid_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} iff @var{obj} is a fluid; otherwise, return
@code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
fluid-ref
2004-08-24 16:43:07 +00:00
@c snarfed from fluids.c:124
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} fluid-ref fluid
@deffnx {C Function} scm_fluid_ref (fluid)
2001-11-11 15:01:52 +00:00
Return the value associated with @var{fluid} in the current
dynamic root. If @var{fluid} has not been set, then return
@code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
fluid-set!
2004-08-24 16:43:07 +00:00
@c snarfed from fluids.c:140
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} fluid-set! fluid value
@deffnx {C Function} scm_fluid_set_x (fluid, value)
2001-11-11 15:01:52 +00:00
Set the value associated with @var{fluid} in the current dynamic root.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
with-fluids*
2004-08-24 16:43:07 +00:00
@c snarfed from fluids.c:206
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} with-fluids* fluids values thunk
@deffnx {C Function} scm_with_fluids (fluids, values, thunk)
2001-11-11 15:01:52 +00:00
Set @var{fluids} to @var{values} temporary, and call @var{thunk}.
@var{fluids} must be a list of fluids and @var{values} must be the same
number of their values to be applied. Each substitution is done
one after another. @var{thunk} must be a procedure with no argument.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
with-fluid*
@c snarfed from fluids.c:245
@deffn {Scheme Procedure} with-fluid* fluid value thunk
@deffnx {C Function} scm_with_fluid (fluid, value, thunk)
Set @var{fluid} to @var{value} temporarily, and call @var{thunk}.
@var{thunk} must be a procedure with no argument.
@end deffn
2001-11-11 15:01:52 +00:00
setvbuf
2004-08-24 16:43:07 +00:00
@c snarfed from fports.c:137
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setvbuf port mode [size]
@deffnx {C Function} scm_setvbuf (port, mode, size)
2001-11-11 15:01:52 +00:00
Set the buffering mode for @var{port}. @var{mode} can be:
@table @code
@item _IONBF
non-buffered
@item _IOLBF
line buffered
@item _IOFBF
block buffered, using a newly allocated buffer of @var{size} bytes.
If @var{size} is omitted, a default size will be used.
@end table
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
file-port?
2004-08-24 16:43:07 +00:00
@c snarfed from fports.c:230
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} file-port? obj
@deffnx {C Function} scm_file_port_p (obj)
2001-11-11 15:01:52 +00:00
Determine whether @var{obj} is a port that is related to a file.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
open-file
2004-08-24 16:43:07 +00:00
@c snarfed from fports.c:284
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} open-file filename mode
@deffnx {C Function} scm_open_file (filename, mode)
2001-11-11 15:01:52 +00:00
Open the file whose name is @var{filename}, and return a port
representing that file. The attributes of the port are
determined by the @var{mode} string. The way in which this is
interpreted is similar to C stdio. The first character must be
one of the following:
@table @samp
@item r
Open an existing file for input.
@item w
Open a file for output, creating it if it doesn't already exist
or removing its contents if it does.
@item a
Open a file for output, creating it if it doesn't already
exist. All writes to the port will go to the end of the file.
The "append mode" can be turned off while the port is in use
@pxref{Ports and File Descriptors, fcntl}
2001-03-23 15:05:40 +00:00
@end table
2001-11-11 15:01:52 +00:00
The following additional characters can be appended:
@table @samp
@item +
Open the port for both input and output. E.g., @code{r+}: open
an existing file for both input and output.
@item 0
Create an "unbuffered" port. In this case input and output
operations are passed directly to the underlying port
implementation without additional buffering. This is likely to
slow down I/O operations. The buffering mode can be changed
while a port is in use @pxref{Ports and File Descriptors,
setvbuf}
@item l
Add line-buffering to the port. The port output buffer will be
automatically flushed whenever a newline character is written.
2001-03-23 15:05:40 +00:00
@end table
2001-11-11 15:01:52 +00:00
In theory we could create read/write ports which were buffered
in one direction only. However this isn't included in the
current interfaces. If a file cannot be opened with the access
requested, @code{open-file} throws an exception.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
make-future
@c snarfed from futures.c:89
@deffn {Scheme Procedure} make-future thunk
@deffnx {C Function} scm_make_future (thunk)
Make a future evaluating THUNK.
@end deffn
2002-08-10 14:09:55 +00:00
2004-08-24 16:43:07 +00:00
future-ref
@c snarfed from futures.c:221
@deffn {Scheme Procedure} future-ref future
@deffnx {C Function} scm_future_ref (future)
If the future @var{x} has not been computed yet, compute and
return @var{x}, otherwise just return the previously computed
value.
2002-08-10 14:09:55 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
gc-stats
2004-08-24 16:43:07 +00:00
@c snarfed from gc.c:283
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} gc-stats
@deffnx {C Function} scm_gc_stats ()
2001-11-11 15:01:52 +00:00
Return an association list of statistics about Guile's current
use of storage.
2002-08-10 14:09:55 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
object-address
2004-08-24 16:43:07 +00:00
@c snarfed from gc.c:419
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} object-address obj
@deffnx {C Function} scm_object_address (obj)
2001-11-11 15:01:52 +00:00
Return an integer that for the lifetime of @var{obj} is uniquely
returned by this function for @var{obj}
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
gc
2004-08-24 16:43:07 +00:00
@c snarfed from gc.c:430
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} gc
@deffnx {C Function} scm_gc ()
2001-11-11 15:01:52 +00:00
Scans all of SCM objects and reclaims for further use those that are
no longer accessible.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
%compute-slots
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:265
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %compute-slots class
@deffnx {C Function} scm_sys_compute_slots (class)
2001-11-11 15:01:52 +00:00
Return a list consisting of the names of all slots belonging to
class @var{class}, i. e. the slots of @var{class} and of all of
its superclasses.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
get-keyword
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:356
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} get-keyword key l default_value
@deffnx {C Function} scm_get_keyword (key, l, default_value)
2001-11-11 15:01:52 +00:00
Determine an associated value for the keyword @var{key} from
the list @var{l}. The list @var{l} has to consist of an even
number of elements, where, starting with the first, every
second element is a keyword, followed by its associated value.
If @var{l} does not hold a value for @var{key}, the value
@var{default_value} is returned.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
%initialize-object
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:379
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %initialize-object obj initargs
@deffnx {C Function} scm_sys_initialize_object (obj, initargs)
2001-11-11 15:01:52 +00:00
Initialize the object @var{obj} with the given arguments
@var{initargs}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
%prep-layout!
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:477
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %prep-layout! class
@deffnx {C Function} scm_sys_prep_layout_x (class)
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
%inherit-magic!
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:576
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %inherit-magic! class dsupers
@deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers)
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
instance?
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:816
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} instance? obj
@deffnx {C Function} scm_instance_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is an instance.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
class-name
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:831
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} class-name obj
@deffnx {C Function} scm_class_name (obj)
2001-11-11 15:01:52 +00:00
Return the class name of @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
class-direct-supers
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:841
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} class-direct-supers obj
@deffnx {C Function} scm_class_direct_supers (obj)
2001-11-11 15:01:52 +00:00
Return the direct superclasses of the class @var{obj}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
class-direct-slots
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:851
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} class-direct-slots obj
@deffnx {C Function} scm_class_direct_slots (obj)
2001-11-11 15:01:52 +00:00
Return the direct slots of the class @var{obj}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
class-direct-subclasses
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:861
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} class-direct-subclasses obj
@deffnx {C Function} scm_class_direct_subclasses (obj)
2001-11-11 15:01:52 +00:00
Return the direct subclasses of the class @var{obj}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
class-direct-methods
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:871
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} class-direct-methods obj
@deffnx {C Function} scm_class_direct_methods (obj)
2001-11-11 15:01:52 +00:00
Return the direct methods of the class @var{obj}
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
class-precedence-list
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:881
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} class-precedence-list obj
@deffnx {C Function} scm_class_precedence_list (obj)
2001-11-11 15:01:52 +00:00
Return the class precedence list of the class @var{obj}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
class-slots
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:891
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} class-slots obj
@deffnx {C Function} scm_class_slots (obj)
2001-11-11 15:01:52 +00:00
Return the slot list of the class @var{obj}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
class-environment
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:901
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} class-environment obj
@deffnx {C Function} scm_class_environment (obj)
2001-11-11 15:01:52 +00:00
Return the environment of the class @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
generic-function-name
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:912
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} generic-function-name obj
@deffnx {C Function} scm_generic_function_name (obj)
2001-11-11 15:01:52 +00:00
Return the name of the generic function @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
generic-function-methods
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:957
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} generic-function-methods obj
@deffnx {C Function} scm_generic_function_methods (obj)
2001-11-11 15:01:52 +00:00
Return the methods of the generic function @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
method-generic-function
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:970
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} method-generic-function obj
@deffnx {C Function} scm_method_generic_function (obj)
2002-03-15 14:03:53 +00:00
Return the generic function for the method @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
method-specializers
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:980
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} method-specializers obj
@deffnx {C Function} scm_method_specializers (obj)
2001-11-11 15:01:52 +00:00
Return specializers of the method @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
method-procedure
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:990
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} method-procedure obj
@deffnx {C Function} scm_method_procedure (obj)
2001-11-11 15:01:52 +00:00
Return the procedure of the method @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
accessor-method-slot-definition
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1000
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} accessor-method-slot-definition obj
@deffnx {C Function} scm_accessor_method_slot_definition (obj)
2001-11-11 15:01:52 +00:00
Return the slot definition of the accessor @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
%tag-body
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1010
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %tag-body body
@deffnx {C Function} scm_sys_tag_body (body)
2001-11-11 15:01:52 +00:00
Internal GOOPS magic---don't use this function!
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
make-unbound
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1025
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-unbound
@deffnx {C Function} scm_make_unbound ()
2001-11-11 15:01:52 +00:00
Return the unbound value.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
unbound?
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1034
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} unbound? obj
@deffnx {C Function} scm_unbound_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is unbound.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
assert-bound
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1044
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} assert-bound value obj
@deffnx {C Function} scm_assert_bound (value, obj)
2001-11-11 15:01:52 +00:00
Return @var{value} if it is bound, and invoke the
@var{slot-unbound} method of @var{obj} if it is not.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
@@assert-bound-ref
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1056
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} @@assert-bound-ref obj index
@deffnx {C Function} scm_at_assert_bound_ref (obj, index)
2001-11-11 15:01:52 +00:00
Like @code{assert-bound}, but use @var{index} for accessing
the value from @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
%fast-slot-ref
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1068
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %fast-slot-ref obj index
@deffnx {C Function} scm_sys_fast_slot_ref (obj, index)
2001-11-11 15:01:52 +00:00
Return the slot value with index @var{index} from @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
%fast-slot-set!
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1082
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %fast-slot-set! obj index value
@deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value)
2001-03-23 15:05:40 +00:00
Set the slot with index @var{index} in @var{obj} to
@var{value}.
@end deffn
slot-ref-using-class
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1219
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} slot-ref-using-class class obj slot_name
@deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
slot-set-using-class!
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1238
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value
@deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
slot-bound-using-class?
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1252
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name
@deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
slot-exists-using-class?
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1267
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name
@deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
slot-ref
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1283
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} slot-ref obj slot_name
@deffnx {C Function} scm_slot_ref (obj, slot_name)
2001-03-23 15:05:40 +00:00
Return the value from @var{obj}'s slot with the name
@var{slot_name}.
@end deffn
slot-set!
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1300
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} slot-set! obj slot_name value
@deffnx {C Function} scm_slot_set_x (obj, slot_name, value)
2001-03-23 15:05:40 +00:00
Set the slot named @var{slot_name} of @var{obj} to @var{value}.
@end deffn
slot-bound?
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1317
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} slot-bound? obj slot_name
@deffnx {C Function} scm_slot_bound_p (obj, slot_name)
2001-03-23 15:05:40 +00:00
Return @code{#t} if the slot named @var{slot_name} of @var{obj}
is bound.
@end deffn
slot-exists?
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1335
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} slot-exists? obj slot_name
2002-07-10 22:21:25 +00:00
@deffnx {C Function} scm_slot_exists_p (obj, slot_name)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{obj} has a slot named @var{slot_name}.
@end deffn
%allocate-instance
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1374
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %allocate-instance class initargs
@deffnx {C Function} scm_sys_allocate_instance (class, initargs)
2001-03-23 15:05:40 +00:00
Create a new instance of class @var{class} and initialize it
from the arguments @var{initargs}.
@end deffn
%set-object-setter!
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1444
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %set-object-setter! obj setter
@deffnx {C Function} scm_sys_set_object_setter_x (obj, setter)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
%modify-instance
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1469
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %modify-instance old new
@deffnx {C Function} scm_sys_modify_instance (old, new)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
%modify-class
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1495
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %modify-class old new
@deffnx {C Function} scm_sys_modify_class (old, new)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
%invalidate-class
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1519
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %invalidate-class class
@deffnx {C Function} scm_sys_invalidate_class (class)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
%invalidate-method-cache!
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1641
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %invalidate-method-cache! gf
@deffnx {C Function} scm_sys_invalidate_method_cache_x (gf)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
generic-capability?
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1667
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} generic-capability? proc
@deffnx {C Function} scm_generic_capability_p (proc)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
enable-primitive-generic!
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1680
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} enable-primitive-generic! . subrs
@deffnx {C Function} scm_enable_primitive_generic_x (subrs)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
primitive-generic-generic
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:1701
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-generic-generic subr
@deffnx {C Function} scm_primitive_generic_generic (subr)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
make
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:2069
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make . args
@deffnx {C Function} scm_make (args)
2001-03-23 15:05:40 +00:00
Make a new object. @var{args} must contain the class and
all necessary initialization information.
@end deffn
find-method
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:2158
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} find-method . l
@deffnx {C Function} scm_find_method (l)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
%method-more-specific?
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:2178
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %method-more-specific? m1 m2 targs
@deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs)
2001-11-11 15:01:52 +00:00
2001-03-23 15:05:40 +00:00
@end deffn
%goops-loaded
2004-08-24 16:43:07 +00:00
@c snarfed from goops.c:2793
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %goops-loaded
@deffnx {C Function} scm_sys_goops_loaded ()
2001-03-23 15:05:40 +00:00
Announce that GOOPS is loaded and perform initialization
on the C level which depends on the loaded GOOPS modules.
@end deffn
make-guardian
2004-08-24 16:43:07 +00:00
@c snarfed from guardians.c:306
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-guardian [greedy_p]
@deffnx {C Function} scm_make_guardian (greedy_p)
2001-03-23 15:05:40 +00:00
Create a new guardian.
A guardian protects a set of objects from garbage collection,
allowing a program to apply cleanup or other actions.
@code{make-guardian} returns a procedure representing the guardian.
Calling the guardian procedure with an argument adds the
argument to the guardian's set of protected objects.
Calling the guardian procedure without an argument returns
one of the protected objects which are ready for garbage
collection, or @code{#f} if no such object is available.
Objects which are returned in this way are removed from
the guardian.
@code{make-guardian} takes one optional argument that says whether the
new guardian should be greedy or sharing. If there is any chance
that any object protected by the guardian may be resurrected,
then you should make the guardian greedy (this is the default).
See R. Kent Dybvig, Carl Bruggeman, and David Eby (1993)
"Guardians in a Generation-Based Garbage Collector".
ACM SIGPLAN Conference on Programming Language Design
and Implementation, June 1993.
(the semantics are slightly different at this point, but the
paper still (mostly) accurately describes the interface).
@end deffn
guardian-destroyed?
2004-08-24 16:43:07 +00:00
@c snarfed from guardians.c:334
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} guardian-destroyed? guardian
@deffnx {C Function} scm_guardian_destroyed_p (guardian)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}.
@end deffn
guardian-greedy?
2004-08-24 16:43:07 +00:00
@c snarfed from guardians.c:352
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} guardian-greedy? guardian
@deffnx {C Function} scm_guardian_greedy_p (guardian)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.
@end deffn
destroy-guardian!
2004-08-24 16:43:07 +00:00
@c snarfed from guardians.c:363
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} destroy-guardian! guardian
@deffnx {C Function} scm_destroy_guardian_x (guardian)
2001-03-23 15:05:40 +00:00
Destroys @var{guardian}, by making it impossible to put any more
objects in it or get any objects from it. It also unguards any
objects guarded by @var{guardian}.
@end deffn
hashq
2004-08-24 16:43:07 +00:00
@c snarfed from hash.c:176
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashq key size
@deffnx {C Function} scm_hashq (key, size)
2001-03-23 15:05:40 +00:00
Determine a hash value for @var{key} that is suitable for
lookups in a hashtable of size @var{size}, where @code{eq?} is
used as the equality predicate. The function returns an
integer in the range 0 to @var{size} - 1. Note that
@code{hashq} may use internal addresses. Thus two calls to
hashq where the keys are @code{eq?} are not guaranteed to
deliver the same value if the key object gets garbage collected
in between. This can happen, for example with symbols:
@code{(hashq 'foo n) (gc) (hashq 'foo n)} may produce two
different values, since @code{foo} will be garbage collected.
@end deffn
hashv
2004-08-24 16:43:07 +00:00
@c snarfed from hash.c:212
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashv key size
@deffnx {C Function} scm_hashv (key, size)
2001-03-23 15:05:40 +00:00
Determine a hash value for @var{key} that is suitable for
lookups in a hashtable of size @var{size}, where @code{eqv?} is
used as the equality predicate. The function returns an
integer in the range 0 to @var{size} - 1. Note that
@code{(hashv key)} may use internal addresses. Thus two calls
to hashv where the keys are @code{eqv?} are not guaranteed to
deliver the same value if the key object gets garbage collected
in between. This can happen, for example with symbols:
@code{(hashv 'foo n) (gc) (hashv 'foo n)} may produce two
different values, since @code{foo} will be garbage collected.
@end deffn
hash
2004-08-24 16:43:07 +00:00
@c snarfed from hash.c:235
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hash key size
@deffnx {C Function} scm_hash (key, size)
2001-03-23 15:05:40 +00:00
Determine a hash value for @var{key} that is suitable for
lookups in a hashtable of size @var{size}, where @code{equal?}
is used as the equality predicate. The function returns an
integer in the range 0 to @var{size} - 1.
@end deffn
2004-08-24 16:43:07 +00:00
make-hash-table
@c snarfed from hashtab.c:309
@deffn {Scheme Procedure} make-hash-table [n]
@deffnx {C Function} scm_make_hash_table (n)
Make a hash table with optional minimum number of buckets @var{n}
@end deffn
make-weak-key-hash-table
@c snarfed from hashtab.c:328
@deffn {Scheme Procedure} make-weak-key-hash-table [n]
@deffnx {Scheme Procedure} make-weak-value-hash-table size
@deffnx {Scheme Procedure} make-doubly-weak-hash-table size
@deffnx {C Function} scm_make_weak_key_hash_table (n)
Return a weak hash table with @var{size} buckets. As with any
hash table, choosing a good size for the table requires some
caution.
You can modify weak hash tables in exactly the same way you
would modify regular hash tables. (@pxref{Hash Tables})
@end deffn
make-weak-value-hash-table
@c snarfed from hashtab.c:343
@deffn {Scheme Procedure} make-weak-value-hash-table [n]
@deffnx {C Function} scm_make_weak_value_hash_table (n)
Return a hash table with weak values with @var{size} buckets.
(@pxref{Hash Tables})
@end deffn
make-doubly-weak-hash-table
@c snarfed from hashtab.c:360
@deffn {Scheme Procedure} make-doubly-weak-hash-table n
@deffnx {C Function} scm_make_doubly_weak_hash_table (n)
Return a hash table with weak keys and values with @var{size}
buckets. (@pxref{Hash Tables})
@end deffn
hash-table?
@c snarfed from hashtab.c:379
@deffn {Scheme Procedure} hash-table? obj
@deffnx {C Function} scm_hash_table_p (obj)
Return @code{#t} if @var{obj} is a hash table.
@end deffn
weak-key-hash-table?
@c snarfed from hashtab.c:393
@deffn {Scheme Procedure} weak-key-hash-table? obj
@deffnx {Scheme Procedure} weak-value-hash-table? obj
@deffnx {Scheme Procedure} doubly-weak-hash-table? obj
@deffnx {C Function} scm_weak_key_hash_table_p (obj)
Return @code{#t} if @var{obj} is the specified weak hash
table. Note that a doubly weak hash table is neither a weak key
nor a weak value hash table.
@end deffn
weak-value-hash-table?
@c snarfed from hashtab.c:403
@deffn {Scheme Procedure} weak-value-hash-table? obj
@deffnx {C Function} scm_weak_value_hash_table_p (obj)
Return @code{#t} if @var{obj} is a weak value hash table.
@end deffn
doubly-weak-hash-table?
@c snarfed from hashtab.c:413
@deffn {Scheme Procedure} doubly-weak-hash-table? obj
@deffnx {C Function} scm_doubly_weak_hash_table_p (obj)
Return @code{#t} if @var{obj} is a doubly weak hash table.
@end deffn
hash-clear!
@c snarfed from hashtab.c:550
@deffn {Scheme Procedure} hash-clear! table
@deffnx {C Function} scm_hash_clear_x (table)
Remove all items from TABLE (without triggering a resize).
@end deffn
2001-03-23 15:05:40 +00:00
hashq-get-handle
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:567
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashq-get-handle table key
@deffnx {C Function} scm_hashq_get_handle (table, key)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
This procedure returns the @code{(key . value)} pair from the
hash table @var{table}. If @var{table} does not hold an
associated value for @var{key}, @code{#f} is returned.
Uses @code{eq?} for equality testing.
2001-03-23 15:05:40 +00:00
@end deffn
hashq-create-handle!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:579
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashq-create-handle! table key init
@deffnx {C Function} scm_hashq_create_handle_x (table, key, init)
2001-03-23 15:05:40 +00:00
This function looks up @var{key} in @var{table} and returns its handle.
If @var{key} is not already present, a new handle is created which
associates @var{key} with @var{init}.
@end deffn
hashq-ref
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:592
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashq-ref table key [dflt]
@deffnx {C Function} scm_hashq_ref (table, key, dflt)
2001-03-23 15:05:40 +00:00
Look up @var{key} in the hash table @var{table}, and return the
value (if any) associated with it. If @var{key} is not found,
return @var{default} (or @code{#f} if no @var{default} argument
is supplied). Uses @code{eq?} for equality testing.
@end deffn
hashq-set!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:606
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashq-set! table key val
@deffnx {C Function} scm_hashq_set_x (table, key, val)
2001-03-23 15:05:40 +00:00
Find the entry in @var{table} associated with @var{key}, and
store @var{value} there. Uses @code{eq?} for equality testing.
@end deffn
hashq-remove!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:618
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashq-remove! table key
@deffnx {C Function} scm_hashq_remove_x (table, key)
2001-03-23 15:05:40 +00:00
Remove @var{key} (and any value associated with it) from
@var{table}. Uses @code{eq?} for equality tests.
@end deffn
hashv-get-handle
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:634
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashv-get-handle table key
@deffnx {C Function} scm_hashv_get_handle (table, key)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
This procedure returns the @code{(key . value)} pair from the
hash table @var{table}. If @var{table} does not hold an
associated value for @var{key}, @code{#f} is returned.
Uses @code{eqv?} for equality testing.
2001-03-23 15:05:40 +00:00
@end deffn
hashv-create-handle!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:646
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashv-create-handle! table key init
@deffnx {C Function} scm_hashv_create_handle_x (table, key, init)
2001-03-23 15:05:40 +00:00
This function looks up @var{key} in @var{table} and returns its handle.
If @var{key} is not already present, a new handle is created which
associates @var{key} with @var{init}.
@end deffn
hashv-ref
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:660
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashv-ref table key [dflt]
@deffnx {C Function} scm_hashv_ref (table, key, dflt)
2001-03-23 15:05:40 +00:00
Look up @var{key} in the hash table @var{table}, and return the
value (if any) associated with it. If @var{key} is not found,
return @var{default} (or @code{#f} if no @var{default} argument
is supplied). Uses @code{eqv?} for equality testing.
@end deffn
hashv-set!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:674
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashv-set! table key val
@deffnx {C Function} scm_hashv_set_x (table, key, val)
2001-03-23 15:05:40 +00:00
Find the entry in @var{table} associated with @var{key}, and
store @var{value} there. Uses @code{eqv?} for equality testing.
@end deffn
hashv-remove!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:685
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashv-remove! table key
@deffnx {C Function} scm_hashv_remove_x (table, key)
2001-03-23 15:05:40 +00:00
Remove @var{key} (and any value associated with it) from
@var{table}. Uses @code{eqv?} for equality tests.
@end deffn
hash-get-handle
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:700
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hash-get-handle table key
@deffnx {C Function} scm_hash_get_handle (table, key)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
This procedure returns the @code{(key . value)} pair from the
hash table @var{table}. If @var{table} does not hold an
associated value for @var{key}, @code{#f} is returned.
Uses @code{equal?} for equality testing.
2001-03-23 15:05:40 +00:00
@end deffn
hash-create-handle!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:712
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hash-create-handle! table key init
@deffnx {C Function} scm_hash_create_handle_x (table, key, init)
2001-03-23 15:05:40 +00:00
This function looks up @var{key} in @var{table} and returns its handle.
If @var{key} is not already present, a new handle is created which
associates @var{key} with @var{init}.
@end deffn
hash-ref
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:725
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hash-ref table key [dflt]
@deffnx {C Function} scm_hash_ref (table, key, dflt)
2001-03-23 15:05:40 +00:00
Look up @var{key} in the hash table @var{table}, and return the
value (if any) associated with it. If @var{key} is not found,
return @var{default} (or @code{#f} if no @var{default} argument
is supplied). Uses @code{equal?} for equality testing.
@end deffn
hash-set!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:740
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hash-set! table key val
@deffnx {C Function} scm_hash_set_x (table, key, val)
2001-03-23 15:05:40 +00:00
Find the entry in @var{table} associated with @var{key}, and
store @var{value} there. Uses @code{equal?} for equality
testing.
@end deffn
hash-remove!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:752
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hash-remove! table key
@deffnx {C Function} scm_hash_remove_x (table, key)
2001-03-23 15:05:40 +00:00
Remove @var{key} (and any value associated with it) from
@var{table}. Uses @code{equal?} for equality tests.
@end deffn
hashx-get-handle
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:805
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashx-get-handle hash assoc table key
@deffnx {C Function} scm_hashx_get_handle (hash, assoc, table, key)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
This behaves the same way as the corresponding
@code{-get-handle} function, but uses @var{hash} as a hash
function and @var{assoc} to compare keys. @code{hash} must be
a function that takes two arguments, a key to be hashed and a
2001-03-23 15:05:40 +00:00
table size. @code{assoc} must be an associator function, like
@code{assoc}, @code{assq} or @code{assv}.
@end deffn
hashx-create-handle!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:824
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashx-create-handle! hash assoc table key init
@deffnx {C Function} scm_hashx_create_handle_x (hash, assoc, table, key, init)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
This behaves the same way as the corresponding
@code{-create-handle} function, but uses @var{hash} as a hash
function and @var{assoc} to compare keys. @code{hash} must be
a function that takes two arguments, a key to be hashed and a
2001-03-23 15:05:40 +00:00
table size. @code{assoc} must be an associator function, like
@code{assoc}, @code{assq} or @code{assv}.
@end deffn
hashx-ref
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:847
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashx-ref hash assoc table key [dflt]
@deffnx {C Function} scm_hashx_ref (hash, assoc, table, key, dflt)
2001-03-23 15:05:40 +00:00
This behaves the same way as the corresponding @code{ref}
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
function, but uses @var{hash} as a hash function and
@var{assoc} to compare keys. @code{hash} must be a function
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}.
* 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'.
2001-05-04 21:54:00 +00:00
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
By way of illustration, @code{hashq-ref table key} is
equivalent to @code{hashx-ref hashq assq table key}.
2001-03-23 15:05:40 +00:00
@end deffn
hashx-set!
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:873
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hashx-set! hash assoc table key val
@deffnx {C Function} scm_hashx_set_x (hash, assoc, table, key, val)
2001-03-23 15:05:40 +00:00
This behaves the same way as the corresponding @code{set!}
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
function, but uses @var{hash} as a hash function and
@var{assoc} to compare keys. @code{hash} must be a function
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}.
* 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'.
2001-05-04 21:54:00 +00:00
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
By way of illustration, @code{hashq-set! table key} is
equivalent to @code{hashx-set! hashq assq table key}.
2001-03-23 15:05:40 +00:00
@end deffn
hash-fold
2004-08-24 16:43:07 +00:00
@c snarfed from hashtab.c:975
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hash-fold proc init table
@deffnx {C Function} scm_hash_fold (proc, init, table)
2001-03-23 15:05:40 +00:00
An iterator over hash-table elements.
Accumulates and returns a result by applying PROC successively.
The arguments to PROC are "(key value prior-result)" where key
and value are successive pairs from the hash table TABLE, and
prior-result is either INIT (for the first application of PROC)
or the return value of the previous application of PROC.
2001-11-13 23:44:29 +00:00
For example, @code{(hash-fold acons '() tab)} will convert a hash
2001-03-23 15:05:40 +00:00
table into an a-list of key-value pairs.
@end deffn
2004-08-24 16:43:07 +00:00
hash-for-each
@c snarfed from hashtab.c:996
@deffn {Scheme Procedure} hash-for-each proc table
@deffnx {C Function} scm_hash_for_each (proc, table)
An iterator over hash-table elements.
Applies PROC successively on all hash table items.
The arguments to PROC are "(key value)" where key
and value are successive pairs from the hash table TABLE.
@end deffn
hash-for-each-handle
@c snarfed from hashtab.c:1013
@deffn {Scheme Procedure} hash-for-each-handle proc table
@deffnx {C Function} scm_hash_for_each_handle (proc, table)
An iterator over hash-table elements.
Applies PROC successively on all hash table handles.
@end deffn
hash-map->list
@c snarfed from hashtab.c:1039
@deffn {Scheme Procedure} hash-map->list proc table
@deffnx {C Function} scm_hash_map_to_list (proc, table)
An iterator over hash-table elements.
Accumulates and returns as a list the results of applying PROC successively.
The arguments to PROC are "(key value)" where key
and value are successive pairs from the hash table TABLE.
@end deffn
2001-03-23 15:05:40 +00:00
make-hook
2004-08-24 16:43:07 +00:00
@c snarfed from hooks.c:154
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-hook [n_args]
@deffnx {C Function} scm_make_hook (n_args)
2001-11-11 15:01:52 +00:00
Create a hook for storing procedure of arity @var{n_args}.
@var{n_args} defaults to zero. The returned value is a hook
object to be used with the other hook procedures.
2001-03-23 15:05:40 +00:00
@end deffn
hook?
2004-08-24 16:43:07 +00:00
@c snarfed from hooks.c:171
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hook? x
@deffnx {C Function} scm_hook_p (x)
2001-04-09 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-data.texi (Pairs): New data type and procedure
description.
(Lists): Added new subsections for grouping the list procedures.
(Hooks): Added new nodes for hook subsections.
(String Syntax): New node, factoring out read syntax.
(Strings): Some blurb about allowed characters, zero-termination
etc.
(Keywords): Added menu descriptions.
2001-04-08 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-indices.texi (R5RS Index): Print index `rn', not `r5'.
* guile.texi: The index formerly known as `r5' is now called `rn'.
* scheme-utility.texi, scheme-procedures.texi, scheme-io.texi,
scheme-evaluation.texi, scheme-control.texi, scheme-data.texi:
Changed all @r5index entries to @rnindex.
2001-04-06 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-data.texi (Hooks): Added hook description and
constraints.
2001-04-04 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-data.texi (Alphabetic Case Mapping),
(String Comparison): Rearranged function order.
(Vectors): Reorganized, new introductory text, docs about read
syntax.
2001-04-09 16:16:09 +00:00
Return @code{#t} if @var{x} is a hook, @code{#f} otherwise.
2001-03-23 15:05:40 +00:00
@end deffn
hook-empty?
2004-08-24 16:43:07 +00:00
@c snarfed from hooks.c:182
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hook-empty? hook
@deffnx {C Function} scm_hook_empty_p (hook)
2001-04-09 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-data.texi (Pairs): New data type and procedure
description.
(Lists): Added new subsections for grouping the list procedures.
(Hooks): Added new nodes for hook subsections.
(String Syntax): New node, factoring out read syntax.
(Strings): Some blurb about allowed characters, zero-termination
etc.
(Keywords): Added menu descriptions.
2001-04-08 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-indices.texi (R5RS Index): Print index `rn', not `r5'.
* guile.texi: The index formerly known as `r5' is now called `rn'.
* scheme-utility.texi, scheme-procedures.texi, scheme-io.texi,
scheme-evaluation.texi, scheme-control.texi, scheme-data.texi:
Changed all @r5index entries to @rnindex.
2001-04-06 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-data.texi (Hooks): Added hook description and
constraints.
2001-04-04 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-data.texi (Alphabetic Case Mapping),
(String Comparison): Rearranged function order.
(Vectors): Reorganized, new introductory text, docs about read
syntax.
2001-04-09 16:16:09 +00:00
Return @code{#t} if @var{hook} is an empty hook, @code{#f}
otherwise.
2001-03-23 15:05:40 +00:00
@end deffn
add-hook!
2004-08-24 16:43:07 +00:00
@c snarfed from hooks.c:196
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} add-hook! hook proc [append_p]
@deffnx {C Function} scm_add_hook_x (hook, proc, append_p)
2001-03-23 15:05:40 +00:00
Add the procedure @var{proc} to the hook @var{hook}. The
procedure is added to the end if @var{append_p} is true,
2001-11-11 15:01:52 +00:00
otherwise it is added to the front. The return value of this
procedure is not specified.
2001-03-23 15:05:40 +00:00
@end deffn
remove-hook!
2004-08-24 16:43:07 +00:00
@c snarfed from hooks.c:223
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} remove-hook! hook proc
@deffnx {C Function} scm_remove_hook_x (hook, proc)
2001-11-11 15:01:52 +00:00
Remove the procedure @var{proc} from the hook @var{hook}. The
return value of this procedure is not specified.
2001-03-23 15:05:40 +00:00
@end deffn
reset-hook!
2004-08-24 16:43:07 +00:00
@c snarfed from hooks.c:237
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} reset-hook! hook
@deffnx {C Function} scm_reset_hook_x (hook)
2001-11-11 15:01:52 +00:00
Remove all procedures from the hook @var{hook}. The return
value of this procedure is not specified.
2001-03-23 15:05:40 +00:00
@end deffn
run-hook
2004-08-24 16:43:07 +00:00
@c snarfed from hooks.c:251
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} run-hook hook . args
@deffnx {C Function} scm_run_hook (hook, args)
2001-03-23 15:05:40 +00:00
Apply all procedures from the hook @var{hook} to the arguments
2001-04-09 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-data.texi (Pairs): New data type and procedure
description.
(Lists): Added new subsections for grouping the list procedures.
(Hooks): Added new nodes for hook subsections.
(String Syntax): New node, factoring out read syntax.
(Strings): Some blurb about allowed characters, zero-termination
etc.
(Keywords): Added menu descriptions.
2001-04-08 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-indices.texi (R5RS Index): Print index `rn', not `r5'.
* guile.texi: The index formerly known as `r5' is now called `rn'.
* scheme-utility.texi, scheme-procedures.texi, scheme-io.texi,
scheme-evaluation.texi, scheme-control.texi, scheme-data.texi:
Changed all @r5index entries to @rnindex.
2001-04-06 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-data.texi (Hooks): Added hook description and
constraints.
2001-04-04 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* scheme-data.texi (Alphabetic Case Mapping),
(String Comparison): Rearranged function order.
(Vectors): Reorganized, new introductory text, docs about read
syntax.
2001-04-09 16:16:09 +00:00
@var{args}. The order of the procedure application is first to
2001-11-11 15:01:52 +00:00
last. The return value of this procedure is not specified.
2001-03-23 15:05:40 +00:00
@end deffn
hook->list
2004-08-24 16:43:07 +00:00
@c snarfed from hooks.c:278
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} hook->list hook
@deffnx {C Function} scm_hook_to_list (hook)
2001-03-23 15:05:40 +00:00
Convert the procedure list of @var{hook} to a list.
@end deffn
ftell
2004-08-24 16:43:07 +00:00
@c snarfed from ioext.c:54
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} ftell fd_port
@deffnx {C Function} scm_ftell (fd_port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return an integer representing the current position of
@var{fd/port}, measured from the beginning. Equivalent to:
* 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'.
2001-05-04 21:54:00 +00:00
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-03-23 15:05:40 +00:00
(seek port 0 SEEK_CUR)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
redirect-port
2004-08-24 16:43:07 +00:00
@c snarfed from ioext.c:72
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} redirect-port old new
@deffnx {C Function} scm_redirect_port (old, new)
2001-03-23 15:05:40 +00:00
This procedure takes two ports and duplicates the underlying file
descriptor from @var{old-port} into @var{new-port}. The
current file descriptor in @var{new-port} will be closed.
After the redirection the two ports will share a file position
and file status flags.
The return value is unspecified.
Unexpected behaviour can result if both ports are subsequently used
and the original and/or duplicate ports are buffered.
This procedure does not have any side effects on other ports or
revealed counts.
@end deffn
dup->fdes
2004-08-24 16:43:07 +00:00
@c snarfed from ioext.c:111
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dup->fdes fd_or_port [fd]
@deffnx {C Function} scm_dup_to_fdes (fd_or_port, fd)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return a new integer file descriptor referring to the open file
designated by @var{fd_or_port}, which must be either an open
file port or a file descriptor.
2001-03-23 15:05:40 +00:00
@end deffn
dup2
2004-08-24 16:43:07 +00:00
@c snarfed from ioext.c:158
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dup2 oldfd newfd
@deffnx {C Function} scm_dup2 (oldfd, newfd)
2001-03-23 15:05:40 +00:00
A simple wrapper for the @code{dup2} system call.
Copies the file descriptor @var{oldfd} to descriptor
number @var{newfd}, replacing the previous meaning
of @var{newfd}. Both @var{oldfd} and @var{newfd} must
be integers.
Unlike for dup->fdes or primitive-move->fdes, no attempt
is made to move away ports which are using @var{newfd}.
The return value is unspecified.
@end deffn
fileno
2004-08-24 16:43:07 +00:00
@c snarfed from ioext.c:177
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} fileno port
@deffnx {C Function} scm_fileno (port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return the integer file descriptor underlying @var{port}. Does
not change its revealed count.
2001-03-23 15:05:40 +00:00
@end deffn
isatty?
2004-08-24 16:43:07 +00:00
@c snarfed from ioext.c:197
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} isatty? port
@deffnx {C Function} scm_isatty_p (port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return @code{#t} if @var{port} is using a serial non--file
device, otherwise @code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
fdopen
2004-08-24 16:43:07 +00:00
@c snarfed from ioext.c:219
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} fdopen fdes modes
@deffnx {C Function} scm_fdopen (fdes, modes)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return a new port based on the file descriptor @var{fdes}.
Modes are given by the string @var{modes}. The revealed count
of the port is initialized to zero. The modes string is the
same as that accepted by @ref{File Ports, open-file}.
2001-03-23 15:05:40 +00:00
@end deffn
primitive-move->fdes
2004-08-24 16:43:07 +00:00
@c snarfed from ioext.c:241
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-move->fdes port fd
@deffnx {C Function} scm_primitive_move_to_fdes (port, fd)
2001-03-23 15:05:40 +00:00
Moves the underlying file descriptor for @var{port} to the integer
value @var{fdes} without changing the revealed count of @var{port}.
Any other ports already using this descriptor will be automatically
shifted to new descriptors and their revealed counts reset to zero.
The return value is @code{#f} if the file descriptor already had the
required value or @code{#t} if it was moved.
@end deffn
fdes->ports
2004-08-24 16:43:07 +00:00
@c snarfed from ioext.c:274
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} fdes->ports fd
@deffnx {C Function} scm_fdes_to_ports (fd)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return a list of existing ports which have @var{fdes} as an
underlying file descriptor, without changing their revealed
counts.
2001-03-23 15:05:40 +00:00
@end deffn
make-keyword-from-dash-symbol
2004-08-24 16:43:07 +00:00
@c snarfed from keywords.c:52
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol
@deffnx {C Function} scm_make_keyword_from_dash_symbol (symbol)
2001-03-23 15:05:40 +00:00
Make a keyword object from a @var{symbol} that starts with a dash.
@end deffn
keyword?
2004-08-24 16:43:07 +00:00
@c snarfed from keywords.c:91
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} keyword? obj
@deffnx {C Function} scm_keyword_p (obj)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return @code{#t} if the argument @var{obj} is a keyword, else
@code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
keyword-dash-symbol
2004-08-24 16:43:07 +00:00
@c snarfed from keywords.c:102
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} keyword-dash-symbol keyword
@deffnx {C Function} scm_keyword_dash_symbol (keyword)
2001-03-23 15:05:40 +00:00
Return the dash symbol for @var{keyword}.
This is the inverse of @code{make-keyword-from-dash-symbol}.
@end deffn
list
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:104
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list . objs
@deffnx {C Function} scm_list (objs)
2001-03-23 15:05:40 +00:00
Return a list containing @var{objs}, the arguments to
@code{list}.
@end deffn
cons*
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:119
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} cons* arg . rest
@deffnx {C Function} scm_cons_star (arg, rest)
2001-03-23 15:05:40 +00:00
Like @code{list}, but the last arg provides the tail of the
constructed list, returning @code{(cons @var{arg1} (cons
2001-03-23 17:24:28 +00:00
@var{arg2} (cons @dots{} @var{argn})))}. Requires at least one
2001-03-23 15:05:40 +00:00
argument. If given one argument, that argument is returned as
result. This function is called @code{list*} in some other
Schemes and in Common LISP.
@end deffn
null?
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:143
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} null? x
@deffnx {C Function} scm_null_p (x)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is the empty list, else @code{#f}.
@end deffn
list?
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:153
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list? x
@deffnx {C Function} scm_list_p (x)
2001-03-23 15:05:40 +00:00
Return @code{#t} iff @var{x} is a proper list, else @code{#f}.
@end deffn
length
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:194
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} length lst
@deffnx {C Function} scm_length (lst)
2001-03-23 15:05:40 +00:00
Return the number of elements in list @var{lst}.
@end deffn
append
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:223
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} append . args
@deffnx {C Function} scm_append (args)
2001-03-23 15:05:40 +00:00
Return a list consisting of the elements the lists passed as
arguments.
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-03-23 15:05:40 +00:00
(append '(x) '(y)) @result{} (x y)
(append '(a) '(b c d)) @result{} (a b c d)
(append '(a (b)) '((c))) @result{} (a (b) (c))
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
The resulting list is always newly allocated, except that it
shares structure with the last list argument. The last
argument may actually be any object; an improper list results
if the last argument is not a proper list.
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-03-23 15:05:40 +00:00
(append '(a b) '(c . d)) @result{} (a b c . d)
(append '() 'a) @result{} a
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
append!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:259
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} append! . lists
@deffnx {C Function} scm_append_x (lists)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
A destructive version of @code{append} (@pxref{Pairs and
2001-11-11 15:01:52 +00:00
Lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr field
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
of each list's final pair is changed to point to the head of
2004-08-24 16:43:07 +00:00
the next list, so no consing is performed. Return
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
the mutated list.
2001-03-23 15:05:40 +00:00
@end deffn
last-pair
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:291
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} last-pair lst
@deffnx {C Function} scm_last_pair (lst)
2004-08-24 16:43:07 +00:00
Return the last pair in @var{lst}, signalling an error if
2001-03-23 15:05:40 +00:00
@var{lst} is circular.
@end deffn
reverse
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:321
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} reverse lst
@deffnx {C Function} scm_reverse (lst)
2001-03-23 15:05:40 +00:00
Return a new list that contains the elements of @var{lst} but
in reverse order.
@end deffn
reverse!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:355
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} reverse! lst [new_tail]
@deffnx {C Function} scm_reverse_x (lst, new_tail)
2001-11-11 15:01:52 +00:00
A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r5rs,
The Revised^5 Report on Scheme}). The cdr of each cell in @var{lst} is
2004-08-24 16:43:07 +00:00
modified to point to the previous list element. Return the
reversed list.
2001-03-23 15:05:40 +00:00
Caveat: because the list is modified in place, the tail of the original
list now becomes its head, and the head of the original list now becomes
the tail. Therefore, the @var{lst} symbol to which the head of the
original list was bound now points to the tail. To ensure that the head
of the modified list is not lost, it is wise to save the return value of
@code{reverse!}
@end deffn
list-ref
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:381
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list-ref list k
@deffnx {C Function} scm_list_ref (list, k)
2001-03-23 15:05:40 +00:00
Return the @var{k}th element from @var{list}.
@end deffn
list-set!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:405
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list-set! list k val
@deffnx {C Function} scm_list_set_x (list, k, val)
2001-03-23 15:05:40 +00:00
Set the @var{k}th element of @var{list} to @var{val}.
@end deffn
list-cdr-ref
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:427
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list-cdr-ref
2001-11-11 15:01:52 +00:00
implemented by the C function "scm_list_tail"
2001-03-23 15:05:40 +00:00
@end deffn
list-tail
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:436
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list-tail lst k
@deffnx {Scheme Procedure} list-cdr-ref lst k
@deffnx {C Function} scm_list_tail (lst, k)
2001-03-23 15:05:40 +00:00
Return the "tail" of @var{lst} beginning with its @var{k}th element.
The first element of the list is considered to be element 0.
@code{list-tail} and @code{list-cdr-ref} are identical. It may help to
think of @code{list-cdr-ref} as accessing the @var{k}th cdr of the list,
or returning the results of cdring @var{k} times down @var{lst}.
@end deffn
list-cdr-set!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:451
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list-cdr-set! list k val
@deffnx {C Function} scm_list_cdr_set_x (list, k, val)
2001-03-23 15:05:40 +00:00
Set the @var{k}th cdr of @var{list} to @var{val}.
@end deffn
list-head
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:479
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list-head lst k
@deffnx {C Function} scm_list_head (lst, k)
2001-03-23 15:05:40 +00:00
Copy the first @var{k} elements from @var{lst} into a new list, and
return it.
@end deffn
list-copy
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:530
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list-copy lst
@deffnx {C Function} scm_list_copy (lst)
2001-03-23 15:05:40 +00:00
Return a (newly-created) copy of @var{lst}.
@end deffn
memq
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:584
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} memq x lst
@deffnx {C Function} scm_memq (x, lst)
2001-03-23 15:05:40 +00:00
Return the first sublist of @var{lst} whose car is @code{eq?}
to @var{x} where the sublists of @var{lst} are the non-empty
lists returned by @code{(list-tail @var{lst} @var{k})} for
@var{k} less than the length of @var{lst}. If @var{x} does not
occur in @var{lst}, then @code{#f} (not the empty list) is
returned.
@end deffn
memv
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:600
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} memv x lst
@deffnx {C Function} scm_memv (x, lst)
2001-03-23 15:05:40 +00:00
Return the first sublist of @var{lst} whose car is @code{eqv?}
to @var{x} where the sublists of @var{lst} are the non-empty
lists returned by @code{(list-tail @var{lst} @var{k})} for
@var{k} less than the length of @var{lst}. If @var{x} does not
occur in @var{lst}, then @code{#f} (not the empty list) is
returned.
@end deffn
member
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:621
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} member x lst
@deffnx {C Function} scm_member (x, lst)
2001-03-23 15:05:40 +00:00
Return the first sublist of @var{lst} whose car is
@code{equal?} to @var{x} where the sublists of @var{lst} are
the non-empty lists returned by @code{(list-tail @var{lst}
@var{k})} for @var{k} less than the length of @var{lst}. If
@var{x} does not occur in @var{lst}, then @code{#f} (not the
empty list) is returned.
@end deffn
delq!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:646
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delq! item lst
@deffnx {Scheme Procedure} delv! item lst
@deffnx {Scheme Procedure} delete! item lst
@deffnx {C Function} scm_delq_x (item, lst)
2001-03-23 15:05:40 +00:00
These procedures are destructive versions of @code{delq}, @code{delv}
2004-08-24 16:43:07 +00:00
and @code{delete}: they modify the existing @var{lst}
2001-03-23 15:05:40 +00:00
rather than creating a new list. Caveat evaluator: Like other
destructive list functions, these functions cannot modify the binding of
@var{lst}, and so cannot be used to delete the first element of
@var{lst} destructively.
@end deffn
delv!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:670
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delv! item lst
@deffnx {C Function} scm_delv_x (item, lst)
2001-03-23 15:05:40 +00:00
Destructively remove all elements from @var{lst} that are
@code{eqv?} to @var{item}.
@end deffn
delete!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:695
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delete! item lst
@deffnx {C Function} scm_delete_x (item, lst)
2001-03-23 15:05:40 +00:00
Destructively remove all elements from @var{lst} that are
@code{equal?} to @var{item}.
@end deffn
delq
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:724
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delq item lst
@deffnx {C Function} scm_delq (item, lst)
2001-03-23 15:05:40 +00:00
Return a newly-created copy of @var{lst} with elements
@code{eq?} to @var{item} removed. This procedure mirrors
@code{memq}: @code{delq} compares elements of @var{lst} against
@var{item} with @code{eq?}.
@end deffn
delv
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:737
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delv item lst
@deffnx {C Function} scm_delv (item, lst)
2001-03-23 15:05:40 +00:00
Return a newly-created copy of @var{lst} with elements
@code{eqv?} to @var{item} removed. This procedure mirrors
@code{memv}: @code{delv} compares elements of @var{lst} against
@var{item} with @code{eqv?}.
@end deffn
delete
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:750
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delete item lst
@deffnx {C Function} scm_delete (item, lst)
2001-03-23 15:05:40 +00:00
Return a newly-created copy of @var{lst} with elements
@code{equal?} to @var{item} removed. This procedure mirrors
@code{member}: @code{delete} compares elements of @var{lst}
against @var{item} with @code{equal?}.
@end deffn
delq1!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:763
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delq1! item lst
@deffnx {C Function} scm_delq1_x (item, lst)
2001-03-23 15:05:40 +00:00
Like @code{delq!}, but only deletes the first occurrence of
@var{item} from @var{lst}. Tests for equality using
@code{eq?}. See also @code{delv1!} and @code{delete1!}.
@end deffn
delv1!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:791
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delv1! item lst
@deffnx {C Function} scm_delv1_x (item, lst)
2001-03-23 15:05:40 +00:00
Like @code{delv!}, but only deletes the first occurrence of
@var{item} from @var{lst}. Tests for equality using
@code{eqv?}. See also @code{delq1!} and @code{delete1!}.
@end deffn
delete1!
2004-08-24 16:43:07 +00:00
@c snarfed from list.c:819
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delete1! item lst
@deffnx {C Function} scm_delete1_x (item, lst)
2001-03-23 15:05:40 +00:00
Like @code{delete!}, but only deletes the first occurrence of
@var{item} from @var{lst}. Tests for equality using
@code{equal?}. See also @code{delq1!} and @code{delv1!}.
@end deffn
2004-08-24 16:43:07 +00:00
filter
@c snarfed from list.c:851
@deffn {Scheme Procedure} filter pred list
@deffnx {C Function} scm_filter (pred, list)
Return all the elements of 2nd arg @var{list} that satisfy predicate @var{pred}.
The list is not disordered -- elements that appear in the result list occur
in the same order as they occur in the argument list. The returned list may
share a common tail with the argument list. The dynamic order in which the
various applications of pred are made is not specified.
@lisp
(filter even? '(0 7 8 8 43 -4)) => (0 8 8 -4)
@end lisp
@end deffn
filter!
@c snarfed from list.c:878
@deffn {Scheme Procedure} filter! pred list
@deffnx {C Function} scm_filter_x (pred, list)
Linear-update variant of @code{filter}.
@end deffn
2001-03-23 15:05:40 +00:00
primitive-load
2004-08-24 16:43:07 +00:00
@c snarfed from load.c:94
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-load filename
@deffnx {C Function} scm_primitive_load (filename)
2001-03-23 15:05:40 +00:00
Load the file named @var{filename} and evaluate its contents in
the top-level environment. The load paths are not searched;
@var{filename} must either be a full pathname or be a pathname
relative to the current directory. If the variable
@code{%load-hook} is defined, it should be bound to a procedure
that will be called before any code is loaded. See the
documentation for @code{%load-hook} later in this section.
@end deffn
%package-data-dir
2004-08-24 16:43:07 +00:00
@c snarfed from load.c:134
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %package-data-dir
@deffnx {C Function} scm_sys_package_data_dir ()
2001-03-23 15:05:40 +00:00
Return the name of the directory where Scheme packages, modules and
libraries are kept. On most Unix systems, this will be
@samp{/usr/local/share/guile}.
@end deffn
%library-dir
2004-08-24 16:43:07 +00:00
@c snarfed from load.c:146
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %library-dir
@deffnx {C Function} scm_sys_library_dir ()
2001-03-23 15:05:40 +00:00
Return the directory where the Guile Scheme library files are installed.
E.g., may return "/usr/share/guile/1.3.5".
@end deffn
%site-dir
2004-08-24 16:43:07 +00:00
@c snarfed from load.c:158
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %site-dir
@deffnx {C Function} scm_sys_site_dir ()
2001-03-23 15:05:40 +00:00
Return the directory where the Guile site files are installed.
E.g., may return "/usr/share/guile/site".
@end deffn
parse-path
2004-08-24 16:43:07 +00:00
@c snarfed from load.c:183
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} parse-path path [tail]
@deffnx {C Function} scm_parse_path (path, tail)
2001-03-23 15:05:40 +00:00
Parse @var{path}, which is expected to be a colon-separated
string, into a list and return the resulting list with
@var{tail} appended. If @var{path} is @code{#f}, @var{tail}
is returned.
@end deffn
search-path
2004-08-24 16:43:07 +00:00
@c snarfed from load.c:310
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} search-path path filename [extensions]
@deffnx {C Function} scm_search_path (path, filename, extensions)
2001-03-23 15:05:40 +00:00
Search @var{path} for a directory containing a file named
@var{filename}. The file must be readable, and not a directory.
If we find one, return its full filename; otherwise, return
@code{#f}. If @var{filename} is absolute, return it unchanged.
If given, @var{extensions} is a list of strings; for each
directory in @var{path}, we search for @var{filename}
concatenated with each @var{extension}.
@end deffn
%search-load-path
2004-08-24 16:43:07 +00:00
@c snarfed from load.c:447
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %search-load-path filename
@deffnx {C Function} scm_sys_search_load_path (filename)
2001-03-23 15:05:40 +00:00
Search @var{%load-path} for the file named @var{filename},
which must be readable by the current user. If @var{filename}
is found in the list of paths to search or is an absolute
pathname, return its full pathname. Otherwise, return
@code{#f}. Filenames may have any of the optional extensions
in the @code{%load-extensions} list; @code{%search-load-path}
will try each extension automatically.
@end deffn
primitive-load-path
2004-08-24 16:43:07 +00:00
@c snarfed from load.c:468
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-load-path filename
@deffnx {C Function} scm_primitive_load_path (filename)
2001-03-23 15:05:40 +00:00
Search @var{%load-path} for the file named @var{filename} and
load it into the top-level environment. If @var{filename} is a
relative pathname and is not found in the list of search paths,
an error is signalled.
@end deffn
procedure->memoizing-macro
2004-08-24 16:43:07 +00:00
@c snarfed from macros.c:109
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure->memoizing-macro code
@deffnx {C Function} scm_makmmacro (code)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return a @dfn{macro} which, when a symbol defined to this value
appears as the first symbol in an expression, evaluates the
2002-03-15 14:03:53 +00:00
result of applying @var{code} to the expression and the
environment.
2001-03-23 15:05:40 +00:00
2002-03-15 14:03:53 +00:00
@code{procedure->memoizing-macro} is the same as
@code{procedure->macro}, except that the expression returned by
@var{code} replaces the original macro expression in the memoized
form of the containing code.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
procedure->syntax
@c snarfed from macros.c:123
@deffn {Scheme Procedure} procedure->syntax code
@deffnx {C Function} scm_makacro (code)
Return a @dfn{macro} which, when a symbol defined to this value
appears as the first symbol in an expression, returns the
result of applying @var{code} to the expression and the
environment.
@end deffn
2001-03-23 15:05:40 +00:00
macro?
2004-08-24 16:43:07 +00:00
@c snarfed from macros.c:165
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} macro? obj
@deffnx {C Function} scm_macro_p (obj)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a
syntax transformer.
@end deffn
macro-type
2004-08-24 16:43:07 +00:00
@c snarfed from macros.c:186
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} macro-type m
@deffnx {C Function} scm_macro_type (m)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return one of the symbols @code{syntax}, @code{macro} or
@code{macro!}, depending on whether @var{m} is a syntax
2001-11-16 15:04:17 +00:00
transformer, a regular macro, or a memoizing macro,
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
respectively. If @var{m} is not a macro, @code{#f} is
returned.
2001-03-23 15:05:40 +00:00
@end deffn
macro-name
2004-08-24 16:43:07 +00:00
@c snarfed from macros.c:207
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} macro-name m
@deffnx {C Function} scm_macro_name (m)
2001-03-23 15:05:40 +00:00
Return the name of the macro @var{m}.
@end deffn
macro-transformer
2004-08-24 16:43:07 +00:00
@c snarfed from macros.c:218
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} macro-transformer m
@deffnx {C Function} scm_macro_transformer (m)
2001-03-23 15:05:40 +00:00
Return the transformer of the macro @var{m}.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
current-module
2004-08-24 16:43:07 +00:00
@c snarfed from modules.c:45
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} current-module
@deffnx {C Function} scm_current_module ()
* 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'.
2001-05-04 21:54:00 +00:00
Return the current module.
@end deffn
set-current-module
2004-08-24 16:43:07 +00:00
@c snarfed from modules.c:57
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-current-module module
@deffnx {C Function} scm_set_current_module (module)
* 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'.
2001-05-04 21:54:00 +00:00
Set the current module to @var{module} and return
the previous current module.
@end deffn
2001-03-23 15:05:40 +00:00
interaction-environment
2004-08-24 16:43:07 +00:00
@c snarfed from modules.c:80
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} interaction-environment
@deffnx {C Function} scm_interaction_environment ()
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return a specifier for the environment that contains
implementation--defined bindings, typically a superset of those
listed in the report. The intent is that this procedure will
return the environment in which the implementation would
evaluate expressions dynamically typed by the user.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
env-module
2004-08-24 16:43:07 +00:00
@c snarfed from modules.c:261
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} env-module env
@deffnx {C Function} scm_env_module (env)
2001-11-11 15:01:52 +00:00
Return the module of @var{ENV}, a lexical environment.
@end deffn
2001-03-23 15:05:40 +00:00
standard-eval-closure
2004-08-24 16:43:07 +00:00
@c snarfed from modules.c:337
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} standard-eval-closure module
@deffnx {C Function} scm_standard_eval_closure (module)
2001-03-23 15:05:40 +00:00
Return an eval closure for the module @var{module}.
@end deffn
2001-11-11 15:01:52 +00:00
standard-interface-eval-closure
2004-08-24 16:43:07 +00:00
@c snarfed from modules.c:348
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} standard-interface-eval-closure module
@deffnx {C Function} scm_standard_interface_eval_closure (module)
2001-11-11 15:01:52 +00:00
Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
module-import-interface
@c snarfed from modules.c:394
@deffn {Scheme Procedure} module-import-interface module sym
@deffnx {C Function} scm_module_import_interface (module, sym)
@end deffn
2001-11-11 15:01:52 +00:00
%get-pre-modules-obarray
2004-08-24 16:43:07 +00:00
@c snarfed from modules.c:611
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %get-pre-modules-obarray
@deffnx {C Function} scm_get_pre_modules_obarray ()
2001-11-11 15:01:52 +00:00
Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system.
2001-03-23 15:05:40 +00:00
@end deffn
exact?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:461
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} exact? x
@deffnx {C Function} scm_exact_p (x)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{x} is an exact number, @code{#f}
otherwise.
@end deffn
odd?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:480
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} odd? n
@deffnx {C Function} scm_odd_p (n)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{n} is an odd number, @code{#f}
otherwise.
@end deffn
even?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:515
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} even? n
@deffnx {C Function} scm_even_p (n)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{n} is an even number, @code{#f}
otherwise.
@end deffn
2002-07-10 22:21:25 +00:00
inf?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:549
2002-07-10 22:21:25 +00:00
@deffn {Scheme Procedure} inf? n
@deffnx {C Function} scm_inf_p (n)
Return @code{#t} if @var{n} is infinite, @code{#f}
otherwise.
@end deffn
nan?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:565
2002-07-10 22:21:25 +00:00
@deffn {Scheme Procedure} nan? n
@deffnx {C Function} scm_nan_p (n)
Return @code{#t} if @var{n} is a NaN, @code{#f}
otherwise.
@end deffn
inf
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:635
2002-07-10 22:21:25 +00:00
@deffn {Scheme Procedure} inf
@deffnx {C Function} scm_inf ()
Return Inf.
@end deffn
nan
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:650
2002-07-10 22:21:25 +00:00
@deffn {Scheme Procedure} nan
@deffnx {C Function} scm_nan ()
Return NaN.
@end deffn
2004-08-24 16:43:07 +00:00
abs
@c snarfed from numbers.c:666
@deffn {Scheme Procedure} abs x
@deffnx {C Function} scm_abs (x)
Return the absolute value of @var{x}.
@end deffn
2001-03-23 15:05:40 +00:00
logand
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1201
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} logand n1 n2
2001-11-11 15:01:52 +00:00
Return the bitwise AND of the integer arguments.
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(logand) @result{} -1
(logand 7) @result{} 7
(logand #b111 #b011 #b001) @result{} 1
2001-03-23 15:05:40 +00:00
@end lisp
@end deffn
logior
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1277
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} logior n1 n2
2001-11-11 15:01:52 +00:00
Return the bitwise OR of the integer arguments.
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(logior) @result{} 0
(logior 7) @result{} 7
(logior #b000 #b001 #b011) @result{} 3
2001-03-23 15:05:40 +00:00
@end lisp
@end deffn
logxor
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1353
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} logxor n1 n2
2001-11-11 15:01:52 +00:00
Return the bitwise XOR of the integer arguments. A bit is
set in the result if it is set in an odd number of arguments.
2001-03-23 15:05:40 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(logxor) @result{} 0
(logxor 7) @result{} 7
(logxor #b000 #b001 #b011) @result{} 2
(logxor #b000 #b001 #b011 #b011) @result{} 1
2001-03-23 15:05:40 +00:00
@end lisp
@end deffn
logtest
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1424
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} logtest j k
@deffnx {C Function} scm_logtest (j, k)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-03-23 15:05:40 +00:00
(logtest j k) @equiv{} (not (zero? (logand j k)))
(logtest #b0100 #b1011) @result{} #f
(logtest #b0100 #b0111) @result{} #t
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
logbit?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1495
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} logbit? index j
@deffnx {C Function} scm_logbit_p (index, j)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-03-23 15:05:40 +00:00
(logbit? index j) @equiv{} (logtest (integer-expt 2 index) j)
(logbit? 0 #b1101) @result{} #t
(logbit? 1 #b1101) @result{} #f
(logbit? 2 #b1101) @result{} #t
(logbit? 3 #b1101) @result{} #t
(logbit? 4 #b1101) @result{} #f
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
lognot
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1529
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} lognot n
@deffnx {C Function} scm_lognot (n)
2004-08-24 16:43:07 +00:00
Return the integer which is the ones-complement of the integer
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
argument.
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
@lisp
(number->string (lognot #b10000000) 2)
@result{} "-10000001"
(number->string (lognot #b0) 2)
@result{} "-1"
@end lisp
@end deffn
2004-08-24 16:43:07 +00:00
modulo-expt
@c snarfed from numbers.c:1574
@deffn {Scheme Procedure} modulo-expt n k m
@deffnx {C Function} scm_modulo_expt (n, k, m)
Return @var{n} raised to the integer exponent
@var{k}, modulo @var{m}.
@lisp
(modulo-expt 2 3 5)
@result{} 3
@end lisp
@end deffn
2001-03-23 15:05:40 +00:00
integer-expt
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1679
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} integer-expt n k
@deffnx {C Function} scm_integer_expt (n, k)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return @var{n} raised to the non-negative integer exponent
@var{k}.
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
@lisp
(integer-expt 2 5)
@result{} 32
(integer-expt -3 3)
@result{} -27
@end lisp
@end deffn
ash
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1785
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} ash n cnt
@deffnx {C Function} scm_ash (n, cnt)
2004-08-24 16:43:07 +00:00
Return @var{n} shifted left by @var{cnt} bits, or shifted right
if @var{cnt} is negative. This is an ``arithmetic'' shift.
This is effectively a multiplication by 2^@var{cnt}, and when
@var{cnt} is negative it's a division, rounded towards negative
infinity. (Note that this is not the same rounding as
@code{quotient} does.)
* 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'.
2001-05-04 21:54:00 +00:00
2004-08-24 16:43:07 +00:00
With @var{n} viewed as an infinite precision twos complement,
@code{ash} means a left shift introducing zero bits, or a right
shift dropping bits.
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
@lisp
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
(number->string (ash #b1 3) 2) @result{} "1000"
(number->string (ash #b1010 -1) 2) @result{} "101"
2004-08-24 16:43:07 +00:00
;; -23 is bits ...11101001, -6 is bits ...111010
(ash -23 -2) @result{} -6
2001-03-23 15:05:40 +00:00
@end lisp
@end deffn
bit-extract
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1825
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} bit-extract n start end
@deffnx {C Function} scm_bit_extract (n, start, end)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
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.
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
@lisp
(number->string (bit-extract #b1101101010 0 4) 2)
@result{} "1010"
(number->string (bit-extract #b1101101010 4 9) 2)
@result{} "10110"
@end lisp
@end deffn
logcount
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1904
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} logcount n
@deffnx {C Function} scm_logcount (n)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
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.
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
@lisp
(logcount #b10101010)
@result{} 4
(logcount 0)
@result{} 0
(logcount -2)
@result{} 1
@end lisp
@end deffn
integer-length
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:1952
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} integer-length n
@deffnx {C Function} scm_integer_length (n)
2002-03-15 14:03:53 +00:00
Return the number of bits necessary to represent @var{n}.
* 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'.
2001-05-04 21:54:00 +00:00
2001-03-23 15:05:40 +00:00
@lisp
(integer-length #b10101010)
@result{} 8
(integer-length 0)
@result{} 0
(integer-length #b1111)
@result{} 4
@end lisp
@end deffn
number->string
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:2275
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} number->string n [radix]
@deffnx {C Function} scm_number_to_string (n, radix)
2001-03-23 15:05:40 +00:00
Return a string holding the external representation of the
number @var{n} in the given @var{radix}. If @var{n} is
inexact, a radix of 10 will be used.
@end deffn
string->number
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:2958
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string->number string [radix]
@deffnx {C Function} scm_string_to_number (string, radix)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return a number of the maximally precise representation
2001-03-23 15:05:40 +00:00
expressed by the given @var{string}. @var{radix} must be an
exact integer, either 2, 8, 10, or 16. If supplied, @var{radix}
is a default radix that may be overridden by an explicit radix
prefix in @var{string} (e.g. "#o177"). If @var{radix} is not
supplied, then the default radix is 10. If string is not a
syntactically valid notation for a number, then
@code{string->number} returns @code{#f}.
@end deffn
number?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:3021
@deffn {Scheme Procedure} number? x
@deffnx {C Function} scm_number_p (x)
Return @code{#t} if @var{x} is a number, @code{#f}
otherwise.
2001-03-23 15:05:40 +00:00
@end deffn
complex?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:3034
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} complex? x
2004-08-24 16:43:07 +00:00
@deffnx {C Function} scm_complex_p (x)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{x} is a complex number, @code{#f}
2002-03-15 14:03:53 +00:00
otherwise. Note that the sets of real, rational and integer
2001-03-23 15:05:40 +00:00
values form subsets of the set of complex numbers, i. e. the
predicate will also be fulfilled if @var{x} is a real,
rational or integer number.
@end deffn
real?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:3047
@deffn {Scheme Procedure} real? x
@deffnx {C Function} scm_real_p (x)
Return @code{#t} if @var{x} is a real number, @code{#f}
otherwise. Note that the set of integer values forms a subset of
the set of real numbers, i. e. the predicate will also be
fulfilled if @var{x} is an integer number.
2001-03-23 15:05:40 +00:00
@end deffn
rational?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:3060
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} rational? x
2004-08-24 16:43:07 +00:00
@deffnx {C Function} scm_rational_p (x)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{x} is a rational number, @code{#f}
2002-03-15 14:03:53 +00:00
otherwise. Note that the set of integer values forms a subset of
2001-03-23 15:05:40 +00:00
the set of rational numbers, i. e. the predicate will also be
2004-08-24 16:43:07 +00:00
fulfilled if @var{x} is an integer number.
2001-03-23 15:05:40 +00:00
@end deffn
integer?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:3083
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} integer? x
@deffnx {C Function} scm_integer_p (x)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{x} is an integer number, @code{#f}
else.
@end deffn
inexact?
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:3108
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} inexact? x
@deffnx {C Function} scm_inexact_p (x)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{x} is an inexact number, @code{#f}
else.
@end deffn
2004-08-24 16:43:07 +00:00
truncate
@c snarfed from numbers.c:4955
@deffn {Scheme Procedure} truncate x
@deffnx {C Function} scm_truncate_number (x)
Round the number @var{x} towards zero.
@end deffn
round
@c snarfed from numbers.c:4971
@deffn {Scheme Procedure} round x
@deffnx {C Function} scm_round_number (x)
Round the number @var{x} towards the nearest integer. When it is exactly halfway between two integers, round towards the even one.
@end deffn
floor
@c snarfed from numbers.c:4997
@deffn {Scheme Procedure} floor x
@deffnx {C Function} scm_floor (x)
Round the number @var{x} towards minus infinity.
@end deffn
ceiling
@c snarfed from numbers.c:5028
@deffn {Scheme Procedure} ceiling x
@deffnx {C Function} scm_ceiling (x)
Round the number @var{x} towards infinity.
@end deffn
2001-03-23 15:05:40 +00:00
$expt
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:5137
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} $expt x y
@deffnx {C Function} scm_sys_expt (x, y)
2001-03-23 15:05:40 +00:00
Return @var{x} raised to the power of @var{y}. This
procedure does not accept complex arguments.
@end deffn
$atan2
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:5153
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} $atan2 x y
@deffnx {C Function} scm_sys_atan2 (x, y)
2001-03-23 15:05:40 +00:00
Return the arc tangent of the two arguments @var{x} and
@var{y}. This is similar to calculating the arc tangent of
@var{x} / @var{y}, except that the signs of both arguments
are used to determine the quadrant of the result. This
procedure does not accept complex arguments.
@end deffn
make-rectangular
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:5181
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-rectangular real imaginary
@deffnx {C Function} scm_make_rectangular (real, imaginary)
2001-03-23 15:05:40 +00:00
Return a complex number constructed of the given @var{real} and
@var{imaginary} parts.
@end deffn
make-polar
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:5205
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-polar x y
@deffnx {C Function} scm_make_polar (x, y)
2001-03-23 15:05:40 +00:00
Return the complex number @var{x} * e^(i * @var{y}).
@end deffn
inexact->exact
2004-08-24 16:43:07 +00:00
@c snarfed from numbers.c:5408
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} inexact->exact z
@deffnx {C Function} scm_inexact_to_exact (z)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return an exact number that is numerically closest to @var{z}.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
rationalize
@c snarfed from numbers.c:5445
@deffn {Scheme Procedure} rationalize x err
@deffnx {C Function} scm_rationalize (x, err)
Return an exact number that is within @var{err} of @var{x}.
@end deffn
2001-03-23 15:05:40 +00:00
class-of
2004-08-24 16:43:07 +00:00
@c snarfed from objects.c:62
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} class-of x
@deffnx {C Function} scm_class_of (x)
2001-03-23 15:05:40 +00:00
Return the class of @var{x}.
@end deffn
entity?
2004-08-24 16:43:07 +00:00
@c snarfed from objects.c:342
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} entity? obj
@deffnx {C Function} scm_entity_p (obj)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{obj} is an entity.
@end deffn
operator?
2004-08-24 16:43:07 +00:00
@c snarfed from objects.c:351
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} operator? obj
@deffnx {C Function} scm_operator_p (obj)
2001-03-23 15:05:40 +00:00
Return @code{#t} if @var{obj} is an operator.
@end deffn
2001-11-11 15:01:52 +00:00
valid-object-procedure?
2004-08-24 16:43:07 +00:00
@c snarfed from objects.c:367
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} valid-object-procedure? proc
@deffnx {C Function} scm_valid_object_procedure_p (proc)
2001-11-11 15:01:52 +00:00
Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}.
@end deffn
2001-03-23 15:05:40 +00:00
set-object-procedure!
2004-08-24 16:43:07 +00:00
@c snarfed from objects.c:389
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-object-procedure! obj proc
@deffnx {C Function} scm_set_object_procedure_x (obj, proc)
2001-11-11 15:01:52 +00:00
Set the object procedure of @var{obj} to @var{proc}.
2001-03-23 15:05:40 +00:00
@var{obj} must be either an entity or an operator.
@end deffn
make-class-object
2004-08-24 16:43:07 +00:00
@c snarfed from objects.c:449
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-class-object metaclass layout
@deffnx {C Function} scm_make_class_object (metaclass, layout)
2001-03-23 15:05:40 +00:00
Create a new class object of class @var{metaclass}, with the
slot layout specified by @var{layout}.
@end deffn
make-subclass-object
2004-08-24 16:43:07 +00:00
@c snarfed from objects.c:464
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-subclass-object class layout
@deffnx {C Function} scm_make_subclass_object (class, layout)
2001-03-23 15:05:40 +00:00
Create a subclass object of @var{class}, with the slot layout
specified by @var{layout}.
@end deffn
object-properties
2004-08-24 16:43:07 +00:00
@c snarfed from objprop.c:35
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} object-properties obj
@deffnx {C Function} scm_object_properties (obj)
2001-03-23 15:05:40 +00:00
Return @var{obj}'s property list.
@end deffn
set-object-properties!
2004-08-24 16:43:07 +00:00
@c snarfed from objprop.c:45
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-object-properties! obj alist
@deffnx {C Function} scm_set_object_properties_x (obj, alist)
2001-03-23 15:05:40 +00:00
Set @var{obj}'s property list to @var{alist}.
@end deffn
object-property
2004-08-24 16:43:07 +00:00
@c snarfed from objprop.c:56
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} object-property obj key
@deffnx {C Function} scm_object_property (obj, key)
2001-03-23 15:05:40 +00:00
Return the property of @var{obj} with name @var{key}.
@end deffn
set-object-property!
2004-08-24 16:43:07 +00:00
@c snarfed from objprop.c:68
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-object-property! obj key value
@deffnx {C Function} scm_set_object_property_x (obj, key, value)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
In @var{obj}'s property list, set the property named @var{key}
to @var{value}.
2001-03-23 15:05:40 +00:00
@end deffn
cons
2004-08-24 16:43:07 +00:00
@c snarfed from pairs.c:56
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} cons x y
@deffnx {C Function} scm_cons (x, y)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return a newly allocated pair whose car is @var{x} and whose
cdr is @var{y}. The pair is guaranteed to be different (in the
sense of @code{eq?}) from every previously existing object.
2001-03-23 15:05:40 +00:00
@end deffn
pair?
2004-08-24 16:43:07 +00:00
@c snarfed from pairs.c:74
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} pair? x
@deffnx {C Function} scm_pair_p (x)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return @code{#t} if @var{x} is a pair; otherwise return
@code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
set-car!
2004-08-24 16:43:07 +00:00
@c snarfed from pairs.c:85
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-car! pair value
@deffnx {C Function} scm_set_car_x (pair, value)
2001-03-23 15:05:40 +00:00
Stores @var{value} in the car field of @var{pair}. The value returned
by @code{set-car!} is unspecified.
@end deffn
set-cdr!
2004-08-24 16:43:07 +00:00
@c snarfed from pairs.c:98
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-cdr! pair value
@deffnx {C Function} scm_set_cdr_x (pair, value)
2001-03-23 15:05:40 +00:00
Stores @var{value} in the cdr field of @var{pair}. The value returned
by @code{set-cdr!} is unspecified.
@end deffn
char-ready?
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:242
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} char-ready? [port]
@deffnx {C Function} scm_char_ready_p (port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return @code{#t} if a character is ready on input @var{port}
and return @code{#f} otherwise. If @code{char-ready?} returns
@code{#t} then the next @code{read-char} operation on
@var{port} is guaranteed not to hang. If @var{port} is a file
port at end of file then @code{char-ready?} returns @code{#t}.
2004-08-24 16:43:07 +00:00
@code{char-ready?} exists to make it possible for a
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
program to accept characters from interactive ports without
getting stuck waiting for input. Any input editors associated
with such ports must make sure that characters whose existence
has been asserted by @code{char-ready?} cannot be rubbed out.
If @code{char-ready?} were to return @code{#f} at end of file,
a port at end of file would be indistinguishable from an
2004-08-24 16:43:07 +00:00
interactive port that has no ready characters.
2001-03-23 15:05:40 +00:00
@end deffn
drain-input
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:319
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} drain-input port
@deffnx {C Function} scm_drain_input (port)
2001-11-11 15:01:52 +00:00
This procedure clears a port's input buffers, similar
to the way that force-output clears the output buffer. The
contents of the buffers are returned as a single string, e.g.,
@lisp
(define p (open-input-file ...))
(drain-input p) => empty string, nothing buffered yet.
(unread-char (read-char p) p)
(drain-input p) => initial chars from p, up to the buffer size.
@end lisp
Draining the buffers may be useful for cleanly finishing
buffered I/O so that the file descriptor can be used directly
for further input.
2001-03-23 15:05:40 +00:00
@end deffn
current-input-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:347
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} current-input-port
@deffnx {C Function} scm_current_input_port ()
2001-03-23 15:05:40 +00:00
Return the current input port. This is the default port used
by many input procedures. Initially, @code{current-input-port}
returns the @dfn{standard input} in Unix and C terminology.
@end deffn
current-output-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:359
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} current-output-port
@deffnx {C Function} scm_current_output_port ()
2001-03-23 15:05:40 +00:00
Return the current output port. This is the default port used
by many output procedures. Initially,
@code{current-output-port} returns the @dfn{standard output} in
Unix and C terminology.
@end deffn
current-error-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:369
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} current-error-port
@deffnx {C Function} scm_current_error_port ()
2001-03-23 15:05:40 +00:00
Return the port to which errors and warnings should be sent (the
@dfn{standard error} in Unix and C terminology).
@end deffn
current-load-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:379
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} current-load-port
@deffnx {C Function} scm_current_load_port ()
2001-03-23 15:05:40 +00:00
Return the current-load-port.
The load port is used internally by @code{primitive-load}.
@end deffn
set-current-input-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:392
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-current-input-port port
@deffnx {Scheme Procedure} set-current-output-port port
@deffnx {Scheme Procedure} set-current-error-port port
@deffnx {C Function} scm_set_current_input_port (port)
2001-03-23 15:05:40 +00:00
Change the ports returned by @code{current-input-port},
@code{current-output-port} and @code{current-error-port}, respectively,
so that they use the supplied @var{port} for input or output.
@end deffn
set-current-output-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:405
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-current-output-port port
@deffnx {C Function} scm_set_current_output_port (port)
2001-03-23 15:05:40 +00:00
Set the current default output port to @var{port}.
@end deffn
set-current-error-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:419
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-current-error-port port
@deffnx {C Function} scm_set_current_error_port (port)
2001-03-23 15:05:40 +00:00
Set the current default error port to @var{port}.
@end deffn
port-revealed
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:639
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} port-revealed port
@deffnx {C Function} scm_port_revealed (port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return the revealed count for @var{port}.
2001-03-23 15:05:40 +00:00
@end deffn
set-port-revealed!
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:652
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-port-revealed! port rcount
@deffnx {C Function} scm_set_port_revealed_x (port, rcount)
2001-03-23 15:05:40 +00:00
Sets the revealed count for a port to a given value.
The return value is unspecified.
@end deffn
port-mode
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:713
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} port-mode port
@deffnx {C Function} scm_port_mode (port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return the port modes associated with the open port @var{port}.
These will not necessarily be identical to the modes used when
the port was opened, since modes such as "append" which are
used only during port creation are not retained.
2001-03-23 15:05:40 +00:00
@end deffn
close-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:750
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} close-port port
@deffnx {C Function} scm_close_port (port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Close the specified port object. Return @code{#t} if it
successfully closes a port or @code{#f} if it was already
closed. An exception may be raised if an error occurs, for
example when flushing buffered output. See also @ref{Ports and
File Descriptors, close}, for a procedure which can close file
descriptors.
2001-03-23 15:05:40 +00:00
@end deffn
close-input-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:780
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} close-input-port port
@deffnx {C Function} scm_close_input_port (port)
2001-03-23 15:05:40 +00:00
Close the specified input port object. The routine has no effect if
the file has already been closed. An exception may be raised if an
error occurs. The value returned is unspecified.
See also @ref{Ports and File Descriptors, close}, for a procedure
which can close file descriptors.
@end deffn
close-output-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:795
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} close-output-port port
@deffnx {C Function} scm_close_output_port (port)
2001-03-23 15:05:40 +00:00
Close the specified output port object. The routine has no effect if
the file has already been closed. An exception may be raised if an
error occurs. The value returned is unspecified.
See also @ref{Ports and File Descriptors, close}, for a procedure
which can close file descriptors.
@end deffn
port-for-each
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:841
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} port-for-each proc
@deffnx {C Function} scm_port_for_each (proc)
2001-03-23 15:05:40 +00:00
Apply @var{proc} to each port in the Guile port table
in turn. The return value is unspecified. More specifically,
@var{proc} is applied exactly once to every port that exists
in the system at the time @var{port-for-each} is invoked.
Changes to the port table while @var{port-for-each} is running
have no effect as far as @var{port-for-each} is concerned.
@end deffn
input-port?
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:859
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} input-port? x
@deffnx {C Function} scm_input_port_p (x)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return @code{#t} if @var{x} is an input port, otherwise return
2001-03-23 15:05:40 +00:00
@code{#f}. Any object satisfying this predicate also satisfies
@code{port?}.
@end deffn
output-port?
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:870
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} output-port? x
@deffnx {C Function} scm_output_port_p (x)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return @code{#t} if @var{x} is an output port, otherwise return
2001-03-23 15:05:40 +00:00
@code{#f}. Any object satisfying this predicate also satisfies
@code{port?}.
@end deffn
port?
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:882
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} port? x
@deffnx {C Function} scm_port_p (x)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return a boolean indicating whether @var{x} is a port.
2001-03-23 15:05:40 +00:00
Equivalent to @code{(or (input-port? @var{x}) (output-port?
@var{x}))}.
@end deffn
port-closed?
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:892
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} port-closed? port
@deffnx {C Function} scm_port_closed_p (port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return @code{#t} if @var{port} is closed or @code{#f} if it is
open.
2001-03-23 15:05:40 +00:00
@end deffn
eof-object?
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:903
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} eof-object? x
@deffnx {C Function} scm_eof_object_p (x)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return @code{#t} if @var{x} is an end-of-file object; otherwise
return @code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
force-output
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:917
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} force-output [port]
@deffnx {C Function} scm_force_output (port)
2001-03-23 15:05:40 +00:00
Flush the specified output port, or the current output port if @var{port}
is omitted. The current output buffer contents are passed to the
underlying port implementation (e.g., in the case of fports, the
data will be written to the file and the output buffer will be cleared.)
It has no effect on an unbuffered port.
The return value is unspecified.
@end deffn
flush-all-ports
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:935
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} flush-all-ports
@deffnx {C Function} scm_flush_all_ports ()
2001-03-23 15:05:40 +00:00
Equivalent to calling @code{force-output} on
all open output ports. The return value is unspecified.
@end deffn
read-char
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:955
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} read-char [port]
@deffnx {C Function} scm_read_char (port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return the next character available from @var{port}, updating
2001-03-23 15:05:40 +00:00
@var{port} to point to the following character. If no more
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
characters are available, the end-of-file object is returned.
2001-03-23 15:05:40 +00:00
@end deffn
peek-char
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1281
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} peek-char [port]
@deffnx {C Function} scm_peek_char (port)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Return the next character available from @var{port},
2001-03-23 15:05:40 +00:00
@emph{without} updating @var{port} to point to the following
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
character. If no more characters are available, the
2004-08-24 16:43:07 +00:00
end-of-file object is returned.
The value returned by
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
a call to @code{peek-char} is the same as the value that would
have been returned by a call to @code{read-char} on the same
port. The only difference is that the very next call to
@code{read-char} or @code{peek-char} on that @var{port} will
return the value returned by the preceding call to
@code{peek-char}. In particular, a call to @code{peek-char} on
an interactive port will hang waiting for input whenever a call
2004-08-24 16:43:07 +00:00
to @code{read-char} would have hung.
2001-03-23 15:05:40 +00:00
@end deffn
unread-char
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1304
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} unread-char cobj [port]
@deffnx {C Function} scm_unread_char (cobj, port)
2001-03-23 15:05:40 +00:00
Place @var{char} in @var{port} so that it will be read by the
next read operation. If called multiple times, the unread characters
will be read again in last-in first-out order. If @var{port} is
not supplied, the current input port is used.
@end deffn
unread-string
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1327
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} unread-string str port
@deffnx {C Function} scm_unread_string (str, port)
2001-03-23 15:05:40 +00:00
Place the string @var{str} in @var{port} so that its characters will be
read in subsequent read operations. If called multiple times, the
unread characters will be read again in last-in first-out order. If
@var{port} is not supplied, the current-input-port is used.
@end deffn
seek
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1366
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} seek fd_port offset whence
@deffnx {C Function} scm_seek (fd_port, offset, whence)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Sets the current position of @var{fd/port} to the integer
@var{offset}, which is interpreted according to the value of
@var{whence}.
* 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'.
2001-05-04 21:54:00 +00:00
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
One of the following variables should be supplied for
@var{whence}:
2001-03-23 15:05:40 +00:00
@defvar SEEK_SET
Seek from the beginning of the file.
@end defvar
@defvar SEEK_CUR
Seek from the current position.
@end defvar
@defvar SEEK_END
Seek from the end of the file.
@end defvar
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
If @var{fd/port} is a file descriptor, the underlying system
call is @code{lseek}. @var{port} may be a string port.
* 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'.
2001-05-04 21:54:00 +00:00
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
The value returned is the new position in the file. This means
that the current position of a port can be obtained using:
@lisp
2001-03-23 15:05:40 +00:00
(seek port 0 SEEK_CUR)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
truncate-file
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1424
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} truncate-file object [length]
@deffnx {C Function} scm_truncate_file (object, length)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
Truncates the object referred to by @var{object} to at most
@var{length} bytes. @var{object} can be a string containing a
file name or an integer file descriptor or a port.
@var{length} may be omitted if @var{object} is not a file name,
2004-08-24 16:43:07 +00:00
in which case the truncation occurs at the current port
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
position. The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
port-line
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1484
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} port-line port
@deffnx {C Function} scm_port_line (port)
2001-03-23 15:05:40 +00:00
Return the current line number for @var{port}.
2004-08-24 16:43:07 +00:00
The first line of a file is 0. But you might want to add 1
when printing line numbers, since starting from 1 is
traditional in error messages, and likely to be more natural to
non-programmers.
2001-03-23 15:05:40 +00:00
@end deffn
set-port-line!
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1496
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-port-line! port line
@deffnx {C Function} scm_set_port_line_x (port, line)
2004-08-24 16:43:07 +00:00
Set the current line number for @var{port} to @var{line}. The
first line of a file is 0.
2001-03-23 15:05:40 +00:00
@end deffn
port-column
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1515
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} port-column port
@deffnx {C Function} scm_port_column (port)
2004-08-24 16:43:07 +00:00
Return the current column number of @var{port}.
If the number is
2001-03-23 15:05:40 +00:00
unknown, the result is #f. Otherwise, the result is a 0-origin integer
- i.e. the first character of the first line is line 0, column 0.
(However, when you display a file position, for example in an error
message, we recommend you add 1 to get 1-origin integers. This is
because lines and column numbers traditionally start with 1, and that is
what non-programmers will find most natural.)
@end deffn
set-port-column!
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1527
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-port-column! port column
@deffnx {C Function} scm_set_port_column_x (port, column)
2004-08-24 16:43:07 +00:00
Set the current column of @var{port}. Before reading the first
character on a line the column should be 0.
2001-03-23 15:05:40 +00:00
@end deffn
port-filename
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1541
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} port-filename port
@deffnx {C Function} scm_port_filename (port)
2001-03-23 15:05:40 +00:00
Return the filename associated with @var{port}. This function returns
the strings "standard input", "standard output" and "standard error"
when called on the current input, output and error ports respectively.
@end deffn
set-port-filename!
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1555
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-port-filename! port filename
@deffnx {C Function} scm_set_port_filename_x (port, filename)
2001-03-23 15:05:40 +00:00
Change the filename associated with @var{port}, using the current input
port if none is specified. Note that this does not change the port's
source of data, but only the value that is returned by
@code{port-filename} and reported in diagnostic output.
@end deffn
%make-void-port
2004-08-24 16:43:07 +00:00
@c snarfed from ports.c:1649
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %make-void-port mode
@deffnx {C Function} scm_sys_make_void_port (mode)
2001-03-23 15:05:40 +00:00
Create and return a new void port. A void port acts like
2002-03-15 14:03:53 +00:00
@file{/dev/null}. The @var{mode} argument
2001-03-23 15:05:40 +00:00
specifies the input/output modes for this port: see the
documentation for @code{open-file} in @ref{File Ports}.
@end deffn
2001-11-11 15:01:52 +00:00
print-options-interface
2004-08-24 16:43:07 +00:00
@c snarfed from print.c:83
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} print-options-interface [setting]
@deffnx {C Function} scm_print_options (setting)
2001-11-11 15:01:52 +00:00
Option interface for the print options. Instead of using
this procedure directly, use the procedures
@code{print-enable}, @code{print-disable}, @code{print-set!}
and @code{print-options}.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
simple-format
2004-08-24 16:43:07 +00:00
@c snarfed from print.c:914
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} simple-format destination message . args
@deffnx {C Function} scm_simple_format (destination, message, args)
2001-11-11 15:01:52 +00:00
Write @var{message} to @var{destination}, defaulting to
the current output port.
@var{message} can contain @code{~A} (was @code{%s}) and
@code{~S} (was @code{%S}) escapes. When printed,
the escapes are replaced with corresponding members of
@var{ARGS}:
@code{~A} formats using @code{display} and @code{~S} formats
using @code{write}.
If @var{destination} is @code{#t}, then use the current output
port, if @var{destination} is @code{#f}, then return a string
containing the formatted text. Does not add a trailing newline.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
newline
2004-08-24 16:43:07 +00:00
@c snarfed from print.c:1004
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} newline [port]
@deffnx {C Function} scm_newline (port)
2001-11-11 15:01:52 +00:00
Send a newline to @var{port}.
2001-11-16 15:04:17 +00:00
If @var{port} is omitted, send to the current output port.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
write-char
2004-08-24 16:43:07 +00:00
@c snarfed from print.c:1019
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} write-char chr [port]
@deffnx {C Function} scm_write_char (chr, port)
2001-11-11 15:01:52 +00:00
Send character @var{chr} to @var{port}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
port-with-print-state
2004-08-24 16:43:07 +00:00
@c snarfed from print.c:1073
@deffn {Scheme Procedure} port-with-print-state port [pstate]
2001-11-16 15:04:17 +00:00
@deffnx {C Function} scm_port_with_print_state (port, pstate)
2001-11-11 15:01:52 +00:00
Create a new port which behaves like @var{port}, but with an
2004-08-24 16:43:07 +00:00
included print state @var{pstate}. @var{pstate} is optional.
If @var{pstate} isn't supplied and @var{port} already has
a print state, the old print state is reused.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
get-print-state
2004-08-24 16:43:07 +00:00
@c snarfed from print.c:1086
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} get-print-state port
@deffnx {C Function} scm_get_print_state (port)
2001-11-11 15:01:52 +00:00
Return the print state of the port @var{port}. If @var{port}
has no associated print state, @code{#f} is returned.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
procedure-properties
2004-08-24 16:43:07 +00:00
@c snarfed from procprop.c:160
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure-properties proc
@deffnx {C Function} scm_procedure_properties (proc)
2001-11-11 15:01:52 +00:00
Return @var{obj}'s property list.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
set-procedure-properties!
2004-08-24 16:43:07 +00:00
@c snarfed from procprop.c:173
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-procedure-properties! proc new_val
@deffnx {C Function} scm_set_procedure_properties_x (proc, new_val)
2001-11-11 15:01:52 +00:00
Set @var{obj}'s property list to @var{alist}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
procedure-property
2004-08-24 16:43:07 +00:00
@c snarfed from procprop.c:186
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure-property p k
@deffnx {C Function} scm_procedure_property (p, k)
2001-11-11 15:01:52 +00:00
Return the property of @var{obj} with name @var{key}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
set-procedure-property!
2004-08-24 16:43:07 +00:00
@c snarfed from procprop.c:209
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-procedure-property! p k v
@deffnx {C Function} scm_set_procedure_property_x (p, k, v)
2001-11-11 15:01:52 +00:00
In @var{obj}'s property list, set the property named @var{key} to
@var{value}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
procedure?
2004-08-24 16:43:07 +00:00
@c snarfed from procs.c:162
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure? obj
@deffnx {C Function} scm_procedure_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a procedure.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
closure?
2004-08-24 16:43:07 +00:00
@c snarfed from procs.c:189
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} closure? obj
@deffnx {C Function} scm_closure_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a closure.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
thunk?
2004-08-24 16:43:07 +00:00
@c snarfed from procs.c:198
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} thunk? obj
@deffnx {C Function} scm_thunk_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a thunk.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
procedure-documentation
2004-08-24 16:43:07 +00:00
@c snarfed from procs.c:248
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure-documentation proc
@deffnx {C Function} scm_procedure_documentation (proc)
2001-11-11 15:01:52 +00:00
Return the documentation string associated with @code{proc}. By
convention, if a procedure contains more than one expression and the
first expression is a string constant, that string is assumed to contain
documentation for that procedure.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
procedure-with-setter?
2004-08-24 16:43:07 +00:00
@c snarfed from procs.c:284
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure-with-setter? obj
@deffnx {C Function} scm_procedure_with_setter_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a procedure with an
associated setter procedure.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
make-procedure-with-setter
2004-08-24 16:43:07 +00:00
@c snarfed from procs.c:294
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-procedure-with-setter procedure setter
@deffnx {C Function} scm_make_procedure_with_setter (procedure, setter)
2001-11-11 15:01:52 +00:00
Create a new procedure which behaves like @var{procedure}, but
with the associated setter @var{setter}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
procedure
2004-08-24 16:43:07 +00:00
@c snarfed from procs.c:308
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} procedure proc
@deffnx {C Function} scm_procedure (proc)
2001-11-11 15:01:52 +00:00
Return the procedure of @var{proc}, which must be either a
procedure with setter, or an operator struct.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
primitive-make-property
2004-08-24 16:43:07 +00:00
@c snarfed from properties.c:40
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-make-property not_found_proc
@deffnx {C Function} scm_primitive_make_property (not_found_proc)
2001-11-11 15:01:52 +00:00
Create a @dfn{property token} that can be used with
@code{primitive-property-ref} and @code{primitive-property-set!}.
See @code{primitive-property-ref} for the significance of
@var{not_found_proc}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
primitive-property-ref
2004-08-24 16:43:07 +00:00
@c snarfed from properties.c:59
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-property-ref prop obj
@deffnx {C Function} scm_primitive_property_ref (prop, obj)
2004-08-24 16:43:07 +00:00
Return the property @var{prop} of @var{obj}.
When no value has yet been associated with @var{prop} and
@var{obj}, the @var{not-found-proc} from @var{prop} is used. A
call @code{(@var{not-found-proc} @var{prop} @var{obj})} is made
and the result set as the property value. If
@var{not-found-proc} is @code{#f} then @code{#f} is the
property value.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
primitive-property-set!
2004-08-24 16:43:07 +00:00
@c snarfed from properties.c:90
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-property-set! prop obj val
@deffnx {C Function} scm_primitive_property_set_x (prop, obj, val)
2004-08-24 16:43:07 +00:00
Set the property @var{prop} of @var{obj} to @var{val}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
primitive-property-del!
2004-08-24 16:43:07 +00:00
@c snarfed from properties.c:111
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-property-del! prop obj
@deffnx {C Function} scm_primitive_property_del_x (prop, obj)
2001-11-11 15:01:52 +00:00
Remove any value associated with @var{prop} and @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
random
2004-08-24 16:43:07 +00:00
@c snarfed from random.c:346
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} random n [state]
@deffnx {C Function} scm_random (n, state)
2002-08-10 14:09:55 +00:00
Return a number in [0, N).
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
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.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
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
the state of the pseudo-random-number generator and is altered
as a side effect of the random operation.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
copy-random-state
2004-08-24 16:43:07 +00:00
@c snarfed from random.c:371
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} copy-random-state [state]
@deffnx {C Function} scm_copy_random_state (state)
2001-11-11 15:01:52 +00:00
Return a copy of the random state @var{state}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
seed->random-state
2004-08-24 16:43:07 +00:00
@c snarfed from random.c:383
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} seed->random-state seed
@deffnx {C Function} scm_seed_to_random_state (seed)
2001-11-11 15:01:52 +00:00
Return a new random state using @var{seed}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
random:uniform
2004-08-24 16:43:07 +00:00
@c snarfed from random.c:401
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} random:uniform [state]
@deffnx {C Function} scm_random_uniform (state)
2001-11-11 15:01:52 +00:00
Return a uniformly distributed inexact real random number in
[0,1).
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
random:normal
2004-08-24 16:43:07 +00:00
@c snarfed from random.c:416
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} random:normal [state]
@deffnx {C Function} scm_random_normal (state)
2001-11-11 15:01:52 +00:00
Return an inexact real in a normal distribution. The
distribution used has mean 0 and standard deviation 1. For a
normal distribution with mean m and standard deviation d use
@code{(+ m (* d (random:normal)))}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
random:solid-sphere!
2004-08-24 16:43:07 +00:00
@c snarfed from random.c:472
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} random:solid-sphere! v [state]
@deffnx {C Function} scm_random_solid_sphere_x (v, state)
2001-11-11 15:01:52 +00:00
Fills vect with inexact real random numbers
the sum of whose squares is less than 1.0.
Thinking of vect as coordinates in space of
dimension n = (vector-length vect), the coordinates
2001-11-13 23:44:29 +00:00
are uniformly distributed within the unit n-sphere.
2001-11-11 15:01:52 +00:00
The sum of the squares of the numbers is returned.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
random:hollow-sphere!
2004-08-24 16:43:07 +00:00
@c snarfed from random.c:495
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} random:hollow-sphere! v [state]
@deffnx {C Function} scm_random_hollow_sphere_x (v, state)
2001-11-11 15:01:52 +00:00
Fills vect with inexact real random numbers
the sum of whose squares is equal to 1.0.
Thinking of vect as coordinates in space of
dimension n = (vector-length vect), the coordinates
are uniformly distributed over the surface of the
2001-11-13 23:44:29 +00:00
unit n-sphere.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
random:normal-vector!
2004-08-24 16:43:07 +00:00
@c snarfed from random.c:513
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} random:normal-vector! v [state]
@deffnx {C Function} scm_random_normal_vector_x (v, state)
2001-11-11 15:01:52 +00:00
Fills vect with inexact real random numbers that are
independent and standard normally distributed
(i.e., with mean 0 and variance 1).
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
random:exp
2004-08-24 16:43:07 +00:00
@c snarfed from random.c:538
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} random:exp [state]
@deffnx {C Function} scm_random_exp (state)
2001-11-11 15:01:52 +00:00
Return an inexact real in an exponential distribution with mean
1. For an exponential distribution with mean u use (* u
(random:exp)).
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
%read-delimited!
2004-08-24 16:43:07 +00:00
@c snarfed from rdelim.c:55
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %read-delimited! delims str gobble [port [start [end]]]
@deffnx {C Function} scm_read_delimited_x (delims, str, gobble, port, start, end)
2001-11-11 15:01:52 +00:00
Read characters from @var{port} into @var{str} until one of the
characters in the @var{delims} string is encountered. If
@var{gobble} is true, discard the delimiter character;
otherwise, leave it in the input stream for the next read. If
@var{port} is not specified, use the value of
@code{(current-input-port)}. If @var{start} or @var{end} are
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).
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
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
@var{eof-object}; if the string was filled without encountering
a delimiter, this value is @code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
%read-line
2004-08-24 16:43:07 +00:00
@c snarfed from rdelim.c:202
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} %read-line [port]
@deffnx {C Function} scm_read_line (port)
2001-11-11 15:01:52 +00:00
Read a newline-terminated line from @var{port}, allocating storage as
necessary. The newline terminator (if any) is removed from the string,
and a pair consisting of the line and its delimiter is returned. The
delimiter may be either a newline or the @var{eof-object}; if
@code{%read-line} is called at the end of file, it returns the pair
@code{(#<eof> . #<eof>)}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
write-line
2004-08-24 16:43:07 +00:00
@c snarfed from rdelim.c:255
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} write-line obj [port]
@deffnx {C Function} scm_write_line (obj, port)
2001-11-11 15:01:52 +00:00
Display @var{obj} and a newline character to @var{port}. If
@var{port} is not specified, @code{(current-output-port)} is
used. This function is equivalent to:
@lisp
(display obj [port])
(newline [port])
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
read-options-interface
2004-08-24 16:43:07 +00:00
@c snarfed from read.c:109
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} read-options-interface [setting]
@deffnx {C Function} scm_read_options (setting)
2001-11-11 15:01:52 +00:00
Option interface for the read options. Instead of using
this procedure directly, use the procedures @code{read-enable},
2002-03-15 14:03:53 +00:00
@code{read-disable}, @code{read-set!} and @code{read-options}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
read
2004-08-24 16:43:07 +00:00
@c snarfed from read.c:129
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} read [port]
@deffnx {C Function} scm_read (port)
2001-11-11 15:01:52 +00:00
Read an s-expression from the input port @var{port}, or from
the current input port if @var{port} is not specified.
Any whitespace before the next token is discarded.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
read-hash-extend
2004-08-24 16:43:07 +00:00
@c snarfed from read.c:866
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} read-hash-extend chr proc
@deffnx {C Function} scm_read_hash_extend (chr, proc)
2001-11-11 15:01:52 +00:00
Install the procedure @var{proc} for reading expressions
starting with the character sequence @code{#} and @var{chr}.
@var{proc} will be called with two arguments: the character
@var{chr} and the port to read further data from. The object
returned will be the return value of @code{read}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
call-with-dynamic-root
2004-08-24 16:43:07 +00:00
@c snarfed from root.c:320
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} call-with-dynamic-root thunk handler
@deffnx {C Function} scm_call_with_dynamic_root (thunk, handler)
2001-11-11 15:01:52 +00:00
Evaluate @code{(thunk)} in a new dynamic context, returning its value.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
If an error occurs during evaluation, apply @var{handler} to the
arguments to the throw, just as @code{throw} would. If this happens,
@var{handler} is called outside the scope of the new root -- it is
called in the same dynamic context in which
@code{call-with-dynamic-root} was evaluated.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
If @var{thunk} captures a continuation, the continuation is rooted at
the call to @var{thunk}. In particular, the call to
@code{call-with-dynamic-root} is not captured. Therefore,
@code{call-with-dynamic-root} always returns at most one time.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
Before calling @var{thunk}, the dynamic-wind chain is un-wound back to
the root and a new chain started for @var{thunk}. Therefore, this call
may not do what you expect:
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
;; Almost certainly a bug:
(with-output-to-port
some-port
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(lambda ()
(call-with-dynamic-root
(lambda ()
(display 'fnord)
(newline))
(lambda (errcode) errcode))))
@end lisp
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The problem is, on what port will @samp{fnord} be displayed? You
might expect that because of the @code{with-output-to-port} that
it will be displayed on the port bound to @code{some-port}. But it
probably won't -- before evaluating the thunk, dynamic winds are
unwound, including those created by @code{with-output-to-port}.
So, the standard output port will have been re-set to its default value
before @code{display} is evaluated.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(This function was added to Guile mostly to help calls to functions in C
libraries that can not tolerate non-local exits or calls that return
multiple times. If such functions call back to the interpreter, it should
be under a new dynamic root.)
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
dynamic-root
2004-08-24 16:43:07 +00:00
@c snarfed from root.c:333
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dynamic-root
@deffnx {C Function} scm_dynamic_root ()
2001-11-11 15:01:52 +00:00
Return an object representing the current dynamic root.
These objects are only useful for comparison using @code{eq?}.
They are currently represented as numbers, but your code should
in no way depend on this.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
read-string!/partial
2004-08-24 16:43:07 +00:00
@c snarfed from rw.c:101
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} read-string!/partial str [port_or_fdes [start [end]]]
@deffnx {C Function} scm_read_string_x_partial (str, port_or_fdes, start, end)
2001-11-11 15:01:52 +00:00
Read characters from a port or file descriptor into a
string @var{str}. A port must have an underlying file
descriptor --- a so-called fport. This procedure is
scsh-compatible and can efficiently read large strings.
It will:
@itemize
@item
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
@code{(string-length str)}
@item
use the current input port if @var{port_or_fdes} is not
supplied.
@item
return fewer than the requested number of characters in some
cases, e.g., on end of file, if interrupted by a signal, or if
not all the characters are immediately available.
@item
wait indefinitely for some input if no characters are
currently available,
unless the port is in non-blocking mode.
@item
read characters from the port's input buffers if available,
instead from the underlying file descriptor.
@item
return @code{#f} if end-of-file is encountered before reading
any characters, otherwise return the number of characters
read.
@item
return 0 if the port is in non-blocking mode and no characters
are immediately available.
@item
return 0 if the request is for 0 bytes, with no
end-of-file check.
@end itemize
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
write-string/partial
2004-08-24 16:43:07 +00:00
@c snarfed from rw.c:205
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} write-string/partial str [port_or_fdes [start [end]]]
@deffnx {C Function} scm_write_string_partial (str, port_or_fdes, start, end)
2001-11-11 15:01:52 +00:00
Write characters from a string @var{str} to a port or file
descriptor. A port must have an underlying file descriptor
--- a so-called fport. This procedure is
scsh-compatible and can efficiently write large strings.
It will:
@itemize
@item
attempt to write the entire string, unless the @var{start}
and/or @var{end} arguments are supplied. i.e., @var{start}
defaults to 0 and @var{end} defaults to
@code{(string-length str)}
@item
use the current output port if @var{port_of_fdes} is not
supplied.
@item
in the case of a buffered port, store the characters in the
port's output buffer, if all will fit. If they will not fit
then any existing buffered characters will be flushed
before attempting
to write the new characters directly to the underlying file
descriptor. If the port is in non-blocking mode and
buffered characters can not be flushed immediately, then an
@code{EAGAIN} system-error exception will be raised (Note:
scsh does not support the use of non-blocking buffered ports.)
@item
write fewer than the requested number of
characters in some cases, e.g., if interrupted by a signal or
if not all of the output can be accepted immediately.
@item
wait indefinitely for at least one character
from @var{str} to be accepted by the port, unless the port is
in non-blocking mode.
@item
return the number of characters accepted by the port.
@item
return 0 if the port is in non-blocking mode and can not accept
at least one character from @var{str} immediately
@item
return 0 immediately if the request size is 0 bytes.
@end itemize
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sigaction
2004-08-24 16:43:07 +00:00
@c snarfed from scmsigs.c:285
2002-10-19 16:33:25 +00:00
@deffn {Scheme Procedure} sigaction signum [handler [flags [thread]]]
@deffnx {C Function} scm_sigaction_for_thread (signum, handler, flags, thread)
2001-11-11 15:01:52 +00:00
Install or report the signal handler for a specified signal.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
@var{signum} is the signal number, which can be specified using the value
of variables such as @code{SIGINT}.
* 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'.
2001-05-04 21:54:00 +00:00
2002-10-19 16:33:25 +00:00
If @var{handler} is omitted, @code{sigaction} returns a pair: the
2001-11-11 15:01:52 +00:00
CAR is the current
signal hander, which will be either an integer with the value @code{SIG_DFL}
(default action) or @code{SIG_IGN} (ignore), or the Scheme procedure which
handles the signal, or @code{#f} if a non-Scheme procedure handles the
signal. The CDR contains the current @code{sigaction} flags for the handler.
2001-03-23 15:05:40 +00:00
2002-10-19 16:33:25 +00:00
If @var{handler} is provided, it is installed as the new handler for
@var{signum}. @var{handler} can be a Scheme procedure taking one
2001-11-11 15:01:52 +00:00
argument, or the value of @code{SIG_DFL} (default action) or
@code{SIG_IGN} (ignore), or @code{#f} to restore whatever signal handler
2002-10-19 16:33:25 +00:00
was installed before @code{sigaction} was first used. When
a scheme procedure has been specified, that procedure will run
in the given @var{thread}. When no thread has been given, the
thread that made this call to @code{sigaction} is used.
Flags can optionally be specified for the new handler (@code{SA_RESTART} will
2001-11-11 15:01:52 +00:00
always be added if it's available and the system is using restartable
system calls.) The return value is a pair with information about the
old handler as described above.
This interface does not provide access to the "signal blocking"
facility. Maybe this is not needed, since the thread support may
provide solutions to the problem of consistent access to data
structures.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
restore-signals
2004-08-24 16:43:07 +00:00
@c snarfed from scmsigs.c:456
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} restore-signals
@deffnx {C Function} scm_restore_signals ()
2001-11-11 15:01:52 +00:00
Return all signal handlers to the values they had before any call to
@code{sigaction} was made. The return value is unspecified.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
alarm
2004-08-24 16:43:07 +00:00
@c snarfed from scmsigs.c:493
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} alarm i
@deffnx {C Function} scm_alarm (i)
2001-11-11 15:01:52 +00:00
Set a timer to raise a @code{SIGALRM} signal after the specified
number of seconds (an integer). It's advisable to install a signal
handler for
@code{SIGALRM} beforehand, since the default action is to terminate
the process.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The return value indicates the time remaining for the previous alarm,
if any. The new value replaces the previous alarm. If there was
no previous alarm, the return value is zero.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
setitimer
2004-08-24 16:43:07 +00:00
@c snarfed from scmsigs.c:520
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds
@deffnx {C Function} scm_setitimer (which_timer, interval_seconds, interval_microseconds, value_seconds, value_microseconds)
2001-11-11 15:01:52 +00:00
Set the timer specified by @var{which_timer} according to the given
@var{interval_seconds}, @var{interval_microseconds},
@var{value_seconds}, and @var{value_microseconds} values.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
Return information about the timer's previous setting.
Errors are handled as described in the guile info pages under ``POSIX
Interface Conventions''.
The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
and @code{ITIMER_PROF}.
The return value will be a list of two cons pairs representing the
current state of the given timer. The first pair is the seconds and
microseconds of the timer @code{it_interval}, and the second pair is
the seconds and microseconds of the timer @code{it_value}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getitimer
2004-08-24 16:43:07 +00:00
@c snarfed from scmsigs.c:561
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getitimer which_timer
@deffnx {C Function} scm_getitimer (which_timer)
2001-11-11 15:01:52 +00:00
Return information about the timer specified by @var{which_timer}
Errors are handled as described in the guile info pages under ``POSIX
Interface Conventions''.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
and @code{ITIMER_PROF}.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The return value will be a list of two cons pairs representing the
current state of the given timer. The first pair is the seconds and
microseconds of the timer @code{it_interval}, and the second pair is
the seconds and microseconds of the timer @code{it_value}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
pause
2004-08-24 16:43:07 +00:00
@c snarfed from scmsigs.c:588
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} pause
@deffnx {C Function} scm_pause ()
2001-11-11 15:01:52 +00:00
Pause the current process (thread?) until a signal arrives whose
action is to either terminate the current process or invoke a
handler procedure. The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sleep
2004-08-24 16:43:07 +00:00
@c snarfed from scmsigs.c:601
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sleep i
@deffnx {C Function} scm_sleep (i)
2001-11-11 15:01:52 +00:00
Wait for the given number of seconds (an integer) or until a signal
arrives. The return value is zero if the time elapses or the number
of seconds remaining otherwise.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
usleep
2004-08-24 16:43:07 +00:00
@c snarfed from scmsigs.c:610
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} usleep i
@deffnx {C Function} scm_usleep (i)
2004-08-24 16:43:07 +00:00
Sleep for @var{i} microseconds.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
raise
2004-08-24 16:43:07 +00:00
@c snarfed from scmsigs.c:620
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} raise sig
@deffnx {C Function} scm_raise (sig)
2001-11-11 15:01:52 +00:00
Sends a specified signal @var{sig} to the current process, where
@var{sig} is as described for the kill procedure.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
system
2004-08-24 16:43:07 +00:00
@c snarfed from simpos.c:64
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} system [cmd]
@deffnx {C Function} scm_system (cmd)
2001-11-11 15:01:52 +00:00
Execute @var{cmd} using the operating system's "command
processor". Under Unix this is usually the default shell
@code{sh}. The value returned is @var{cmd}'s exit status as
2004-08-24 16:43:07 +00:00
returned by @code{waitpid}, which can be interpreted using
@code{status:exit-val} and friends.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
If @code{system} is called without arguments, return a boolean
indicating whether the command processor is available.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
system*
@c snarfed from simpos.c:114
@deffn {Scheme Procedure} system* . args
@deffnx {C Function} scm_system_star (args)
Execute the command indicated by @var{args}. The first element must
be a string indicating the command to be executed, and the remaining
items must be strings representing each of the arguments to that
command.
This function returns the exit status of the command as provided by
@code{waitpid}. This value can be handled with @code{status:exit-val}
and the related functions.
@code{system*} is similar to @code{system}, but accepts only one
string per-argument, and performs no shell interpretation. The
command is executed using fork and execlp. Accordingly this function
may be safer than @code{system} in situations where shell
interpretation is not required.
Example: (system* "echo" "foo" "bar")
@end deffn
2001-11-11 15:01:52 +00:00
getenv
2004-08-24 16:43:07 +00:00
@c snarfed from simpos.c:184
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getenv nam
@deffnx {C Function} scm_getenv (nam)
2001-11-11 15:01:52 +00:00
Looks up the string @var{name} in the current environment. The return
value is @code{#f} unless a string of the form @code{NAME=VALUE} is
found, in which case the string @code{VALUE} is returned.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
primitive-exit
2004-08-24 16:43:07 +00:00
@c snarfed from simpos.c:200
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-exit [status]
@deffnx {C Function} scm_primitive_exit (status)
2001-11-11 15:01:52 +00:00
Terminate the current process without unwinding the Scheme stack.
This is would typically be useful after a fork. The exit status
is @var{status} if supplied, otherwise zero.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
restricted-vector-sort!
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:291
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} restricted-vector-sort! vec less startpos endpos
@deffnx {C Function} scm_restricted_vector_sort_x (vec, less, startpos, endpos)
2001-11-11 15:01:52 +00:00
Sort the vector @var{vec}, using @var{less} for comparing
the vector elements. @var{startpos} and @var{endpos} delimit
the range of the vector which gets sorted. The return value
is not specified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sorted?
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:321
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sorted? items less
@deffnx {C Function} scm_sorted_p (items, less)
2001-11-11 15:01:52 +00:00
Return @code{#t} iff @var{items} is a list or a vector such that
for all 1 <= i <= m, the predicate @var{less} returns true when
applied to all elements i - 1 and i
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
merge
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:393
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} merge alist blist less
@deffnx {C Function} scm_merge (alist, blist, less)
Merge two already sorted lists into one.
Given two lists @var{alist} and @var{blist}, such that
@code{(sorted? alist less?)} and @code{(sorted? blist less?)},
return a new list in which the elements of @var{alist} and
2001-11-11 15:01:52 +00:00
@var{blist} have been stably interleaved so that
@code{(sorted? (merge alist blist less?) less?)}.
Note: this does _not_ accept vectors.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
merge!
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:508
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} merge! alist blist less
@deffnx {C Function} scm_merge_x (alist, blist, less)
2001-11-11 15:01:52 +00:00
Takes two lists @var{alist} and @var{blist} such that
@code{(sorted? alist less?)} and @code{(sorted? blist less?)} and
returns a new list in which the elements of @var{alist} and
@var{blist} have been stably interleaved so that
@code{(sorted? (merge alist blist less?) less?)}.
This is the destructive variant of @code{merge}
Note: this does _not_ accept vectors.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sort!
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:577
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sort! items less
@deffnx {C Function} scm_sort_x (items, less)
2001-11-11 15:01:52 +00:00
Sort the sequence @var{items}, which may be a list or a
vector. @var{less} is used for comparing the sequence
elements. The sorting is destructive, that means that the
input sequence is modified to produce the sorted result.
This is not a stable sort.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sort
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:609
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sort items less
@deffnx {C Function} scm_sort (items, less)
2001-11-11 15:01:52 +00:00
Sort the sequence @var{items}, which may be a list or a
vector. @var{less} is used for comparing the sequence
elements. This is not a stable sort.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
stable-sort!
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:717
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} stable-sort! items less
@deffnx {C Function} scm_stable_sort_x (items, less)
2001-11-11 15:01:52 +00:00
Sort the sequence @var{items}, which may be a list or a
vector. @var{less} is used for comparing the sequence elements.
The sorting is destructive, that means that the input sequence
is modified to produce the sorted result.
This is a stable sort.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
stable-sort
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:756
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} stable-sort items less
@deffnx {C Function} scm_stable_sort (items, less)
2001-11-11 15:01:52 +00:00
Sort the sequence @var{items}, which may be a list or a
vector. @var{less} is used for comparing the sequence elements.
This is a stable sort.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sort-list!
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:797
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sort-list! items less
@deffnx {C Function} scm_sort_list_x (items, less)
2001-11-11 15:01:52 +00:00
Sort the list @var{items}, using @var{less} for comparing the
list elements. The sorting is destructive, that means that the
input list is modified to produce the sorted result.
This is a stable sort.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sort-list
2004-08-24 16:43:07 +00:00
@c snarfed from sort.c:812
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sort-list items less
@deffnx {C Function} scm_sort_list (items, less)
2001-11-11 15:01:52 +00:00
Sort the list @var{items}, using @var{less} for comparing the
list elements. This is a stable sort.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
source-properties
2004-08-24 16:43:07 +00:00
@c snarfed from srcprop.c:152
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} source-properties obj
@deffnx {C Function} scm_source_properties (obj)
2001-11-11 15:01:52 +00:00
Return the source property association list of @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
set-source-properties!
2004-08-24 16:43:07 +00:00
@c snarfed from srcprop.c:175
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-source-properties! obj plist
@deffnx {C Function} scm_set_source_properties_x (obj, plist)
2001-11-11 15:01:52 +00:00
Install the association list @var{plist} as the source property
list for @var{obj}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
source-property
2004-08-24 16:43:07 +00:00
@c snarfed from srcprop.c:193
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} source-property obj key
@deffnx {C Function} scm_source_property (obj, key)
2001-11-11 15:01:52 +00:00
Return the source property specified by @var{key} from
@var{obj}'s source property list.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
set-source-property!
2004-08-24 16:43:07 +00:00
@c snarfed from srcprop.c:224
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-source-property! obj key datum
@deffnx {C Function} scm_set_source_property_x (obj, key, datum)
2001-11-11 15:01:52 +00:00
Set the source property of object @var{obj}, which is specified by
@var{key} to @var{datum}. Normally, the key will be a symbol.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
stack?
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:384
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} stack? obj
@deffnx {C Function} scm_stack_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a calling stack.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
make-stack
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:415
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-stack obj . args
@deffnx {C Function} scm_make_stack (obj, args)
2001-11-11 15:01:52 +00:00
Create a new stack. If @var{obj} is @code{#t}, the current
evaluation stack is used for creating the stack frames,
otherwise the frames are taken from @var{obj} (which must be
either a debug object or a continuation).
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@var{args} should be a list containing any combination of
integer, procedure and @code{#t} values.
These values specify various ways of cutting away uninteresting
stack frames from the top and bottom of the stack that
@code{make-stack} returns. They come in pairs like this:
@code{(@var{inner_cut_1} @var{outer_cut_1} @var{inner_cut_2}
@var{outer_cut_2} @dots{})}.
Each @var{inner_cut_N} can be @code{#t}, an integer, or a
procedure. @code{#t} means to cut away all frames up to but
excluding the first user module frame. An integer means to cut
away exactly that number of frames. A procedure means to cut
away all frames up to but excluding the application frame whose
procedure matches the specified one.
Each @var{outer_cut_N} can be an integer or a procedure. An
integer means to cut away that number of frames. A procedure
means to cut away frames down to but excluding the application
frame whose procedure matches the specified one.
If the @var{outer_cut_N} of the last pair is missing, it is
taken as 0.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
stack-id
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:507
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} stack-id stack
@deffnx {C Function} scm_stack_id (stack)
2001-11-11 15:01:52 +00:00
Return the identifier given to @var{stack} by @code{start-stack}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
stack-ref
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:548
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} stack-ref stack index
@deffnx {C Function} scm_stack_ref (stack, index)
2001-11-11 15:01:52 +00:00
Return the @var{index}'th frame from @var{stack}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
stack-length
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:561
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} stack-length stack
@deffnx {C Function} scm_stack_length (stack)
2001-11-11 15:01:52 +00:00
Return the length of @var{stack}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame?
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:574
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame? obj
@deffnx {C Function} scm_frame_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a stack frame.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
last-stack-frame
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:585
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} last-stack-frame obj
@deffnx {C Function} scm_last_stack_frame (obj)
2001-11-11 15:01:52 +00:00
Return a stack which consists of a single frame, which is the
last stack frame for @var{obj}. @var{obj} must be either a
debug object or a continuation.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-number
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:627
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-number frame
@deffnx {C Function} scm_frame_number (frame)
2001-11-11 15:01:52 +00:00
Return the frame number of @var{frame}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-source
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:637
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-source frame
@deffnx {C Function} scm_frame_source (frame)
2001-11-11 15:01:52 +00:00
Return the source of @var{frame}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-procedure
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:648
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-procedure frame
@deffnx {C Function} scm_frame_procedure (frame)
2001-11-11 15:01:52 +00:00
Return the procedure for @var{frame}, or @code{#f} if no
procedure is associated with @var{frame}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-arguments
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:660
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-arguments frame
@deffnx {C Function} scm_frame_arguments (frame)
2001-11-11 15:01:52 +00:00
Return the arguments of @var{frame}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-previous
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:671
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-previous frame
@deffnx {C Function} scm_frame_previous (frame)
2001-11-11 15:01:52 +00:00
Return the previous frame of @var{frame}, or @code{#f} if
@var{frame} is the first frame in its stack.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-next
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:687
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-next frame
@deffnx {C Function} scm_frame_next (frame)
2001-11-11 15:01:52 +00:00
Return the next frame of @var{frame}, or @code{#f} if
@var{frame} is the last frame in its stack.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-real?
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:702
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-real? frame
@deffnx {C Function} scm_frame_real_p (frame)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{frame} is a real frame.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-procedure?
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:712
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-procedure? frame
@deffnx {C Function} scm_frame_procedure_p (frame)
2001-11-11 15:01:52 +00:00
Return @code{#t} if a procedure is associated with @var{frame}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-evaluating-args?
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:722
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-evaluating-args? frame
@deffnx {C Function} scm_frame_evaluating_args_p (frame)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{frame} contains evaluated arguments.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
frame-overflow?
2004-08-24 16:43:07 +00:00
@c snarfed from stacks.c:732
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} frame-overflow? frame
@deffnx {C Function} scm_frame_overflow_p (frame)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{frame} is an overflow frame.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
get-internal-real-time
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:117
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} get-internal-real-time
@deffnx {C Function} scm_get_internal_real_time ()
2001-11-11 15:01:52 +00:00
Return the number of time units since the interpreter was
started.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
times
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:164
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} times
@deffnx {C Function} scm_times ()
2001-11-11 15:01:52 +00:00
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:
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
@table @code
@item tms:clock
The current real time, expressed as time units relative to an
arbitrary base.
@item tms:utime
The CPU time units used by the calling process.
@item tms:stime
The CPU time units used by the system on behalf of the calling
process.
@item tms:cutime
The CPU time units used by terminated child processes of the
calling process, whose status has been collected (e.g., using
@code{waitpid}).
@item tms:cstime
Similarly, the CPU times units used by the system on behalf of
terminated child processes.
@end table
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
get-internal-run-time
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:196
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} get-internal-run-time
@deffnx {C Function} scm_get_internal_run_time ()
2001-11-11 15:01:52 +00:00
Return the number of time units of processor time used by the
interpreter. Both @emph{system} and @emph{user} time are
included but subprocesses are not.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
current-time
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:213
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} current-time
@deffnx {C Function} scm_current_time ()
2001-11-11 15:01:52 +00:00
Return the number of seconds since 1970-01-01 00:00:00 UTC,
excluding leap seconds.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
gettimeofday
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:231
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} gettimeofday
@deffnx {C Function} scm_gettimeofday ()
2001-11-11 15:01:52 +00:00
Return a pair containing the number of seconds and microseconds
since 1970-01-01 00:00:00 UTC, excluding leap seconds. Note:
whether true microsecond resolution is available depends on the
operating system.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
localtime
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:335
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} localtime time [zone]
@deffnx {C Function} scm_localtime (time, zone)
2001-11-11 15:01:52 +00:00
Return an object representing the broken down components of
@var{time}, an integer like the one returned by
@code{current-time}. The time zone for the calculation is
optionally specified by @var{zone} (a string), otherwise the
@code{TZ} environment variable or the system default is used.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
gmtime
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:420
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} gmtime time
@deffnx {C Function} scm_gmtime (time)
2001-11-11 15:01:52 +00:00
Return an object representing the broken down components of
@var{time}, an integer like the one returned by
@code{current-time}. The values are calculated for UTC.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
mktime
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:498
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} mktime sbd_time [zone]
@deffnx {C Function} scm_mktime (sbd_time, zone)
2001-11-11 15:01:52 +00:00
@var{bd-time} is an object representing broken down time and @code{zone}
is an optional time zone specifier (otherwise the TZ environment variable
or the system default is used).
Returns a pair: the car is a corresponding
integer time value like that returned
by @code{current-time}; the cdr is a broken down time object, similar to
as @var{bd-time} but with normalized values.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
tzset
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:581
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} tzset
@deffnx {C Function} scm_tzset ()
2001-11-11 15:01:52 +00:00
Initialize the timezone from the TZ environment variable
or the system default. It's not usually necessary to call this procedure
since it's done automatically by other procedures that depend on the
timezone.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
strftime
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:598
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} strftime format stime
@deffnx {C Function} scm_strftime (format, stime)
2001-11-11 15:01:52 +00:00
Formats a time specification @var{time} using @var{template}. @var{time}
is an object with time components in the form returned by @code{localtime}
or @code{gmtime}. @var{template} is a string which can include formatting
specifications introduced by a @code{%} character. The formatting of
month and day names is dependent on the current locale. The value returned
is the formatted string.
@xref{Formatting Date and Time, , , libc, The GNU C Library Reference Manual}.)
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
strptime
2004-08-24 16:43:07 +00:00
@c snarfed from stime.c:696
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} strptime format string
@deffnx {C Function} scm_strptime (format, string)
2001-11-11 15:01:52 +00:00
Performs the reverse action to @code{strftime}, parsing
@var{string} according to the specification supplied in
@var{template}. The interpretation of month and day names is
dependent on the current locale. The value returned is a pair.
The car has an object with time components
in the form returned by @code{localtime} or @code{gmtime},
but the time zone components
are not usefully set.
The cdr reports the number of characters from @var{string}
which were used for the conversion.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string?
2004-08-24 16:43:07 +00:00
@c snarfed from strings.c:481
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string? obj
@deffnx {C Function} scm_string_p (obj)
2002-03-15 14:03:53 +00:00
Return @code{#t} if @var{obj} is a string, else @code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
list->string
2004-08-24 16:43:07 +00:00
@c snarfed from strings.c:489
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list->string
2001-11-11 15:01:52 +00:00
implemented by the C function "scm_string"
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string
2004-08-24 16:43:07 +00:00
@c snarfed from strings.c:495
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string . chrs
@deffnx {Scheme Procedure} list->string chrs
@deffnx {C Function} scm_string (chrs)
2001-11-11 15:01:52 +00:00
Return a newly allocated string composed of the arguments,
@var{chrs}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
make-string
2004-08-24 16:43:07 +00:00
@c snarfed from strings.c:533
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-string k [chr]
@deffnx {C Function} scm_make_string (k, chr)
2001-11-11 15:01:52 +00:00
Return a newly allocated string of
length @var{k}. If @var{chr} is given, then all elements of
the string are initialized to @var{chr}, otherwise the contents
of the @var{string} are unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-length
2004-08-24 16:43:07 +00:00
@c snarfed from strings.c:559
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-length string
@deffnx {C Function} scm_string_length (string)
2001-11-11 15:01:52 +00:00
Return the number of characters in @var{string}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-ref
2004-08-24 16:43:07 +00:00
@c snarfed from strings.c:578
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-ref str k
@deffnx {C Function} scm_string_ref (str, k)
2001-11-11 15:01:52 +00:00
Return character @var{k} of @var{str} using zero-origin
indexing. @var{k} must be a valid index of @var{str}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-set!
2004-08-24 16:43:07 +00:00
@c snarfed from strings.c:601
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-set! str k chr
@deffnx {C Function} scm_string_set_x (str, k, chr)
2001-11-11 15:01:52 +00:00
Store @var{chr} in element @var{k} of @var{str} and return
an unspecified value. @var{k} must be a valid index of
@var{str}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
substring
2004-08-24 16:43:07 +00:00
@c snarfed from strings.c:637
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} substring str start [end]
@deffnx {C Function} scm_substring (str, start, end)
2001-11-11 15:01:52 +00:00
Return a newly allocated string formed from the characters
of @var{str} beginning with index @var{start} (inclusive) and
ending with index @var{end} (exclusive).
@var{str} must be a string, @var{start} and @var{end} must be
exact integers satisfying:
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
0 <= @var{start} <= @var{end} <= (string-length @var{str}).
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
substring/copy
@c snarfed from strings.c:660
@deffn {Scheme Procedure} substring/copy str start [end]
@deffnx {C Function} scm_substring_copy (str, start, end)
Return a newly allocated string formed from the characters
of @var{str} beginning with index @var{start} (inclusive) and
ending with index @var{end} (exclusive).
@var{str} must be a string, @var{start} and @var{end} must be
exact integers satisfying:
0 <= @var{start} <= @var{end} <= (string-length @var{str}).
@end deffn
substring/shared
@c snarfed from strings.c:683
@deffn {Scheme Procedure} substring/shared str start [end]
@deffnx {C Function} scm_substring_shared (str, start, end)
Return string that indirectly refers to the characters
of @var{str} beginning with index @var{start} (inclusive) and
ending with index @var{end} (exclusive).
@var{str} must be a string, @var{start} and @var{end} must be
exact integers satisfying:
0 <= @var{start} <= @var{end} <= (string-length @var{str}).
@end deffn
2001-11-11 15:01:52 +00:00
string-append
2004-08-24 16:43:07 +00:00
@c snarfed from strings.c:702
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-append . args
@deffnx {C Function} scm_string_append (args)
2001-11-11 15:01:52 +00:00
Return a newly allocated string whose characters form the
concatenation of the given strings, @var{args}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-index
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:113
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-index str chr [frm [to]]
@deffnx {C Function} scm_string_index (str, chr, frm, to)
2001-11-11 15:01:52 +00:00
Return the index of the first occurrence of @var{chr} in
@var{str}. The optional integer arguments @var{frm} and
@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.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(string-index "weiner" #\e)
@result{} 1
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(string-index "weiner" #\e 2)
@result{} 4
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(string-index "weiner" #\e 2 4)
@result{} #f
@end lisp
@end deffn
string-rindex
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:143
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-rindex str chr [frm [to]]
@deffnx {C Function} scm_string_rindex (str, chr, frm, to)
2001-11-11 15:01:52 +00:00
Like @code{string-index}, but search from the right of the
string rather than from the left. This procedure essentially
implements the @code{rindex} or @code{strrchr} functions from
the C library.
2001-03-23 15:05:40 +00:00
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(string-rindex "weiner" #\e)
@result{} 4
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(string-rindex "weiner" #\e 2 4)
@result{} #f
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(string-rindex "weiner" #\e 2 5)
@result{} 4
@end lisp
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
substring-move!
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:163
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} substring-move! str1 start1 end1 str2 start2
@deffnx {C Function} scm_substring_move_x (str1, start1, end1, str2, start2)
2001-11-11 15:01:52 +00:00
Copy the substring of @var{str1} bounded by @var{start1} and @var{end1}
into @var{str2} beginning at position @var{start2}.
2001-11-16 15:04:17 +00:00
@var{str1} and @var{str2} can be the same string.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
substring-fill!
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:198
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} substring-fill! str start end fill
@deffnx {C Function} scm_substring_fill_x (str, start, end, fill)
2001-11-11 15:01:52 +00:00
Change every character in @var{str} between @var{start} and
@var{end} to @var{fill}.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(define y "abcdefg")
(substring-fill! y 1 3 #\r)
y
@result{} "arrdefg"
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-null?
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:227
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-null? str
@deffnx {C Function} scm_string_null_p (str)
2001-11-13 00:35:47 +00:00
Return @code{#t} if @var{str}'s length is zero, and
2001-11-11 15:01:52 +00:00
@code{#f} otherwise.
@lisp
(string-null? "") @result{} #t
y @result{} "foo"
(string-null? y) @result{} #f
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string->list
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:241
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string->list str
@deffnx {C Function} scm_string_to_list (str)
2001-11-11 15:01:52 +00:00
Return a newly allocated list of the characters that make up
the given string @var{str}. @code{string->list} and
@code{list->string} are inverses as far as @samp{equal?} is
concerned.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-copy
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:274
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-copy str
@deffnx {C Function} scm_string_copy (str)
2001-11-11 15:01:52 +00:00
Return a newly allocated copy of the given @var{string}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-fill!
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:285
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-fill! str chr
@deffnx {C Function} scm_string_fill_x (str, chr)
2001-11-11 15:01:52 +00:00
Store @var{char} in every element of the given @var{string} and
return an unspecified value.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-upcase!
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:327
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-upcase! str
@deffnx {C Function} scm_string_upcase_x (str)
2001-11-11 15:01:52 +00:00
Destructively upcase every character in @var{str} and return
@var{str}.
@lisp
y @result{} "arrdefg"
(string-upcase! y) @result{} "ARRDEFG"
y @result{} "ARRDEFG"
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-upcase
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:340
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-upcase str
@deffnx {C Function} scm_string_upcase (str)
2001-11-11 15:01:52 +00:00
Return a freshly allocated string containing the characters of
@var{str} in upper case.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-downcase!
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:376
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-downcase! str
@deffnx {C Function} scm_string_downcase_x (str)
2001-11-11 15:01:52 +00:00
Destructively downcase every character in @var{str} and return
@var{str}.
@lisp
y @result{} "ARRDEFG"
(string-downcase! y) @result{} "arrdefg"
y @result{} "arrdefg"
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-downcase
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:389
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-downcase str
@deffnx {C Function} scm_string_downcase (str)
2001-11-11 15:01:52 +00:00
Return a freshly allocation string containing the characters in
@var{str} in lower case.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-capitalize!
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:441
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-capitalize! str
@deffnx {C Function} scm_string_capitalize_x (str)
2001-11-11 15:01:52 +00:00
Upcase the first character of every word in @var{str}
destructively and return @var{str}.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
y @result{} "hello world"
(string-capitalize! y) @result{} "Hello World"
y @result{} "Hello World"
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-capitalize
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:455
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-capitalize str
@deffnx {C Function} scm_string_capitalize (str)
2001-11-11 15:01:52 +00:00
Return a freshly allocated string with the characters in
@var{str}, where the first character of every word is
capitalized.
* 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'.
2001-05-04 21:54:00 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-split
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:484
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-split str chr
@deffnx {C Function} scm_string_split (str, chr)
2001-11-11 15:01:52 +00:00
Split the string @var{str} into the a list of the substrings delimited
by appearances of the character @var{chr}. Note that an empty substring
between separator characters will result in an empty string in the
result list.
* 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'.
2001-05-04 21:54:00 +00:00
@lisp
2001-11-16 15:04:17 +00:00
(string-split "root:x:0:0:root:/root:/bin/bash" #\:)
2001-11-11 15:01:52 +00:00
@result{}
("root" "x" "0" "0" "root" "/root" "/bin/bash")
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-16 15:04:17 +00:00
(string-split "::" #\:)
2001-11-11 15:01:52 +00:00
@result{}
("" "" "")
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-16 15:04:17 +00:00
(string-split "" #\:)
2001-11-11 15:01:52 +00:00
@result{}
("")
* 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'.
2001-05-04 21:54:00 +00:00
@end lisp
@end deffn
2001-11-11 15:01:52 +00:00
string-ci->symbol
2004-08-24 16:43:07 +00:00
@c snarfed from strop.c:520
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-ci->symbol str
@deffnx {C Function} scm_string_ci_to_symbol (str)
2001-11-11 15:01:52 +00:00
Return the symbol whose name is @var{str}. @var{str} is
converted to lowercase before the conversion is done, if Guile
2001-11-16 15:04:17 +00:00
is currently reading symbols case-insensitively.
2001-11-11 15:01:52 +00:00
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
string=?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:38
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string=? s1 s2
2001-11-11 15:01:52 +00:00
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
characters.
* 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'.
2001-05-04 21:54:00 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-ci=?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:77
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-ci=? s1 s2
2001-11-11 15:01:52 +00:00
Case-insensitive string equality predicate; return @code{#t} if
the two strings are the same length and their component
characters match (ignoring case) at each position; otherwise
return @code{#f}.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
string<?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:140
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string<? s1 s2
2001-11-11 15:01:52 +00:00
Lexicographic ordering predicate; return @code{#t} if @var{s1}
is lexicographically less than @var{s2}.
* 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'.
2001-05-04 21:54:00 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string<=?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:154
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string<=? s1 s2
2001-11-11 15:01:52 +00:00
Lexicographic ordering predicate; return @code{#t} if @var{s1}
is lexicographically less than or equal to @var{s2}.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
string>?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:168
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string>? s1 s2
2001-11-11 15:01:52 +00:00
Lexicographic ordering predicate; return @code{#t} if @var{s1}
is lexicographically greater than @var{s2}.
* 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'.
2001-05-04 21:54:00 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string>=?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:182
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string>=? s1 s2
2001-11-11 15:01:52 +00:00
Lexicographic ordering predicate; return @code{#t} if @var{s1}
is lexicographically greater than or equal to @var{s2}.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
string-ci<?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:223
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-ci<? s1 s2
2001-11-11 15:01:52 +00:00
Case insensitive lexicographic ordering predicate; return
@code{#t} if @var{s1} is lexicographically less than @var{s2}
regardless of case.
* 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'.
2001-05-04 21:54:00 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-ci<=?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:238
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-ci<=? s1 s2
2001-11-11 15:01:52 +00:00
Case insensitive lexicographic ordering predicate; return
@code{#t} if @var{s1} is lexicographically less than or equal
to @var{s2} regardless of case.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
string-ci>?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:253
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-ci>? s1 s2
2001-11-11 15:01:52 +00:00
Case insensitive lexicographic ordering predicate; return
@code{#t} if @var{s1} is lexicographically greater than
@var{s2} regardless of case.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
string-ci>=?
2004-08-24 16:43:07 +00:00
@c snarfed from strorder.c:268
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string-ci>=? s1 s2
2001-11-11 15:01:52 +00:00
Case insensitive lexicographic ordering predicate; return
@code{#t} if @var{s1} is lexicographically greater than or
equal to @var{s2} regardless of case.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
object->string
2004-08-24 16:43:07 +00:00
@c snarfed from strports.c:332
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} object->string obj [printer]
@deffnx {C Function} scm_object_to_string (obj, printer)
2001-11-11 15:01:52 +00:00
Return a Scheme string obtained by printing @var{obj}.
Printing function can be specified by the optional second
argument @var{printer} (default: @code{write}).
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
call-with-output-string
2004-08-24 16:43:07 +00:00
@c snarfed from strports.c:356
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} call-with-output-string proc
@deffnx {C Function} scm_call_with_output_string (proc)
2001-11-11 15:01:52 +00:00
Calls the one-argument procedure @var{proc} with a newly created output
port. When the function returns, the string composed of the characters
written into the port is returned.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
call-with-input-string
2004-08-24 16:43:07 +00:00
@c snarfed from strports.c:375
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} call-with-input-string string proc
@deffnx {C Function} scm_call_with_input_string (string, proc)
2001-11-11 15:01:52 +00:00
Calls the one-argument procedure @var{proc} with a newly
created input port from which @var{string}'s contents may be
read. The value yielded by the @var{proc} is returned.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
open-input-string
2004-08-24 16:43:07 +00:00
@c snarfed from strports.c:388
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} open-input-string str
@deffnx {C Function} scm_open_input_string (str)
2001-11-11 15:01:52 +00:00
Take a string and return an input port that delivers characters
from the string. The port can be closed by
@code{close-input-port}, though its storage will be reclaimed
by the garbage collector if it becomes inaccessible.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
open-output-string
2004-08-24 16:43:07 +00:00
@c snarfed from strports.c:402
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} open-output-string
@deffnx {C Function} scm_open_output_string ()
2001-11-11 15:01:52 +00:00
Return an output port that will accumulate characters for
retrieval by @code{get-output-string}. The port can be closed
by the procedure @code{close-output-port}, though its storage
will be reclaimed by the garbage collector if it becomes
inaccessible.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
get-output-string
2004-08-24 16:43:07 +00:00
@c snarfed from strports.c:419
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} get-output-string port
@deffnx {C Function} scm_get_output_string (port)
2001-11-11 15:01:52 +00:00
Given an output port created by @code{open-output-string},
return a string consisting of the characters that have been
output to the port so far.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
eval-string
2004-08-24 16:43:07 +00:00
@c snarfed from strports.c:488
2002-10-19 16:33:25 +00:00
@deffn {Scheme Procedure} eval-string string [module]
@deffnx {C Function} scm_eval_string_in_module (string, module)
2001-11-11 15:01:52 +00:00
Evaluate @var{string} as the text representation of a Scheme
form or forms, and return whatever value they produce.
2002-10-19 16:33:25 +00:00
Evaluation takes place in the given module, or the current
module when no module is given.
While the code is evaluated, the given module is made the
current one. The current module is restored when this
procedure returns.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
make-struct-layout
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:55
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-struct-layout fields
@deffnx {C Function} scm_make_struct_layout (fields)
2001-11-11 15:01:52 +00:00
Return a new structure layout object.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@var{fields} must be a string made up of pairs of characters
strung together. The first character of each pair describes a field
type, the second a field protection. Allowed types are 'p' for
GC-protected Scheme data, 'u' for unprotected binary data, and 's' for
a field that points to the structure itself. Allowed protections
are 'w' for mutable fields, 'r' for read-only fields, and 'o' for opaque
fields. The last field protection specification may be capitalized to
indicate that the field is a tail-array.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
struct?
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:222
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} struct? x
@deffnx {C Function} scm_struct_p (x)
2001-11-13 00:35:47 +00:00
Return @code{#t} iff @var{x} is a structure object, else
2001-11-11 15:01:52 +00:00
@code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
struct-vtable?
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:231
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} struct-vtable? x
@deffnx {C Function} scm_struct_vtable_p (x)
2001-11-13 00:35:47 +00:00
Return @code{#t} iff @var{x} is a vtable structure.
2001-11-11 15:01:52 +00:00
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
make-struct
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:417
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-struct vtable tail_array_size . init
@deffnx {C Function} scm_make_struct (vtable, tail_array_size, init)
2001-11-11 15:01:52 +00:00
Create a new structure.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@var{type} must be a vtable structure (@pxref{Vtables}).
2001-04-22 16:34:28 +00:00
2001-11-11 15:01:52 +00:00
@var{tail-elts} must be a non-negative integer. If the layout
specification indicated by @var{type} includes a tail-array,
this is the number of elements allocated to that array.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The @var{init1}, @dots{} are optional arguments describing how
successive fields of the structure should be initialized. Only fields
with protection 'r' or 'w' can be initialized, except for fields of
type 's', which are automatically initialized to point to the new
structure itself; fields with protection 'o' can not be initialized by
Scheme programs.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
If fewer optional arguments than initializable fields are supplied,
fields of type 'p' get default value #f while fields of type 'u' are
initialized to 0.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
Structs are currently the basic representation for record-like data
structures in Guile. The plan is to eventually replace them with a
new representation which will at the same time be easier to use and
more powerful.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
For more information, see the documentation for @code{make-vtable-vtable}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
make-vtable-vtable
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:501
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-vtable-vtable user_fields tail_array_size . init
@deffnx {C Function} scm_make_vtable_vtable (user_fields, tail_array_size, init)
2001-11-11 15:01:52 +00:00
Return a new, self-describing vtable structure.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@var{user-fields} is a string describing user defined fields of the
vtable beginning at index @code{vtable-offset-user}
(see @code{make-struct-layout}).
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@var{tail-size} specifies the size of the tail-array (if any) of
this vtable.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@var{init1}, @dots{} are the optional initializers for the fields of
the vtable.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
Vtables have one initializable system field---the struct printer.
This field comes before the user fields in the initializers passed
to @code{make-vtable-vtable} and @code{make-struct}, and thus works as
a third optional argument to @code{make-vtable-vtable} and a fourth to
@code{make-struct} when creating vtables:
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
If the value is a procedure, it will be called instead of the standard
printer whenever a struct described by this vtable is printed.
The procedure will be called with arguments STRUCT and PORT.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The structure of a struct is described by a vtable, so the vtable is
in essence the type of the struct. The vtable is itself a struct with
a vtable. This could go on forever if it weren't for the
vtable-vtables which are self-describing vtables, and thus terminate
the chain.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
There are several potential ways of using structs, but the standard
one is to use three kinds of structs, together building up a type
sub-system: one vtable-vtable working as the root and one or several
"types", each with a set of "instances". (The vtable-vtable should be
compared to the class <class> which is the class of itself.)
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(define ball-root (make-vtable-vtable "pr" 0))
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(define (make-ball-type ball-color)
(make-struct ball-root 0
(make-struct-layout "pw")
(lambda (ball port)
(format port "#<a ~A ball owned by ~A>"
(color ball)
(owner ball)))
ball-color))
(define (color ball) (struct-ref (struct-vtable ball) vtable-offset-user))
(define (owner ball) (struct-ref ball 0))
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(define red (make-ball-type 'red))
(define green (make-ball-type 'green))
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(define (make-ball type owner) (make-struct type 0 owner))
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
(define ball (make-ball green 'Nisse))
ball @result{} #<a green ball owned by Nisse>
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
struct-ref
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:541
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} struct-ref handle pos
@deffnx {Scheme Procedure} struct-set! struct n value
@deffnx {C Function} scm_struct_ref (handle, pos)
2001-11-11 15:01:52 +00:00
Access (or modify) the @var{n}th field of @var{struct}.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
If the field is of type 'p', then it can be set to an arbitrary value.
If the field is of type 'u', then it can only be set to a non-negative
integer value small enough to fit in one machine word.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
struct-set!
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:620
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} struct-set! handle pos val
@deffnx {C Function} scm_struct_set_x (handle, pos, val)
2001-11-11 15:01:52 +00:00
Set the slot of the structure @var{handle} with index @var{pos}
to @var{val}. Signal an error if the slot can not be written
to.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
struct-vtable
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:691
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} struct-vtable handle
@deffnx {C Function} scm_struct_vtable (handle)
2001-11-11 15:01:52 +00:00
Return the vtable structure that describes the type of @var{struct}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
struct-vtable-tag
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:702
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} struct-vtable-tag handle
@deffnx {C Function} scm_struct_vtable_tag (handle)
2001-11-11 15:01:52 +00:00
Return the vtable tag of the structure @var{handle}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
struct-vtable-name
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:741
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} struct-vtable-name vtable
@deffnx {C Function} scm_struct_vtable_name (vtable)
2001-11-11 15:01:52 +00:00
Return the name of the vtable @var{vtable}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
set-struct-vtable-name!
2004-08-24 16:43:07 +00:00
@c snarfed from struct.c:751
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} set-struct-vtable-name! vtable name
@deffnx {C Function} scm_set_struct_vtable_name_x (vtable, name)
2001-11-11 15:01:52 +00:00
Set the name of the vtable @var{vtable} to @var{name}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
symbol?
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:156
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} symbol? obj
@deffnx {C Function} scm_symbol_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a symbol, otherwise return
@code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
2002-03-12 21:54:22 +00:00
symbol-interned?
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:166
2002-03-12 21:54:22 +00:00
@deffn {Scheme Procedure} symbol-interned? symbol
@deffnx {C Function} scm_symbol_interned_p (symbol)
Return @code{#t} if @var{symbol} is interned, otherwise return
@code{#f}.
@end deffn
make-symbol
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:178
2002-03-12 21:54:22 +00:00
@deffn {Scheme Procedure} make-symbol name
@deffnx {C Function} scm_make_symbol (name)
Return a new uninterned symbol with the name @var{name}. The returned symbol is guaranteed to be unique and future calls to @code{string->symbol} will not return it.
@end deffn
2001-11-11 15:01:52 +00:00
symbol->string
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:210
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} symbol->string s
@deffnx {C Function} scm_symbol_to_string (s)
2001-11-11 15:01:52 +00:00
Return the name of @var{symbol} as a string. If the symbol was
part of an object returned as the value of a literal expression
(section @pxref{Literal expressions,,,r5rs, The Revised^5
Report on Scheme}) or by a call to the @code{read} procedure,
and its name contains alphabetic characters, then the string
returned will contain characters in the implementation's
preferred standard case---some implementations will prefer
upper case, others lower case. If the symbol was returned by
@code{string->symbol}, the case of characters in the string
returned will be the same as the case in the string that was
passed to @code{string->symbol}. It is an error to apply
mutation procedures like @code{string-set!} to strings returned
by this procedure.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
The following examples assume that the implementation's
standard case is lower case:
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(symbol->string 'flying-fish) @result{} "flying-fish"
(symbol->string 'Martin) @result{} "martin"
(symbol->string
(string->symbol "Malvina")) @result{} "Malvina"
@end lisp
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
string->symbol
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:240
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} string->symbol string
@deffnx {C Function} scm_string_to_symbol (string)
2001-11-11 15:01:52 +00:00
Return the symbol whose name is @var{string}. This procedure
can create symbols with names containing special characters or
letters in the non-standard case, but it is usually a bad idea
to create such symbols because in some implementations of
Scheme they cannot be read as themselves. See
@code{symbol->string}.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
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"}
(eq? 'bitBlt (string->symbol "bitBlt")) @result{} #f
(eq? 'JollyWog
(string->symbol (symbol->string 'JollyWog))) @result{} #t
(string=? "K. Harper, M.D."
(symbol->string
(string->symbol "K. Harper, M.D."))) @result{}#t
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
gensym
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:256
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} gensym [prefix]
@deffnx {C Function} scm_gensym (prefix)
2001-11-11 15:01:52 +00:00
Create a new symbol with a name constructed from a prefix and
a counter value. The string @var{prefix} can be specified as
2002-03-12 21:54:22 +00:00
an optional argument. Default prefix is @code{ g}. The counter
2001-11-11 15:01:52 +00:00
is increased by 1 at each call. There is no provision for
resetting the counter.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
symbol-hash
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:282
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} symbol-hash symbol
@deffnx {C Function} scm_symbol_hash (symbol)
2001-11-11 15:01:52 +00:00
Return a hash value for @var{symbol}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
symbol-fref
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:292
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} symbol-fref s
@deffnx {C Function} scm_symbol_fref (s)
2001-11-11 15:01:52 +00:00
Return the contents of @var{symbol}'s @dfn{function slot}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
symbol-pref
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:303
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} symbol-pref s
@deffnx {C Function} scm_symbol_pref (s)
2001-11-11 15:01:52 +00:00
Return the @dfn{property list} currently associated with @var{symbol}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
symbol-fset!
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:314
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} symbol-fset! s val
@deffnx {C Function} scm_symbol_fset_x (s, val)
2001-11-11 15:01:52 +00:00
Change the binding of @var{symbol}'s function slot.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
symbol-pset!
2004-08-24 16:43:07 +00:00
@c snarfed from symbols.c:326
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} symbol-pset! s val
@deffnx {C Function} scm_symbol_pset_x (s, val)
2001-11-11 15:01:52 +00:00
Change the binding of @var{symbol}'s property slot.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
call-with-new-thread
@c snarfed from threads.c:428
@deffn {Scheme Procedure} call-with-new-thread thunk handler
@deffnx {C Function} scm_call_with_new_thread (thunk, handler)
Evaluate @code{(@var{thunk})} in a new thread, and new dynamic context, returning a new thread object representing the thread. If an error occurs during evaluation, call error-thunk, passing it an error code describing the condition. If this happens, the error-thunk is called outside the scope of the new root -- it is called in the same dynamic context in which with-new-thread was evaluated, but not in the callers thread. All the evaluation rules for dynamic roots apply to threads.
@end deffn
yield
@c snarfed from threads.c:443
@deffn {Scheme Procedure} yield
@deffnx {C Function} scm_yield ()
Move the calling thread to the end of the scheduling queue.
@end deffn
join-thread
@c snarfed from threads.c:453
@deffn {Scheme Procedure} join-thread thread
@deffnx {C Function} scm_join_thread (thread)
Suspend execution of the calling thread until the target @var{thread} terminates, unless the target @var{thread} has already terminated.
@end deffn
make-fair-mutex
@c snarfed from threads.c:508
@deffn {Scheme Procedure} make-fair-mutex
@deffnx {C Function} scm_make_fair_mutex ()
Create a new fair mutex object.
@end deffn
make-fair-condition-variable
@c snarfed from threads.c:628
@deffn {Scheme Procedure} make-fair-condition-variable
@deffnx {C Function} scm_make_fair_condition_variable ()
Make a new fair condition variable.
@end deffn
make-mutex
@c snarfed from threads.c:691
@deffn {Scheme Procedure} make-mutex
@deffnx {C Function} scm_make_mutex ()
Create a new mutex object.
@end deffn
lock-mutex
@c snarfed from threads.c:707
@deffn {Scheme Procedure} lock-mutex mx
@deffnx {C Function} scm_lock_mutex (mx)
Lock @var{mutex}. If the mutex is already locked, the calling thread blocks until the mutex becomes available. The function returns when the calling thread owns the lock on @var{mutex}. Locking a mutex that a thread already owns will succeed right away and will not block the thread. That is, Guile's mutexes are @emph{recursive}.
@end deffn
try-mutex
@c snarfed from threads.c:733
@deffn {Scheme Procedure} try-mutex mx
@deffnx {C Function} scm_try_mutex (mx)
Try to lock @var{mutex}. If the mutex is already locked by someone else, return @code{#f}. Else lock the mutex and return @code{#t}.
@end deffn
unlock-mutex
@c snarfed from threads.c:768
@deffn {Scheme Procedure} unlock-mutex mx
@deffnx {C Function} scm_unlock_mutex (mx)
Unlocks @var{mutex} if the calling thread owns the lock on @var{mutex}. Calling unlock-mutex on a mutex not owned by the current thread results in undefined behaviour. Once a mutex has been unlocked, one thread blocked on @var{mutex} is awakened and grabs the mutex lock. Every call to @code{lock-mutex} by this thread must be matched with a call to @code{unlock-mutex}. Only the last call to @code{unlock-mutex} will actually unlock the mutex.
@end deffn
make-condition-variable
@c snarfed from threads.c:808
@deffn {Scheme Procedure} make-condition-variable
@deffnx {C Function} scm_make_condition_variable ()
Make a new condition variable.
@end deffn
wait-condition-variable
@c snarfed from threads.c:827
@deffn {Scheme Procedure} wait-condition-variable cv mx [t]
@deffnx {C Function} scm_timed_wait_condition_variable (cv, mx, t)
Wait until @var{cond-var} has been signalled. While waiting, @var{mutex} is atomically unlocked (as with @code{unlock-mutex}) and is locked again when this function returns. When @var{time} is given, it specifies a point in time where the waiting should be aborted. It can be either a integer as returned by @code{current-time} or a pair as returned by @code{gettimeofday}. When the waiting is aborted the mutex is locked and @code{#f} is returned. When the condition variable is in fact signalled, the mutex is also locked and @code{#t} is returned.
@end deffn
signal-condition-variable
@c snarfed from threads.c:884
@deffn {Scheme Procedure} signal-condition-variable cv
@deffnx {C Function} scm_signal_condition_variable (cv)
Wake up one thread that is waiting for @var{cv}
@end deffn
broadcast-condition-variable
@c snarfed from threads.c:901
@deffn {Scheme Procedure} broadcast-condition-variable cv
@deffnx {C Function} scm_broadcast_condition_variable (cv)
Wake up all threads that are waiting for @var{cv}.
@end deffn
current-thread
@c snarfed from threads.c:1103
@deffn {Scheme Procedure} current-thread
@deffnx {C Function} scm_current_thread ()
Return the thread that called this function.
@end deffn
all-threads
@c snarfed from threads.c:1112
@deffn {Scheme Procedure} all-threads
@deffnx {C Function} scm_all_threads ()
Return a list of all threads.
@end deffn
thread-exited?
@c snarfed from threads.c:1127
@deffn {Scheme Procedure} thread-exited? thread
@deffnx {C Function} scm_thread_exited_p (thread)
Return @code{#t} iff @var{thread} has exited.
@end deffn
2001-11-11 15:01:52 +00:00
catch
2004-08-24 16:43:07 +00:00
@c snarfed from throw.c:500
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} catch key thunk handler
@deffnx {C Function} scm_catch (key, thunk, handler)
2001-11-11 15:01:52 +00:00
Invoke @var{thunk} in the dynamic context of @var{handler} for
exceptions matching @var{key}. If thunk throws to the symbol
@var{key}, then @var{handler} is invoked this way:
@lisp
(handler key args ...)
@end lisp
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@var{key} is a symbol or @code{#t}.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@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}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
lazy-catch
2004-08-24 16:43:07 +00:00
@c snarfed from throw.c:528
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} lazy-catch key thunk handler
@deffnx {C Function} scm_lazy_catch (key, thunk, handler)
2001-11-11 15:01:52 +00:00
This behaves exactly like @code{catch}, except that it does
not unwind the stack before invoking @var{handler}.
The @var{handler} procedure is not allowed to return:
it must throw to another catch, or otherwise exit non-locally.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
throw
2004-08-24 16:43:07 +00:00
@c snarfed from throw.c:561
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} throw key . args
@deffnx {C Function} scm_throw (key, args)
2001-11-11 15:01:52 +00:00
Invoke the catch form matching @var{key}, passing @var{args} to the
@var{handler}.
@var{key} is a symbol. It will match catches of the same symbol or of
@code{#t}.
If there is no handler at all, Guile prints an error and then exits.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
values
2004-08-24 16:43:07 +00:00
@c snarfed from values.c:53
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} values . args
@deffnx {C Function} scm_values (args)
2001-11-11 15:01:52 +00:00
Delivers all of its arguments to its continuation. Except for
continuations created by the @code{call-with-values} procedure,
all continuations take exactly one value. The effect of
passing no value or more than one value to continuations that
were not created by @code{call-with-values} is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
make-variable
2004-08-24 16:43:07 +00:00
@c snarfed from variable.c:52
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-variable init
@deffnx {C Function} scm_make_variable (init)
2001-11-11 15:01:52 +00:00
Return a variable initialized to value @var{init}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
make-undefined-variable
2004-08-24 16:43:07 +00:00
@c snarfed from variable.c:62
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-undefined-variable
@deffnx {C Function} scm_make_undefined_variable ()
2001-11-11 15:01:52 +00:00
Return a variable that is initially unbound.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
variable?
2004-08-24 16:43:07 +00:00
@c snarfed from variable.c:73
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} variable? obj
@deffnx {C Function} scm_variable_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} iff @var{obj} is a variable object, else
return @code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
variable-ref
2004-08-24 16:43:07 +00:00
@c snarfed from variable.c:85
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} variable-ref var
@deffnx {C Function} scm_variable_ref (var)
2001-11-11 15:01:52 +00:00
Dereference @var{var} and return its value.
@var{var} must be a variable object; see @code{make-variable}
and @code{make-undefined-variable}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
variable-set!
2004-08-24 16:43:07 +00:00
@c snarfed from variable.c:101
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} variable-set! var val
@deffnx {C Function} scm_variable_set_x (var, val)
2001-11-11 15:01:52 +00:00
Set the value of the variable @var{var} to @var{val}.
@var{var} must be a variable object, @var{val} can be any
value. Return an unspecified value.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
variable-bound?
2004-08-24 16:43:07 +00:00
@c snarfed from variable.c:113
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} variable-bound? var
@deffnx {C Function} scm_variable_bound_p (var)
2001-11-11 15:01:52 +00:00
Return @code{#t} iff @var{var} is bound to a value.
Throws an error if @var{var} is not a variable object.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
vector?
2004-08-24 16:43:07 +00:00
@c snarfed from vectors.c:35
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} vector? obj
@deffnx {C Function} scm_vector_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a vector, otherwise return
@code{#f}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
list->vector
2004-08-24 16:43:07 +00:00
@c snarfed from vectors.c:52
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list->vector
2001-11-11 15:01:52 +00:00
implemented by the C function "scm_vector"
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
vector
2004-08-24 16:43:07 +00:00
@c snarfed from vectors.c:69
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} vector . l
@deffnx {Scheme Procedure} list->vector l
@deffnx {C Function} scm_vector (l)
Return a newly allocated vector composed of the
2001-11-11 15:01:52 +00:00
given arguments. Analogous to @code{list}.
@lisp
(vector 'a 'b 'c) @result{} #(a b c)
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
make-vector
2004-08-24 16:43:07 +00:00
@c snarfed from vectors.c:163
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-vector k [fill]
@deffnx {C Function} scm_make_vector (k, fill)
2001-11-11 15:01:52 +00:00
Return a newly allocated vector of @var{k} elements. If a
2001-11-16 15:04:17 +00:00
second argument is given, then each position is initialized to
@var{fill}. Otherwise the initial contents of each position is
2001-11-11 15:01:52 +00:00
unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
vector->list
2004-08-24 16:43:07 +00:00
@c snarfed from vectors.c:211
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} vector->list v
@deffnx {C Function} scm_vector_to_list (v)
Return a newly allocated list composed of the elements of @var{v}.
2001-11-11 15:01:52 +00:00
@lisp
(vector->list '#(dah dah didah)) @result{} (dah dah didah)
(list->vector '(dididit dah)) @result{} #(dididit dah)
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
vector-fill!
2004-08-24 16:43:07 +00:00
@c snarfed from vectors.c:228
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} vector-fill! v fill
@deffnx {C Function} scm_vector_fill_x (v, fill)
Store @var{fill} in every position of @var{vector}. The value
2001-11-11 15:01:52 +00:00
returned by @code{vector-fill!} is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
vector-move-left!
2004-08-24 16:43:07 +00:00
@c snarfed from vectors.c:260
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} vector-move-left! vec1 start1 end1 vec2 start2
@deffnx {C Function} scm_vector_move_left_x (vec1, start1, end1, vec2, start2)
2001-11-18 22:10:41 +00:00
Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
to @var{vec2} starting at position @var{start2}. @var{start1} and
@var{start2} are inclusive indices; @var{end1} is exclusive.
@code{vector-move-left!} copies elements in leftmost order.
Therefore, in the case where @var{vec1} and @var{vec2} refer to the
same vector, @code{vector-move-left!} is usually appropriate when
@var{start1} is greater than @var{start2}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
vector-move-right!
2004-08-24 16:43:07 +00:00
@c snarfed from vectors.c:290
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} vector-move-right! vec1 start1 end1 vec2 start2
@deffnx {C Function} scm_vector_move_right_x (vec1, start1, end1, vec2, start2)
2001-11-18 22:10:41 +00:00
Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
to @var{vec2} starting at position @var{start2}. @var{start1} and
@var{start2} are inclusive indices; @var{end1} is exclusive.
@code{vector-move-right!} copies elements in rightmost order.
Therefore, in the case where @var{vec1} and @var{vec2} refer to the
same vector, @code{vector-move-right!} is usually appropriate when
@var{start1} is less than @var{start2}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
major-version
2004-08-24 16:43:07 +00:00
@c snarfed from version.c:35
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} major-version
@deffnx {C Function} scm_major_version ()
2001-11-11 15:01:52 +00:00
Return a string containing Guile's major version number.
E.g., the 1 in "1.6.5".
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
minor-version
2004-08-24 16:43:07 +00:00
@c snarfed from version.c:48
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} minor-version
@deffnx {C Function} scm_minor_version ()
2001-11-11 15:01:52 +00:00
Return a string containing Guile's minor version number.
E.g., the 6 in "1.6.5".
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
micro-version
2004-08-24 16:43:07 +00:00
@c snarfed from version.c:61
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} micro-version
@deffnx {C Function} scm_micro_version ()
2001-11-11 15:01:52 +00:00
Return a string containing Guile's micro version number.
E.g., the 5 in "1.6.5".
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
version
2004-08-24 16:43:07 +00:00
@c snarfed from version.c:83
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} version
@deffnx {Scheme Procedure} major-version
@deffnx {Scheme Procedure} minor-version
@deffnx {Scheme Procedure} micro-version
@deffnx {C Function} scm_version ()
2001-11-13 23:44:29 +00:00
Return a string describing Guile's version number, or its major, minor
or micro version number, respectively.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
2001-11-13 23:44:29 +00:00
(version) @result{} "1.6.0"
2001-11-11 15:01:52 +00:00
(major-version) @result{} "1"
2001-11-13 23:44:29 +00:00
(minor-version) @result{} "6"
(micro-version) @result{} "0"
2001-11-11 15:01:52 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
effective-version
@c snarfed from version.c:113
@deffn {Scheme Procedure} effective-version
@deffnx {C Function} scm_effective_version ()
Return a string describing Guile's effective version number.
@lisp
(version) @result{} "1.6.0"
(effective-version) @result{} "1.6"
(major-version) @result{} "1"
(minor-version) @result{} "6"
(micro-version) @result{} "0"
@end lisp
@end deffn
2001-11-11 15:01:52 +00:00
make-soft-port
2004-08-24 16:43:07 +00:00
@c snarfed from vports.c:183
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-soft-port pv modes
@deffnx {C Function} scm_make_soft_port (pv, modes)
2001-11-11 15:01:52 +00:00
Return a port capable of receiving or delivering characters as
specified by the @var{modes} string (@pxref{File Ports,
2002-10-19 16:33:25 +00:00
open-file}). @var{pv} must be a vector of length 5 or 6. Its
2001-11-11 15:01:52 +00:00
components are as follows:
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@enumerate 0
@item
procedure accepting one character for output
@item
procedure accepting a string for output
@item
thunk for flushing output
@item
thunk for getting one character
@item
thunk for closing port (not by garbage collection)
2002-10-19 16:33:25 +00:00
@item
(if present and not @code{#f}) thunk for computing the number of
characters that can be read from the port without blocking.
2001-11-11 15:01:52 +00:00
@end enumerate
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
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.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
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:
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(define stdout (current-output-port))
(define p (make-soft-port
(vector
(lambda (c) (write c stdout))
(lambda (s) (display s stdout))
(lambda () (display "." stdout))
(lambda () (char-upcase (read-char)))
(lambda () (display "@@" stdout)))
"rw"))
(write p p) @result{} #<input-output: soft 8081e20>
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
make-weak-vector
2004-08-24 16:43:07 +00:00
@c snarfed from weaks.c:117
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-weak-vector size [fill]
@deffnx {C Function} scm_make_weak_vector (size, fill)
2001-11-11 15:01:52 +00:00
Return a weak vector with @var{size} elements. If the optional
argument @var{fill} is given, all entries in the vector will be
set to @var{fill}. The default value for @var{fill} is the
empty list.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
list->weak-vector
2004-08-24 16:43:07 +00:00
@c snarfed from weaks.c:125
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list->weak-vector
2001-11-11 15:01:52 +00:00
implemented by the C function "scm_weak_vector"
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
weak-vector
2004-08-24 16:43:07 +00:00
@c snarfed from weaks.c:133
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} weak-vector . l
@deffnx {Scheme Procedure} list->weak-vector l
@deffnx {C Function} scm_weak_vector (l)
2001-11-11 15:01:52 +00:00
Construct a weak vector from a list: @code{weak-vector} uses
the list of its arguments while @code{list->weak-vector} uses
its only argument @var{l} (a list) to construct a weak vector
the same way @code{list->vector} would.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
weak-vector?
2004-08-24 16:43:07 +00:00
@c snarfed from weaks.c:164
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} weak-vector? obj
@deffnx {C Function} scm_weak_vector_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a weak vector. Note that all
weak hashes are also weak vectors.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
make-weak-key-alist-vector
@c snarfed from weaks.c:182
@deffn {Scheme Procedure} make-weak-key-alist-vector [size]
@deffnx {Scheme Procedure} make-weak-value-alist-vector size
@deffnx {Scheme Procedure} make-doubly-weak-alist-vector size
@deffnx {C Function} scm_make_weak_key_alist_vector (size)
2001-11-11 15:01:52 +00:00
Return a weak hash table with @var{size} buckets. As with any
hash table, choosing a good size for the table requires some
caution.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
You can modify weak hash tables in exactly the same way you
would modify regular hash tables. (@pxref{Hash Tables})
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
make-weak-value-alist-vector
@c snarfed from weaks.c:194
@deffn {Scheme Procedure} make-weak-value-alist-vector [size]
@deffnx {C Function} scm_make_weak_value_alist_vector (size)
2001-11-11 15:01:52 +00:00
Return a hash table with weak values with @var{size} buckets.
(@pxref{Hash Tables})
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
make-doubly-weak-alist-vector
@c snarfed from weaks.c:206
@deffn {Scheme Procedure} make-doubly-weak-alist-vector size
@deffnx {C Function} scm_make_doubly_weak_alist_vector (size)
2001-11-11 15:01:52 +00:00
Return a hash table with weak keys and values with @var{size}
buckets. (@pxref{Hash Tables})
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
weak-key-alist-vector?
@c snarfed from weaks.c:221
@deffn {Scheme Procedure} weak-key-alist-vector? obj
@deffnx {Scheme Procedure} weak-value-alist-vector? obj
@deffnx {Scheme Procedure} doubly-weak-alist-vector? obj
@deffnx {C Function} scm_weak_key_alist_vector_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is the specified weak hash
table. Note that a doubly weak hash table is neither a weak key
nor a weak value hash table.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
weak-value-alist-vector?
@c snarfed from weaks.c:231
@deffn {Scheme Procedure} weak-value-alist-vector? obj
@deffnx {C Function} scm_weak_value_alist_vector_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a weak value hash table.
2001-03-23 15:05:40 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
doubly-weak-alist-vector?
@c snarfed from weaks.c:241
@deffn {Scheme Procedure} doubly-weak-alist-vector? obj
@deffnx {C Function} scm_doubly_weak_alist_vector_p (obj)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{obj} is a doubly weak hash table.
2001-03-23 15:05:40 +00:00
@end deffn
2002-08-10 14:09:55 +00:00
dynamic-link
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:149
2002-08-10 14:09:55 +00:00
@deffn {Scheme Procedure} dynamic-link filename
@deffnx {C Function} scm_dynamic_link (filename)
Find the shared object (shared library) denoted by
@var{filename} and link it into the running Guile
application. The returned
scheme object is a ``handle'' for the library which can
be passed to @code{dynamic-func}, @code{dynamic-call} etc.
Searching for object files is system dependent. Normally,
if @var{filename} does have an explicit directory it will
be searched for in locations
such as @file{/usr/lib} and @file{/usr/local/lib}.
@end deffn
dynamic-object?
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:168
2002-08-10 14:09:55 +00:00
@deffn {Scheme Procedure} dynamic-object? obj
@deffnx {C Function} scm_dynamic_object_p (obj)
Return @code{#t} if @var{obj} is a dynamic object handle,
or @code{#f} otherwise.
@end deffn
dynamic-unlink
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:182
2002-08-10 14:09:55 +00:00
@deffn {Scheme Procedure} dynamic-unlink dobj
@deffnx {C Function} scm_dynamic_unlink (dobj)
Unlink a dynamic object from the application, if possible. The
object must have been linked by @code{dynamic-link}, with
@var{dobj} the corresponding handle. After this procedure
is called, the handle can no longer be used to access the
object.
@end deffn
dynamic-func
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:207
2002-08-10 14:09:55 +00:00
@deffn {Scheme Procedure} dynamic-func name dobj
@deffnx {C Function} scm_dynamic_func (name, dobj)
Return a ``handle'' for the function @var{name} in the
shared object referred to by @var{dobj}. The handle
can be passed to @code{dynamic-call} to actually
call the function.
Regardless whether your C compiler prepends an underscore
@samp{_} to the global names in a program, you should
@strong{not} include this underscore in @var{name}
since it will be added automatically when necessary.
@end deffn
dynamic-call
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:253
2002-08-10 14:09:55 +00:00
@deffn {Scheme Procedure} dynamic-call func dobj
@deffnx {C Function} scm_dynamic_call (func, dobj)
Call a C function in a dynamic object. Two styles of
invocation are supported:
@itemize @bullet
@item @var{func} can be a function handle returned by
@code{dynamic-func}. In this case @var{dobj} is
ignored
@item @var{func} can be a string with the name of the
function to call, with @var{dobj} the handle of the
dynamic object in which to find the function.
This is equivalent to
@smallexample
(dynamic-call (dynamic-func @var{func} @var{dobj}) #f)
@end smallexample
@end itemize
In either case, the function is passed no arguments
and its return value is ignored.
@end deffn
dynamic-args-call
2004-08-24 16:43:07 +00:00
@c snarfed from dynl.c:285
2002-08-10 14:09:55 +00:00
@deffn {Scheme Procedure} dynamic-args-call func dobj args
@deffnx {C Function} scm_dynamic_args_call (func, dobj, args)
Call the C function indicated by @var{func} and @var{dobj},
just like @code{dynamic-call}, but pass it some arguments and
return its return value. The C function is expected to take
two arguments and return an @code{int}, just like @code{main}:
@smallexample
int c_func (int argc, char **argv);
@end smallexample
The parameter @var{args} must be a list of strings and is
converted into an array of @code{char *}. The array is passed
in @var{argv} and its size in @var{argc}. The return value is
converted to a Scheme number and returned from the call to
@code{dynamic-args-call}.
@end deffn
2001-11-11 15:01:52 +00:00
array-fill!
2004-08-24 16:43:07 +00:00
@c snarfed from ramap.c:438
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-fill! ra fill
@deffnx {C Function} scm_array_fill_x (ra, fill)
Store @var{fill} in every element of @var{array}. The value returned
2001-11-11 15:01:52 +00:00
is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array-copy-in-order!
2004-08-24 16:43:07 +00:00
@c snarfed from ramap.c:810
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-copy-in-order!
2001-11-11 15:01:52 +00:00
implemented by the C function "scm_array_copy_x"
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array-copy!
2004-08-24 16:43:07 +00:00
@c snarfed from ramap.c:819
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-copy! src dst
@deffnx {Scheme Procedure} array-copy-in-order! src dst
@deffnx {C Function} scm_array_copy_x (src, dst)
Copy every element from vector or array @var{source} to the
2001-11-11 15:01:52 +00:00
corresponding element of @var{destination}. @var{destination} must have
the same rank as @var{source}, and be at least as large in each
dimension. The order is unspecified.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
array-map-in-order!
2004-08-24 16:43:07 +00:00
@c snarfed from ramap.c:1494
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-map-in-order!
2001-11-11 15:01:52 +00:00
implemented by the C function "scm_array_map_x"
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
array-map!
2004-08-24 16:43:07 +00:00
@c snarfed from ramap.c:1505
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-map! ra0 proc . lra
@deffnx {Scheme Procedure} array-map-in-order! ra0 proc . lra
@deffnx {C Function} scm_array_map_x (ra0, proc, lra)
2001-11-11 15:01:52 +00:00
@var{array1}, @dots{} must have the same number of dimensions as
@var{array0} and have a range for each index which includes the range
for the corresponding index in @var{array0}. @var{proc} is applied to
each tuple of elements of @var{array1} @dots{} and the result is stored
as the corresponding element in @var{array0}. The value returned is
unspecified. The order of application is unspecified.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
array-for-each
2004-08-24 16:43:07 +00:00
@c snarfed from ramap.c:1651
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-for-each proc ra0 . lra
@deffnx {C Function} scm_array_for_each (proc, ra0, lra)
Apply @var{proc} to each tuple of elements of @var{array0} @dots{}
2001-11-11 15:01:52 +00:00
in row-major order. The value returned is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array-index-map!
2004-08-24 16:43:07 +00:00
@c snarfed from ramap.c:1679
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-index-map! ra proc
@deffnx {C Function} scm_array_index_map_x (ra, proc)
Apply @var{proc} to the indices of each element of @var{array} in
2001-11-11 15:01:52 +00:00
turn, storing the result in the corresponding element. The value
returned and the order of application are unspecified.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
One can implement @var{array-indexes} as
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(define (array-indexes array)
(let ((ra (apply make-array #f (array-shape array))))
(array-index-map! ra (lambda x x))
ra))
@end lisp
Another example:
@lisp
(define (apl:index-generator n)
(let ((v (make-uniform-vector n 1)))
(array-index-map! v (lambda (i) i))
v))
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
uniform-vector-length
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:211
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} uniform-vector-length v
@deffnx {C Function} scm_uniform_vector_length (v)
2001-11-11 15:01:52 +00:00
Return the number of elements in @var{uve}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array?
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:245
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array? v [prot]
@deffnx {C Function} scm_array_p (v, prot)
2001-11-11 15:01:52 +00:00
Return @code{#t} if the @var{obj} is an array, and @code{#f} if
not. The @var{prototype} argument is used with uniform arrays
and is described elsewhere.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array-rank
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:328
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-rank ra
@deffnx {C Function} scm_array_rank (ra)
2001-11-11 15:01:52 +00:00
Return the number of dimensions of @var{obj}. If @var{obj} is
not an array, @code{0} is returned.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array-dimensions
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:366
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-dimensions ra
@deffnx {C Function} scm_array_dimensions (ra)
2001-11-11 15:01:52 +00:00
@code{Array-dimensions} is similar to @code{array-shape} but replaces
elements with a @code{0} minimum with one greater than the maximum. So:
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(array-dimensions (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) 5)
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
shared-array-root
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:413
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} shared-array-root ra
@deffnx {C Function} scm_shared_array_root (ra)
2001-11-11 15:01:52 +00:00
Return the root vector of a shared array.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
shared-array-offset
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:424
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} shared-array-offset ra
@deffnx {C Function} scm_shared_array_offset (ra)
2001-11-11 15:01:52 +00:00
Return the root vector index of the first element in the array.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
shared-array-increments
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:435
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} shared-array-increments ra
@deffnx {C Function} scm_shared_array_increments (ra)
2001-11-11 15:01:52 +00:00
For each dimension, return the distance between elements in the root vector.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
dimensions->uniform-array
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:554
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill]
@deffnx {Scheme Procedure} make-uniform-vector length prototype [fill]
@deffnx {C Function} scm_dimensions_to_uniform_array (dims, prot, fill)
2001-11-11 15:01:52 +00:00
Create and return a uniform array or vector of type
corresponding to @var{prototype} with dimensions @var{dims} or
length @var{length}. If @var{fill} is supplied, it's used to
fill the array, otherwise @var{prototype} is used.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
make-shared-array
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:643
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} make-shared-array oldra mapfunc . dims
@deffnx {C Function} scm_make_shared_array (oldra, mapfunc, dims)
2001-11-11 15:01:52 +00:00
@code{make-shared-array} can be used to create shared subarrays of other
arrays. The @var{mapper} is a function that translates coordinates in
the new array into coordinates in the old array. A @var{mapper} must be
linear, and its range must stay within the bounds of the old array, but
it can be otherwise arbitrary. A simple example:
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(define fred (make-array #f 8 8))
(define freds-diagonal
(make-shared-array fred (lambda (i) (list i i)) 8))
(array-set! freds-diagonal 'foo 3)
(array-ref fred 3 3) @result{} foo
(define freds-center
(make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j))) 2 2))
(array-ref freds-center 0 0) @result{} foo
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
transpose-array
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:774
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} transpose-array ra . args
@deffnx {C Function} scm_transpose_array (ra, args)
2001-11-11 15:01:52 +00:00
Return an array sharing contents with @var{array}, but with
dimensions arranged in a different order. There must be one
@var{dim} argument for each dimension of @var{array}.
@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}.
2001-03-23 15:05:40 +00:00
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(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)
(transpose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 1 0) @result{}
#2((a 4) (b 5) (c 6))
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
enclose-array
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:879
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} enclose-array ra . axes
@deffnx {C Function} scm_enclose_array (ra, axes)
2001-11-11 15:01:52 +00:00
@var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than
the rank of @var{array}. @var{enclose-array} returns an array
resembling an array of shared arrays. The dimensions of each shared
array are the same as the @var{dim}th dimensions of the original array,
the dimensions of the outer array are the same as those of the original
array that did not match a @var{dim}.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
An enclosed array is not a general Scheme array. Its elements may not
be set using @code{array-set!}. Two references to the same element of
an enclosed array will be @code{equal?} but will not in general be
@code{eq?}. The value returned by @var{array-prototype} when given an
enclosed array is unspecified.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
examples:
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1) @result{}
#<enclosed-array (#1(a d) #1(b e) #1(c f)) (#1(1 4) #1(2 5) #1(3 6))>
(enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 0) @result{}
#<enclosed-array #2((a 1) (d 4)) #2((b 2) (e 5)) #2((c 3) (f 6))>
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array-in-bounds?
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:966
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-in-bounds? v . args
@deffnx {C Function} scm_array_in_bounds_p (v, args)
2001-11-11 15:01:52 +00:00
Return @code{#t} if its arguments would be acceptable to
@code{array-ref}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array-ref
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1044
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-ref
2001-11-11 15:01:52 +00:00
implemented by the C function "scm_uniform_vector_ref"
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
uniform-vector-ref
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1051
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} uniform-vector-ref v args
@deffnx {Scheme Procedure} array-ref v . args
@deffnx {C Function} scm_uniform_vector_ref (v, args)
2001-11-11 15:01:52 +00:00
Return the element at the @code{(index1, index2)} element in
@var{array}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
uniform-array-set1!
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1219
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} uniform-array-set1!
2001-11-11 15:01:52 +00:00
implemented by the C function "scm_array_set_x"
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array-set!
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1228
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-set! v obj . args
@deffnx {Scheme Procedure} uniform-array-set1! v obj args
@deffnx {C Function} scm_array_set_x (v, obj, args)
Set the element at the @code{(index1, index2)} element in @var{array} to
2001-11-11 15:01:52 +00:00
@var{new-value}. The value returned by array-set! is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array-contents
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1335
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-contents ra [strict]
@deffnx {C Function} scm_array_contents (ra, strict)
2001-11-11 15:01:52 +00:00
If @var{array} may be @dfn{unrolled} into a one dimensional shared array
without changing their order (last subscript changing fastest), then
@code{array-contents} returns that shared array, otherwise it returns
@code{#f}. All arrays made by @var{make-array} and
@var{make-uniform-array} may be unrolled, some arrays made by
@var{make-shared-array} may not be.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
If the optional argument @var{strict} is provided, a shared array will
be returned only if its elements are stored internally contiguous in
memory.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
uniform-array-read!
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1449
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} uniform-array-read! ra [port_or_fd [start [end]]]
@deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end]
@deffnx {C Function} scm_uniform_array_read_x (ra, port_or_fd, start, end)
Attempt to read all elements of @var{ura}, in lexicographic order, as
2001-11-11 15:01:52 +00:00
binary objects from @var{port-or-fdes}.
2001-11-16 15:04:17 +00:00
If an end of file is encountered,
the objects up to that point are put into @var{ura}
2001-11-11 15:01:52 +00:00
(starting at the beginning) and the remainder of the array is
unchanged.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The optional arguments @var{start} and @var{end} allow
a specified region of a vector (or linearized array) to be read,
leaving the remainder of the vector unchanged.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@code{uniform-array-read!} returns the number of objects read.
@var{port-or-fdes} may be omitted, in which case it defaults to the value
returned by @code{(current-input-port)}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
uniform-array-write
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1632
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} uniform-array-write v [port_or_fd [start [end]]]
@deffnx {Scheme Procedure} uniform-vector-write uve [port-or-fdes] [start] [end]
@deffnx {C Function} scm_uniform_array_write (v, port_or_fd, start, end)
2001-11-11 15:01:52 +00:00
Writes all elements of @var{ura} as binary objects to
@var{port-or-fdes}.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The optional arguments @var{start}
and @var{end} allow
a specified region of a vector (or linearized array) to be written.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The number of objects actually written is returned.
@var{port-or-fdes} may be
omitted, in which case it defaults to the value returned by
@code{(current-output-port)}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
bit-count
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1759
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} bit-count b bitvector
@deffnx {C Function} scm_bit_count (b, bitvector)
2001-11-11 15:01:52 +00:00
Return the number of occurrences of the boolean @var{b} in
@var{bitvector}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
bit-position
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1804
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} bit-position item v k
@deffnx {C Function} scm_bit_position (item, v, k)
2004-08-24 16:43:07 +00:00
Return the index of the first occurrance of @var{item} in bit
vector @var{v}, starting from @var{k}. If there is no
@var{item} entry between @var{k} and the end of
@var{bitvector}, then return @code{#f}. For example,
@example
(bit-position #t #*000101 0) @result{} 3
(bit-position #f #*0001111 3) @result{} #f
@end example
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
bit-set*!
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1890
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} bit-set*! v kv obj
@deffnx {C Function} scm_bit_set_star_x (v, kv, obj)
2004-08-24 16:43:07 +00:00
Set entries of bit vector @var{v} to @var{obj}, with @var{kv}
selecting the entries to change. The return value is
unspecified.
If @var{kv} is a bit vector, then those entries where it has
@code{#t} are the ones in @var{v} which are set to @var{obj}.
@var{kv} and @var{v} must be the same length. When @var{obj}
is @code{#t} it's like @var{kv} is OR'ed into @var{v}. Or when
@var{obj} is @code{#f} it can be seen as an ANDNOT.
@example
(define bv #*01000010)
(bit-set*! bv #*10010001 #t)
bv
@result{} #*11010011
@end example
2001-11-11 15:01:52 +00:00
2004-08-24 16:43:07 +00:00
If @var{kv} is a uniform vector of unsigned long integers, then
they're indexes into @var{v} which are set to @var{obj}.
@example
(define bv #*01000010)
(bit-set*! bv #u(5 2 7) #t)
bv
@result{} #*01100111
@end example
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
bit-count*
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:1956
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} bit-count* v kv obj
@deffnx {C Function} scm_bit_count_star (v, kv, obj)
2004-08-24 16:43:07 +00:00
Return a count of how many entries in bit vector @var{v} are
equal to @var{obj}, with @var{kv} selecting the entries to
consider.
If @var{kv} is a bit vector, then those entries where it has
@code{#t} are the ones in @var{v} which are considered.
@var{kv} and @var{v} must be the same length.
If @var{kv} is a uniform vector of unsigned long integers, then
it's the indexes in @var{v} to consider.
For example,
@example
(bit-count* #*01110111 #*11001101 #t) @result{} 3
(bit-count* #*01110111 #u(7 0 4) #f) @result{} 2
@end example
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
bit-invert!
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:2021
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} bit-invert! v
@deffnx {C Function} scm_bit_invert_x (v)
2004-08-24 16:43:07 +00:00
Modify the bit vector @var{v} by replacing each element with
its negation.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
array->list
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:2103
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array->list v
2002-03-12 21:54:22 +00:00
@deffnx {C Function} scm_array_to_list (v)
2001-11-11 15:01:52 +00:00
Return a list consisting of all the elements, in order, of
@var{array}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
list->uniform-array
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:2205
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} list->uniform-array ndim prot lst
@deffnx {Scheme Procedure} list->uniform-vector prot lst
@deffnx {C Function} scm_list_to_uniform_array (ndim, prot, lst)
2001-11-11 15:01:52 +00:00
Return a uniform array of the type indicated by prototype
@var{prot} with elements the same as those of @var{lst}.
Elements must be of the appropriate type, no coercions are
done.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
array-prototype
2004-08-24 16:43:07 +00:00
@c snarfed from unif.c:2562
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} array-prototype ra
@deffnx {C Function} scm_array_prototype (ra)
2001-11-11 15:01:52 +00:00
Return an object that would produce an array of the same type
as @var{array}, if used as the @var{prototype} for
@code{make-uniform-array}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
chown
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:220
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} chown object owner group
@deffnx {C Function} scm_chown (object, owner, group)
2001-11-11 15:01:52 +00:00
Change the ownership and group of the file referred to by @var{object} to
the integer values @var{owner} and @var{group}. @var{object} can be
a string containing a file name or, if the platform
supports fchown, a port or integer file descriptor
which is open on the file. The return value
is unspecified.
If @var{object} is a symbolic link, either the
ownership of the link or the ownership of the referenced file will be
changed depending on the operating system (lchown is
unsupported at present). If @var{owner} or @var{group} is specified
as @code{-1}, then that ID is not changed.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
chmod
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:258
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} chmod object mode
@deffnx {C Function} scm_chmod (object, mode)
2001-11-11 15:01:52 +00:00
Changes the permissions of the file referred to by @var{obj}.
@var{obj} can be a string containing a file name or a port or integer file
descriptor which is open on a file (in which case @code{fchmod} is used
as the underlying system call).
@var{mode} specifies
the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}.
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
umask
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:290
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} umask [mode]
@deffnx {C Function} scm_umask (mode)
2002-03-15 14:03:53 +00:00
If @var{mode} is omitted, returns a decimal number representing the current
2001-11-11 15:01:52 +00:00
file creation mask. Otherwise the file creation mask is set to
@var{mode} and the previous value is returned.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
open-fdes
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:312
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} open-fdes path flags [mode]
@deffnx {C Function} scm_open_fdes (path, flags, mode)
2001-11-11 15:01:52 +00:00
Similar to @code{open} but return a file descriptor instead of
a port.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
open
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:353
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} open path flags [mode]
@deffnx {C Function} scm_open (path, flags, mode)
2001-11-11 15:01:52 +00:00
Open the file named by @var{path} for reading and/or writing.
@var{flags} is an integer specifying how the file should be opened.
@var{mode} is an integer specifying the permission bits of the file, if
it needs to be created, before the umask is applied. The default is 666
(Unix itself has no default).
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@var{flags} can be constructed by combining variables using @code{logior}.
Basic flags are:
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@defvar O_RDONLY
Open the file read-only.
@end defvar
@defvar O_WRONLY
Open the file write-only.
@end defvar
@defvar O_RDWR
Open the file read/write.
@end defvar
@defvar O_APPEND
Append to the file instead of truncating.
@end defvar
@defvar O_CREAT
Create the file if it does not already exist.
@end defvar
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
See the Unix documentation of the @code{open} system call
for additional flags.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
close
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:391
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} close fd_or_port
@deffnx {C Function} scm_close (fd_or_port)
Similar to close-port (@pxref{Closing, close-port}),
2001-11-11 15:01:52 +00:00
but also works on file descriptors. A side
effect of closing a file descriptor is that any ports using that file
descriptor are moved to a different file descriptor and have
their revealed counts set to zero.
@end deffn
close-fdes
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:418
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} close-fdes fd
@deffnx {C Function} scm_close_fdes (fd)
2001-11-11 15:01:52 +00:00
A simple wrapper for the @code{close} system call.
Close file descriptor @var{fd}, which must be an integer.
Unlike close (@pxref{Ports and File Descriptors, close}),
the file descriptor will be closed even if a port is using it.
The return value is unspecified.
@end deffn
stat
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:620
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} stat object
@deffnx {C Function} scm_stat (object)
2001-11-11 15:01:52 +00:00
Return an object containing various information about the file
determined by @var{obj}. @var{obj} can be a string containing
a file name or a port or integer file descriptor which is open
on a file (in which case @code{fstat} is used as the underlying
system call).
The object returned by @code{stat} can be passed as a single
parameter to the following procedures, all of which return
integers:
@table @code
@item stat:dev
The device containing the file.
@item stat:ino
The file serial number, which distinguishes this file from all
other files on the same device.
@item stat:mode
The mode of the file. This includes file type information and
the file permission bits. See @code{stat:type} and
@code{stat:perms} below.
@item stat:nlink
The number of hard links to the file.
@item stat:uid
The user ID of the file's owner.
@item stat:gid
The group ID of the file.
@item stat:rdev
Device ID; this entry is defined only for character or block
special files.
@item stat:size
The size of a regular file in bytes.
@item stat:atime
The last access time for the file.
@item stat:mtime
The last modification time for the file.
@item stat:ctime
The last modification time for the attributes of the file.
@item stat:blksize
The optimal block size for reading or writing the file, in
bytes.
@item stat:blocks
The amount of disk space that the file occupies measured in
units of 512 byte blocks.
@end table
In addition, the following procedures return the information
from stat:mode in a more convenient form:
@table @code
@item stat:type
A symbol representing the type of file. Possible values are
regular, directory, symlink, block-special, char-special, fifo,
socket and unknown
@item stat:perms
An integer representing the access permission bits.
@end table
@end deffn
link
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:682
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} link oldpath newpath
@deffnx {C Function} scm_link (oldpath, newpath)
2001-11-11 15:01:52 +00:00
Creates a new name @var{newpath} in the file system for the
file named by @var{oldpath}. If @var{oldpath} is a symbolic
link, the link may or may not be followed depending on the
system.
@end deffn
rename-file
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:720
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} rename-file oldname newname
@deffnx {C Function} scm_rename (oldname, newname)
2001-11-11 15:01:52 +00:00
Renames the file specified by @var{oldname} to @var{newname}.
The return value is unspecified.
@end deffn
delete-file
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:737
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} delete-file str
@deffnx {C Function} scm_delete_file (str)
2001-11-11 15:01:52 +00:00
Deletes (or "unlinks") the file specified by @var{path}.
@end deffn
mkdir
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:754
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} mkdir path [mode]
@deffnx {C Function} scm_mkdir (path, mode)
2001-11-11 15:01:52 +00:00
Create a new directory named by @var{path}. If @var{mode} is omitted
then the permissions of the directory file are set using the current
umask. Otherwise they are set to the decimal value specified with
@var{mode}. The return value is unspecified.
@end deffn
rmdir
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:781
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} rmdir path
@deffnx {C Function} scm_rmdir (path)
2001-11-11 15:01:52 +00:00
Remove the existing directory named by @var{path}. The directory must
be empty for this to succeed. The return value is unspecified.
@end deffn
directory-stream?
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:805
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} directory-stream? obj
@deffnx {C Function} scm_directory_stream_p (obj)
2001-11-11 15:01:52 +00:00
Return a boolean indicating whether @var{object} is a directory
stream as returned by @code{opendir}.
@end deffn
opendir
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:816
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} opendir dirname
@deffnx {C Function} scm_opendir (dirname)
2001-11-11 15:01:52 +00:00
Open the directory specified by @var{path} and return a directory
stream.
@end deffn
readdir
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:837
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} readdir port
@deffnx {C Function} scm_readdir (port)
2001-11-11 15:01:52 +00:00
Return (as a string) the next directory entry from the directory stream
@var{stream}. If there is no remaining entry to be read then the
end of file object is returned.
@end deffn
rewinddir
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:876
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} rewinddir port
@deffnx {C Function} scm_rewinddir (port)
2001-11-11 15:01:52 +00:00
Reset the directory port @var{stream} so that the next call to
@code{readdir} will return the first directory entry.
@end deffn
closedir
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:893
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} closedir port
@deffnx {C Function} scm_closedir (port)
2001-11-11 15:01:52 +00:00
Close the directory stream @var{stream}.
The return value is unspecified.
@end deffn
chdir
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:943
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} chdir str
@deffnx {C Function} scm_chdir (str)
2001-11-11 15:01:52 +00:00
Change the current working directory to @var{path}.
The return value is unspecified.
@end deffn
getcwd
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:958
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getcwd
@deffnx {C Function} scm_getcwd ()
2001-11-11 15:01:52 +00:00
Return the name of the current working directory.
@end deffn
select
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:1159
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} select reads writes excepts [secs [usecs]]
@deffnx {C Function} scm_select (reads, writes, excepts, secs, usecs)
2001-11-11 15:01:52 +00:00
This procedure has a variety of uses: waiting for the ability
2002-03-15 14:03:53 +00:00
to provide input, accept output, or the existence of
2001-11-11 15:01:52 +00:00
exceptional conditions on a collection of ports or file
descriptors, or waiting for a timeout to occur.
It also returns if interrupted by a signal.
@var{reads}, @var{writes} and @var{excepts} can be lists or
vectors, with each member a port or a file descriptor.
The value returned is a list of three corresponding
lists or vectors containing only the members which meet the
specified requirement. The ability of port buffers to
provide input or accept output is taken into account.
Ordering of the input lists or vectors is not preserved.
The optional arguments @var{secs} and @var{usecs} specify the
timeout. Either @var{secs} can be specified alone, as
either an integer or a real number, or both @var{secs} and
@var{usecs} can be specified as integers, in which case
@var{usecs} is an additional timeout expressed in
microseconds. If @var{secs} is omitted or is @code{#f} then
select will wait for as long as it takes for one of the other
conditions to be satisfied.
The scsh version of @code{select} differs as follows:
Only vectors are accepted for the first three arguments.
The @var{usecs} argument is not supported.
Multiple values are returned instead of a list.
Duplicates in the input vectors appear only once in output.
An additional @code{select!} interface is provided.
@end deffn
fcntl
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:1297
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} fcntl object cmd [value]
@deffnx {C Function} scm_fcntl (object, cmd, value)
2001-11-11 15:01:52 +00:00
Apply @var{command} to the specified file descriptor or the underlying
file descriptor of the specified port. @var{value} is an optional
integer argument.
Values for @var{command} are:
@table @code
@item F_DUPFD
Duplicate a file descriptor
@item F_GETFD
Get flags associated with the file descriptor.
@item F_SETFD
Set flags associated with the file descriptor to @var{value}.
@item F_GETFL
Get flags associated with the open file.
@item F_SETFL
Set flags associated with the open file to @var{value}
@item F_GETOWN
Get the process ID of a socket's owner, for @code{SIGIO} signals.
@item F_SETOWN
Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.
@item FD_CLOEXEC
The value used to indicate the "close on exec" flag with @code{F_GETFL} or
@code{F_SETFL}.
@end table
@end deffn
fsync
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:1329
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} fsync object
@deffnx {C Function} scm_fsync (object)
2001-11-11 15:01:52 +00:00
Copies any unwritten data for the specified output file descriptor to disk.
If @var{port/fd} is a port, its buffer is flushed before the underlying
file descriptor is fsync'd.
The return value is unspecified.
@end deffn
symlink
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:1354
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} symlink oldpath newpath
@deffnx {C Function} scm_symlink (oldpath, newpath)
2001-11-11 15:01:52 +00:00
Create a symbolic link named @var{path-to} with the value (i.e., pointing to)
@var{path-from}. The return value is unspecified.
@end deffn
readlink
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:1373
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} readlink path
@deffnx {C Function} scm_readlink (path)
2001-11-11 15:01:52 +00:00
Return the value of the symbolic link named by @var{path} (a
string), i.e., the file that the link points to.
@end deffn
lstat
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:1415
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} lstat str
@deffnx {C Function} scm_lstat (str)
2001-11-11 15:01:52 +00:00
Similar to @code{stat}, but does not follow symbolic links, i.e.,
it will return information about a symbolic link itself, not the
file it points to. @var{path} must be a string.
@end deffn
copy-file
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:1438
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} copy-file oldfile newfile
@deffnx {C Function} scm_copy_file (oldfile, newfile)
2001-11-11 15:01:52 +00:00
Copy the file specified by @var{path-from} to @var{path-to}.
The return value is unspecified.
@end deffn
dirname
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:1501
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} dirname filename
@deffnx {C Function} scm_dirname (filename)
2001-11-11 15:01:52 +00:00
Return the directory name component of the file name
@var{filename}. If @var{filename} does not contain a directory
component, @code{.} is returned.
@end deffn
basename
2004-08-24 16:43:07 +00:00
@c snarfed from filesys.c:1544
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} basename filename [suffix]
@deffnx {C Function} scm_basename (filename, suffix)
2001-11-11 15:01:52 +00:00
Return the base name of the file name @var{filename}. The
base name is the file name without any directory components.
2002-03-15 14:03:53 +00:00
If @var{suffix} is provided, and is equal to the end of
2001-11-11 15:01:52 +00:00
@var{basename}, it is removed also.
@end deffn
pipe
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:231
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} pipe
@deffnx {C Function} scm_pipe ()
2001-11-11 15:01:52 +00:00
Return a newly created pipe: a pair of ports which are linked
together on the local machine. The @emph{car} is the input
port and the @emph{cdr} is the output port. Data written (and
flushed) to the output port can be read from the input port.
Pipes are commonly used for communication with a newly forked
child process. The need to flush the output port can be
avoided by making it unbuffered using @code{setvbuf}.
Writes occur atomically provided the size of the data in bytes
is not greater than the value of @code{PIPE_BUF}. Note that
the output port is likely to block if too much data (typically
equal to @code{PIPE_BUF}) has been written but not yet read
from the input port.
@end deffn
getgroups
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:252
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getgroups
@deffnx {C Function} scm_getgroups ()
2001-11-11 15:01:52 +00:00
Return a vector of integers representing the current
2002-03-15 14:03:53 +00:00
supplementary group IDs.
2001-11-11 15:01:52 +00:00
@end deffn
2004-08-24 16:43:07 +00:00
setgroups
@c snarfed from posix.c:285
@deffn {Scheme Procedure} setgroups group_vec
@deffnx {C Function} scm_setgroups (group_vec)
Set the current set of supplementary group IDs to the integers
in the given vector @var{vec}. The return value is
unspecified.
Generally only the superuser can set the process group IDs.
@end deffn
2001-11-11 15:01:52 +00:00
getpw
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:333
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getpw [user]
@deffnx {C Function} scm_getpwuid (user)
2001-11-11 15:01:52 +00:00
Look up an entry in the user database. @var{obj} can be an integer,
a string, or omitted, giving the behaviour of getpwuid, getpwnam
or getpwent respectively.
@end deffn
setpw
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:383
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setpw [arg]
@deffnx {C Function} scm_setpwent (arg)
2001-11-11 15:01:52 +00:00
If called with a true argument, initialize or reset the password data
stream. Otherwise, close the stream. The @code{setpwent} and
@code{endpwent} procedures are implemented on top of this.
@end deffn
getgr
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:402
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getgr [name]
@deffnx {C Function} scm_getgrgid (name)
2001-11-11 15:01:52 +00:00
Look up an entry in the group database. @var{obj} can be an integer,
a string, or omitted, giving the behaviour of getgrgid, getgrnam
or getgrent respectively.
@end deffn
setgr
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:438
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setgr [arg]
@deffnx {C Function} scm_setgrent (arg)
2001-11-11 15:01:52 +00:00
If called with a true argument, initialize or reset the group data
stream. Otherwise, close the stream. The @code{setgrent} and
@code{endgrent} procedures are implemented on top of this.
@end deffn
kill
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:474
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} kill pid sig
@deffnx {C Function} scm_kill (pid, sig)
2001-11-11 15:01:52 +00:00
Sends a signal to the specified process or group of processes.
@var{pid} specifies the processes to which the signal is sent:
@table @r
@item @var{pid} greater than 0
The process whose identifier is @var{pid}.
@item @var{pid} equal to 0
All processes in the current process group.
@item @var{pid} less than -1
The process group whose identifier is -@var{pid}
@item @var{pid} equal to -1
If the process is privileged, all processes except for some special
system processes. Otherwise, all processes with the current effective
user ID.
@end table
@var{sig} should be specified using a variable corresponding to
the Unix symbolic name, e.g.,
@defvar SIGHUP
Hang-up signal.
@end defvar
@defvar SIGINT
Interrupt signal.
@end defvar
@end deffn
waitpid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:525
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} waitpid pid [options]
@deffnx {C Function} scm_waitpid (pid, options)
2001-11-11 15:01:52 +00:00
This procedure collects status information from a child process which
has terminated or (optionally) stopped. Normally it will
suspend the calling process until this can be done. If more than one
child process is eligible then one will be chosen by the operating system.
The value of @var{pid} determines the behaviour:
@table @r
@item @var{pid} greater than 0
Request status information from the specified child process.
@item @var{pid} equal to -1 or WAIT_ANY
Request status information for any child process.
@item @var{pid} equal to 0 or WAIT_MYPGRP
Request status information for any child process in the current process
group.
@item @var{pid} less than -1
Request status information for any child process whose process group ID
is -@var{PID}.
@end table
The @var{options} argument, if supplied, should be the bitwise OR of the
values of zero or more of the following variables:
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@defvar WNOHANG
Return immediately even if there are no child processes to be collected.
@end defvar
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@defvar WUNTRACED
Report status information for stopped processes as well as terminated
processes.
@end defvar
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The return value is a pair containing:
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@enumerate
@item
The process ID of the child process, or 0 if @code{WNOHANG} was
specified and no process was collected.
@item
The integer status value.
@end enumerate
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
status:exit-val
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:551
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} status:exit-val status
@deffnx {C Function} scm_status_exit_val (status)
2001-11-11 15:01:52 +00:00
Return the exit status value, as would be set if a process
ended normally through a call to @code{exit} or @code{_exit},
if any, otherwise @code{#f}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
status:term-sig
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:569
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} status:term-sig status
@deffnx {C Function} scm_status_term_sig (status)
2001-11-11 15:01:52 +00:00
Return the signal number which terminated the process, if any,
otherwise @code{#f}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
status:stop-sig
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:585
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} status:stop-sig status
@deffnx {C Function} scm_status_stop_sig (status)
2001-11-11 15:01:52 +00:00
Return the signal number which stopped the process, if any,
otherwise @code{#f}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
getppid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:603
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getppid
@deffnx {C Function} scm_getppid ()
2001-11-11 15:01:52 +00:00
Return an integer representing the process ID of the parent
process.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
getuid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:615
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getuid
@deffnx {C Function} scm_getuid ()
2001-11-11 15:01:52 +00:00
Return an integer representing the current real user ID.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
getgid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:626
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getgid
@deffnx {C Function} scm_getgid ()
2001-11-11 15:01:52 +00:00
Return an integer representing the current real group ID.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
geteuid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:640
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} geteuid
@deffnx {C Function} scm_geteuid ()
2001-11-11 15:01:52 +00:00
Return an integer representing the current effective user ID.
If the system does not support effective IDs, then the real ID
2002-10-19 16:33:25 +00:00
is returned. @code{(provided? 'EIDs)} reports whether the
2001-11-11 15:01:52 +00:00
system supports effective IDs.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
getegid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:657
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getegid
@deffnx {C Function} scm_getegid ()
2001-11-11 15:01:52 +00:00
Return an integer representing the current effective group ID.
If the system does not support effective IDs, then the real ID
2002-10-19 16:33:25 +00:00
is returned. @code{(provided? 'EIDs)} reports whether the
2001-11-11 15:01:52 +00:00
system supports effective IDs.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
setuid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:673
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setuid id
@deffnx {C Function} scm_setuid (id)
2001-11-11 15:01:52 +00:00
Sets both the real and effective user IDs to the integer @var{id}, provided
the process has appropriate privileges.
The return value is unspecified.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
setgid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:686
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setgid id
@deffnx {C Function} scm_setgid (id)
2001-11-11 15:01:52 +00:00
Sets both the real and effective group IDs to the integer @var{id}, provided
the process has appropriate privileges.
The return value is unspecified.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
seteuid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:701
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} seteuid id
@deffnx {C Function} scm_seteuid (id)
2001-11-11 15:01:52 +00:00
Sets the effective user ID to the integer @var{id}, provided the process
has appropriate privileges. If effective IDs are not supported, the
2002-10-19 16:33:25 +00:00
real ID is set instead -- @code{(provided? 'EIDs)} reports whether the
2001-11-11 15:01:52 +00:00
system supports effective IDs.
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
setegid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:726
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setegid id
@deffnx {C Function} scm_setegid (id)
2001-11-11 15:01:52 +00:00
Sets the effective group ID to the integer @var{id}, provided the process
has appropriate privileges. If effective IDs are not supported, the
2002-10-19 16:33:25 +00:00
real ID is set instead -- @code{(provided? 'EIDs)} reports whether the
2001-11-11 15:01:52 +00:00
system supports effective IDs.
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getpgrp
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:749
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getpgrp
@deffnx {C Function} scm_getpgrp ()
2001-11-11 15:01:52 +00:00
Return an integer representing the current process group ID.
This is the POSIX definition, not BSD.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
setpgid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:767
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setpgid pid pgid
@deffnx {C Function} scm_setpgid (pid, pgid)
2001-11-11 15:01:52 +00:00
Move the process @var{pid} into the process group @var{pgid}. @var{pid} or
@var{pgid} must be integers: they can be zero to indicate the ID of the
current process.
Fails on systems that do not support job control.
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
setsid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:784
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setsid
@deffnx {C Function} scm_setsid ()
2001-11-11 15:01:52 +00:00
Creates a new session. The current process becomes the session leader
and is put in a new process group. The process will be detached
from its controlling terminal if it has one.
The return value is an integer representing the new process group ID.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
ttyname
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:808
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} ttyname port
@deffnx {C Function} scm_ttyname (port)
2001-11-11 15:01:52 +00:00
Return a string with the name of the serial terminal device
underlying @var{port}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
ctermid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:847
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} ctermid
@deffnx {C Function} scm_ctermid ()
2001-11-11 15:01:52 +00:00
Return a string containing the file name of the controlling
terminal for the current process.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
tcgetpgrp
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:871
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} tcgetpgrp port
@deffnx {C Function} scm_tcgetpgrp (port)
2001-11-11 15:01:52 +00:00
Return the process group ID of the foreground process group
associated with the terminal open on the file descriptor
underlying @var{port}.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
If there is no foreground process group, the return value is a
number greater than 1 that does not match the process group ID
of any existing process group. This can happen if all of the
processes in the job that was formerly the foreground job have
terminated, and no other job has yet been moved into the
foreground.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
tcsetpgrp
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:895
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} tcsetpgrp port pgid
@deffnx {C Function} scm_tcsetpgrp (port, pgid)
2001-11-11 15:01:52 +00:00
Set the foreground process group ID for the terminal used by the file
descriptor underlying @var{port} to the integer @var{pgid}.
The calling process
must be a member of the same session as @var{pgid} and must have the same
controlling terminal. The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
execl
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:927
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} execl filename . args
@deffnx {C Function} scm_execl (filename, args)
2001-11-11 15:01:52 +00:00
Executes the file named by @var{path} as a new process image.
The remaining arguments are supplied to the process; from a C program
2002-03-15 14:03:53 +00:00
they are accessible as the @code{argv} argument to @code{main}.
2001-11-11 15:01:52 +00:00
Conventionally the first @var{arg} is the same as @var{path}.
2001-11-16 15:04:17 +00:00
All arguments must be strings.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
If @var{arg} is missing, @var{path} is executed with a null
argument list, which may have system-dependent side-effects.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
This procedure is currently implemented using the @code{execv} system
call, but we call it @code{execl} because of its Scheme calling interface.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
execlp
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:958
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} execlp filename . args
@deffnx {C Function} scm_execlp (filename, args)
2001-11-11 15:01:52 +00:00
Similar to @code{execl}, however if
@var{filename} does not contain a slash
then the file to execute will be located by searching the
directories listed in the @code{PATH} environment variable.
This procedure is currently implemented using the @code{execvp} system
call, but we call it @code{execlp} because of its Scheme calling interface.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
execle
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:992
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} execle filename env . args
@deffnx {C Function} scm_execle (filename, env, args)
2001-11-11 15:01:52 +00:00
Similar to @code{execl}, but the environment of the new process is
specified by @var{env}, which must be a list of strings as returned by the
@code{environ} procedure.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
This procedure is currently implemented using the @code{execve} system
call, but we call it @code{execle} because of its Scheme calling interface.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
primitive-fork
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1028
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} primitive-fork
@deffnx {C Function} scm_fork ()
2001-11-11 15:01:52 +00:00
Creates a new "child" process by duplicating the current "parent" process.
In the child the return value is 0. In the parent the return value is
the integer process ID of the child.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
This procedure has been renamed from @code{fork} to avoid a naming conflict
with the scsh fork.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
uname
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1048
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} uname
@deffnx {C Function} scm_uname ()
2001-11-11 15:01:52 +00:00
Return an object with some information about the computer
system the program is running on.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
environ
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1077
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} environ [env]
@deffnx {C Function} scm_environ (env)
2001-11-11 15:01:52 +00:00
If @var{env} is omitted, return the current environment (in the
Unix sense) as a list of strings. Otherwise set the current
environment, which is also the default environment for child
processes, to the supplied list of strings. Each member of
@var{env} should be of the form @code{NAME=VALUE} and values of
@code{NAME} should not be duplicated. If @var{env} is supplied
then the return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
tmpnam
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1110
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} tmpnam
@deffnx {C Function} scm_tmpnam ()
2001-11-11 15:01:52 +00:00
Return a name in the file system that does not match any
existing file. However there is no guarantee that another
process will not create the file after @code{tmpnam} is called.
Care should be taken if opening the file, e.g., use the
@code{O_EXCL} open flag or use @code{mkstemp!} instead.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
mkstemp!
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1136
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} mkstemp! tmpl
@deffnx {C Function} scm_mkstemp (tmpl)
2001-11-11 15:01:52 +00:00
Create a new unique file in the file system and returns a new
buffered port open for reading and writing to the file.
@var{tmpl} is a string specifying where the file should be
created: it must end with @code{XXXXXX} and will be changed in
place to return the name of the temporary file.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
utime
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1171
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} utime pathname [actime [modtime]]
@deffnx {C Function} scm_utime (pathname, actime, modtime)
2001-11-11 15:01:52 +00:00
@code{utime} sets the access and modification times for the
file named by @var{path}. If @var{actime} or @var{modtime} is
not supplied, then the current time is used. @var{actime} and
@var{modtime} must be integer time values as returned by the
@code{current-time} procedure.
@lisp
(utime "foo" (- (current-time) 3600))
@end lisp
will set the access time to one hour in the past and the
modification time to the current time.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
access?
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1219
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} access? path how
@deffnx {C Function} scm_access (path, how)
2001-11-11 15:01:52 +00:00
Return @code{#t} if @var{path} corresponds to an existing file
and the current process has the type of access specified by
@var{how}, otherwise @code{#f}. @var{how} should be specified
using the values of the variables listed below. Multiple
values can be combined using a bitwise or, in which case
@code{#t} will only be returned if all accesses are granted.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
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.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@defvar R_OK
test for read permission.
@end defvar
@defvar W_OK
test for write permission.
@end defvar
@defvar X_OK
test for execute permission.
@end defvar
@defvar F_OK
test for existence of the file.
@end defvar
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getpid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1232
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getpid
@deffnx {C Function} scm_getpid ()
2001-11-11 15:01:52 +00:00
Return an integer representing the current process ID.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
putenv
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1249
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} putenv str
@deffnx {C Function} scm_putenv (str)
2001-11-11 15:01:52 +00:00
Modifies the environment of the current process, which is
also the default environment inherited by child processes.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
If @var{string} is of the form @code{NAME=VALUE} then it will be written
directly into the environment, replacing any existing environment string
with
name matching @code{NAME}. If @var{string} does not contain an equal
sign, then any existing string with name matching @var{string} will
be removed.
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
setlocale
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1333
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setlocale category [locale]
@deffnx {C Function} scm_setlocale (category, locale)
2001-11-11 15:01:52 +00:00
If @var{locale} is omitted, return the current value of the
specified locale category as a system-dependent string.
@var{category} should be specified using the values
@code{LC_COLLATE}, @code{LC_ALL} etc.
Otherwise the specified locale category is set to the string
@var{locale} and the new value is returned as a
system-dependent string. If @var{locale} is an empty string,
2002-03-15 14:03:53 +00:00
the locale will be set using environment variables.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
mknod
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1376
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} mknod path type perms dev
@deffnx {C Function} scm_mknod (path, type, perms, dev)
2001-11-11 15:01:52 +00:00
Creates a new special file, such as a file corresponding to a device.
@var{path} specifies the name of the file. @var{type} should
be one of the following symbols:
regular, directory, symlink, block-special, char-special,
fifo, or socket. @var{perms} (an integer) specifies the file permissions.
@var{dev} (an integer) specifies which device the special file refers
to. Its exact interpretation depends on the kind of special file
being created.
E.g.,
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(mknod "/dev/fd0" 'block-special #o660 (+ (* 2 256) 2))
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
The return value is unspecified.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
nice
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1422
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} nice incr
@deffnx {C Function} scm_nice (incr)
2001-11-11 15:01:52 +00:00
Increment the priority of the current process by @var{incr}. A higher
priority value means that the process runs less often.
The return value is unspecified.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
sync
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1436
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sync
@deffnx {C Function} scm_sync ()
2001-11-11 15:01:52 +00:00
Flush the operating system disk buffers.
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
crypt
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1467
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} crypt key salt
@deffnx {C Function} scm_crypt (key, salt)
2001-11-11 15:01:52 +00:00
Encrypt @var{key} using @var{salt} as the salt value to the
crypt(3) library call.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
chroot
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1499
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} chroot path
@deffnx {C Function} scm_chroot (path)
2001-11-11 15:01:52 +00:00
Change the root directory to that specified in @var{path}.
This directory will be used for path names beginning with
@file{/}. The root directory is inherited by all children
of the current process. Only the superuser may change the
root directory.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
getlogin
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1533
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getlogin
@deffnx {C Function} scm_getlogin ()
2001-11-11 15:01:52 +00:00
Return a string containing the name of the user logged in on
the controlling terminal of the process, or @code{#f} if this
information cannot be obtained.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
cuserid
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1551
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} cuserid
@deffnx {C Function} scm_cuserid ()
2001-11-11 15:01:52 +00:00
Return a string containing a user name associated with the
effective user id of the process. Return @code{#f} if this
information cannot be obtained.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getpriority
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1577
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getpriority which who
@deffnx {C Function} scm_getpriority (which, who)
2001-11-11 15:01:52 +00:00
Return the scheduling priority of the process, process group
or user, as indicated by @var{which} and @var{who}. @var{which}
is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
or @code{PRIO_USER}, and @var{who} is interpreted relative to
@var{which} (a process identifier for @code{PRIO_PROCESS},
process group identifier for @code{PRIO_PGRP}, and a user
identifier for @code{PRIO_USER}. A zero value of @var{who}
denotes the current process, process group, or user. Return
the highest priority (lowest numerical value) of any of the
specified processes.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
setpriority
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1611
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setpriority which who prio
@deffnx {C Function} scm_setpriority (which, who, prio)
2001-11-11 15:01:52 +00:00
Set the scheduling priority of the process, process group
or user, as indicated by @var{which} and @var{who}. @var{which}
is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
or @code{PRIO_USER}, and @var{who} is interpreted relative to
@var{which} (a process identifier for @code{PRIO_PROCESS},
process group identifier for @code{PRIO_PGRP}, and a user
identifier for @code{PRIO_USER}. A zero value of @var{who}
denotes the current process, process group, or user.
@var{prio} is a value in the range -20 and 20, the default
priority is 0; lower priorities cause more favorable
scheduling. Sets the priority of all of the specified
processes. Only the super-user may lower priorities.
The return value is not specified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getpass
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1636
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getpass prompt
@deffnx {C Function} scm_getpass (prompt)
2001-11-11 15:01:52 +00:00
Display @var{prompt} to the standard error output and read
a password from @file{/dev/tty}. If this file is not
accessible, it reads from standard input. The password may be
up to 127 characters in length. Additional characters and the
terminating newline character are discarded. While reading
the password, echoing and the generation of signals by special
characters is disabled.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
flock
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1741
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} flock file operation
@deffnx {C Function} scm_flock (file, operation)
2001-11-11 15:01:52 +00:00
Apply or remove an advisory lock on an open file.
@var{operation} specifies the action to be done:
@table @code
@item LOCK_SH
Shared lock. More than one process may hold a shared lock
for a given file at a given time.
@item LOCK_EX
Exclusive lock. Only one process may hold an exclusive lock
for a given file at a given time.
@item LOCK_UN
Unlock the file.
@item LOCK_NB
Don't block when locking. May be specified by bitwise OR'ing
it to one of the other operations.
@end table
The return value is not specified. @var{file} may be an open
2002-03-15 14:03:53 +00:00
file descriptor or an open file descriptor port.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sethostname
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1766
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sethostname name
@deffnx {C Function} scm_sethostname (name)
2001-11-11 15:01:52 +00:00
Set the host name of the current processor to @var{name}. May
only be used by the superuser. The return value is not
specified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
gethostname
2004-08-24 16:43:07 +00:00
@c snarfed from posix.c:1784
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} gethostname
@deffnx {C Function} scm_gethostname ()
2001-11-11 15:01:52 +00:00
Return the host name of the current processor.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
gethost
2004-08-24 16:43:07 +00:00
@c snarfed from net_db.c:134
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} gethost [host]
@deffnx {Scheme Procedure} gethostbyname hostname
@deffnx {Scheme Procedure} gethostbyaddr address
@deffnx {C Function} scm_gethost (host)
2001-11-11 15:01:52 +00:00
Look up a host by name or address, returning a host object. The
@code{gethost} procedure will accept either a string name or an integer
address; if given no arguments, it behaves like @code{gethostent} (see
below). If a name or address is supplied but the address can not be
found, an error will be thrown to one of the keys:
@code{host-not-found}, @code{try-again}, @code{no-recovery} or
@code{no-data}, corresponding to the equivalent @code{h_error} values.
Unusual conditions may result in errors thrown to the
@code{system-error} or @code{misc_error} keys.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getnet
2004-08-24 16:43:07 +00:00
@c snarfed from net_db.c:216
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getnet [net]
@deffnx {Scheme Procedure} getnetbyname net-name
@deffnx {Scheme Procedure} getnetbyaddr net-number
@deffnx {C Function} scm_getnet (net)
2001-11-11 15:01:52 +00:00
Look up a network by name or net number in the network database. The
@var{net-name} argument must be a string, and the @var{net-number}
argument must be an integer. @code{getnet} will accept either type of
argument, behaving like @code{getnetent} (see below) if no arguments are
given.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getproto
2004-08-24 16:43:07 +00:00
@c snarfed from net_db.c:268
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getproto [protocol]
@deffnx {Scheme Procedure} getprotobyname name
@deffnx {Scheme Procedure} getprotobynumber number
@deffnx {C Function} scm_getproto (protocol)
2001-11-11 15:01:52 +00:00
Look up a network protocol by name or by number. @code{getprotobyname}
takes a string argument, and @code{getprotobynumber} takes an integer
argument. @code{getproto} will accept either type, behaving like
@code{getprotoent} (see below) if no arguments are supplied.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getserv
2004-08-24 16:43:07 +00:00
@c snarfed from net_db.c:334
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getserv [name [protocol]]
@deffnx {Scheme Procedure} getservbyname name protocol
@deffnx {Scheme Procedure} getservbyport port protocol
@deffnx {C Function} scm_getserv (name, protocol)
2001-11-11 15:01:52 +00:00
Look up a network service by name or by service number, and return a
network service object. The @var{protocol} argument specifies the name
of the desired protocol; if the protocol found in the network service
database does not match this name, a system error is signalled.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
The @code{getserv} procedure will take either a service name or number
as its first argument; if given no arguments, it behaves like
@code{getservent} (see below).
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sethost
2004-08-24 16:43:07 +00:00
@c snarfed from net_db.c:385
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sethost [stayopen]
@deffnx {C Function} scm_sethost (stayopen)
2001-11-11 15:01:52 +00:00
If @var{stayopen} is omitted, this is equivalent to @code{endhostent}.
Otherwise it is equivalent to @code{sethostent stayopen}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
setnet
2004-08-24 16:43:07 +00:00
@c snarfed from net_db.c:401
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setnet [stayopen]
@deffnx {C Function} scm_setnet (stayopen)
2001-11-11 15:01:52 +00:00
If @var{stayopen} is omitted, this is equivalent to @code{endnetent}.
Otherwise it is equivalent to @code{setnetent stayopen}.
@end deffn
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
setproto
2004-08-24 16:43:07 +00:00
@c snarfed from net_db.c:417
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setproto [stayopen]
@deffnx {C Function} scm_setproto (stayopen)
2001-11-11 15:01:52 +00:00
If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}.
Otherwise it is equivalent to @code{setprotoent stayopen}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
setserv
2004-08-24 16:43:07 +00:00
@c snarfed from net_db.c:433
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setserv [stayopen]
@deffnx {C Function} scm_setserv (stayopen)
2001-11-11 15:01:52 +00:00
If @var{stayopen} is omitted, this is equivalent to @code{endservent}.
Otherwise it is equivalent to @code{setservent stayopen}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
htons
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:80
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} htons value
@deffnx {C Function} scm_htons (value)
2001-11-11 15:01:52 +00:00
Convert a 16 bit quantity from host to network byte ordering.
@var{value} is packed into 2 bytes, which are then converted
and returned as a new integer.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
ntohs
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:91
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} ntohs value
@deffnx {C Function} scm_ntohs (value)
2001-11-11 15:01:52 +00:00
Convert a 16 bit quantity from network to host byte ordering.
@var{value} is packed into 2 bytes, which are then converted
and returned as a new integer.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
htonl
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:102
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} htonl value
@deffnx {C Function} scm_htonl (value)
2001-11-11 15:01:52 +00:00
Convert a 32 bit quantity from host to network byte ordering.
@var{value} is packed into 4 bytes, which are then converted
and returned as a new integer.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
ntohl
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:115
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} ntohl value
@deffnx {C Function} scm_ntohl (value)
2001-11-11 15:01:52 +00:00
Convert a 32 bit quantity from network to host byte ordering.
@var{value} is packed into 4 bytes, which are then converted
and returned as a new integer.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
inet-aton
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:135
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} inet-aton address
@deffnx {C Function} scm_inet_aton (address)
2001-11-11 15:01:52 +00:00
Convert an IPv4 Internet address from printable string
(dotted decimal notation) to an integer. E.g.,
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(inet-aton "127.0.0.1") @result{} 2130706433
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
inet-ntoa
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:158
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} inet-ntoa inetid
@deffnx {C Function} scm_inet_ntoa (inetid)
2001-11-11 15:01:52 +00:00
Convert an IPv4 Internet address to a printable
(dotted decimal notation) string. E.g.,
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(inet-ntoa 2130706433) @result{} "127.0.0.1"
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
inet-netof
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:178
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} inet-netof address
@deffnx {C Function} scm_inet_netof (address)
2001-11-11 15:01:52 +00:00
Return the network number part of the given IPv4
Internet address. E.g.,
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(inet-netof 2130706433) @result{} 127
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
inet-lnaof
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:196
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} inet-lnaof address
@deffnx {C Function} scm_lnaof (address)
2001-11-11 15:01:52 +00:00
Return the local-address-with-network part of the given
IPv4 Internet address, using the obsolete class A/B/C system.
E.g.,
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(inet-lnaof 2130706433) @result{} 1
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
inet-makeaddr
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:214
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} inet-makeaddr net lna
@deffnx {C Function} scm_inet_makeaddr (net, lna)
2001-11-11 15:01:52 +00:00
Make an IPv4 Internet address by combining the network number
@var{net} with the local-address-within-network number
@var{lna}. E.g.,
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(inet-makeaddr 127 1) @result{} 2130706433
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
inet-pton
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:399
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} inet-pton family address
@deffnx {C Function} scm_inet_pton (family, address)
2001-11-11 15:01:52 +00:00
Convert a string containing a printable network address to
an integer address. Note that unlike the C version of this
function,
the result is an integer with normal host byte ordering.
@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@lisp
2001-11-11 15:01:52 +00:00
(inet-pton AF_INET "127.0.0.1") @result{} 2130706433
(inet-pton AF_INET6 "::1") @result{} 1
* scheme-options.texi, scheme-procedures.texi,
scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
docstrings and C source.
* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
posix.texi, scheme-control.texi, scheme-evaluation.texi,
scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
scheme-scheduling.texi: Automated docstring merging.
2001-04-03 13:11:14 +00:00
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
inet-ntop
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:437
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} inet-ntop family address
@deffnx {C Function} scm_inet_ntop (family, address)
2001-11-11 15:01:52 +00:00
Convert a network address into a printable string.
Note that unlike the C version of this function,
the input is an integer with normal host byte ordering.
@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@lisp
(inet-ntop AF_INET 2130706433) @result{} "127.0.0.1"
(inet-ntop AF_INET6 (- (expt 2 128) 1)) @result{}
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
@end lisp
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
socket
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:479
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} socket family style proto
@deffnx {C Function} scm_socket (family, style, proto)
2001-11-11 15:01:52 +00:00
Return a new socket port of the type specified by @var{family},
@var{style} and @var{proto}. All three parameters are
integers. Supported values for @var{family} are
@code{AF_UNIX}, @code{AF_INET} and @code{AF_INET6}.
Typical values for @var{style} are @code{SOCK_STREAM},
@code{SOCK_DGRAM} and @code{SOCK_RAW}.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@var{proto} can be obtained from a protocol name using
@code{getprotobyname}. A value of zero specifies the default
protocol, which is usually right.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
A single socket port cannot by used for communication until it
has been connected to another socket.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
socketpair
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:500
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} socketpair family style proto
@deffnx {C Function} scm_socketpair (family, style, proto)
2001-11-11 15:01:52 +00:00
Return a pair of connected (but unnamed) socket ports of the
type specified by @var{family}, @var{style} and @var{proto}.
Many systems support only socket pairs of the @code{AF_UNIX}
family. Zero is likely to be the only meaningful value for
@var{proto}.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getsockopt
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:525
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getsockopt sock level optname
@deffnx {C Function} scm_getsockopt (sock, level, optname)
2001-11-11 15:01:52 +00:00
Return the value of a particular socket option for the socket
port @var{sock}. @var{level} is an integer code for type of
option being requested, e.g., @code{SOL_SOCKET} for
socket-level options. @var{optname} is an integer code for the
option required and should be specified using one of the
symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The returned value is typically an integer but @code{SO_LINGER}
returns a pair of integers.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
setsockopt
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:593
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} setsockopt sock level optname value
@deffnx {C Function} scm_setsockopt (sock, level, optname, value)
2001-11-11 15:01:52 +00:00
Set the value of a particular socket option for the socket
port @var{sock}. @var{level} is an integer code for type of option
being set, e.g., @code{SOL_SOCKET} for socket-level options.
@var{optname} is an
integer code for the option to set and should be specified using one of
the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
@var{value} is the value to which the option should be set. For
most options this must be an integer, but for @code{SO_LINGER} it must
be a pair.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
shutdown
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:697
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} shutdown sock how
@deffnx {C Function} scm_shutdown (sock, how)
2001-11-11 15:01:52 +00:00
Sockets can be closed simply by using @code{close-port}. The
2002-03-15 14:03:53 +00:00
@code{shutdown} procedure allows reception or transmission on a
2001-11-11 15:01:52 +00:00
connection to be shut down individually, according to the parameter
@var{how}:
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@table @asis
@item 0
Stop receiving data for this socket. If further data arrives, reject it.
@item 1
Stop trying to transmit data from this socket. Discard any
data waiting to be sent. Stop looking for acknowledgement of
data already sent; don't retransmit it if it is lost.
@item 2
Stop both reception and transmission.
@end table
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
connect
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:842
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} connect sock fam address . args
@deffnx {C Function} scm_connect (sock, fam, address, args)
2001-11-11 15:01:52 +00:00
Initiate a connection from a socket using a specified address
family to the address
specified by @var{address} and possibly @var{args}.
The format required for @var{address}
and @var{args} depends on the family of the socket.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
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.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
For a socket of family @code{AF_INET},
@var{address} must be an integer IPv4 host address and
@var{args} must be a single integer port number.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
For a socket of family @code{AF_INET6},
@var{address} must be an integer IPv6 host address and
@var{args} may be up to three integers:
port [flowinfo] [scope_id],
where flowinfo and scope_id default to zero.
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
bind
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:901
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} bind sock fam address . args
@deffnx {C Function} scm_bind (sock, fam, address, args)
2001-11-11 15:01:52 +00:00
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.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
The format of @var{address} and @var{args} depends
on the family of the socket.
For a socket of family @code{AF_UNIX}, only @var{address}
is specified and must be a string with the filename where
the socket is to be created.
For a socket of family @code{AF_INET}, @var{address}
must be an integer IPv4 address and @var{args}
must be a single integer port number.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The values of the following variables can also be used for
@var{address}:
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@defvar INADDR_ANY
Allow connections from any address.
@end defvar
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@defvar INADDR_LOOPBACK
The address of the local host using the loopback device.
@end defvar
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@defvar INADDR_BROADCAST
The broadcast address on the local network.
@end defvar
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
@defvar INADDR_NONE
No address.
@end defvar
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
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.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The return value is unspecified.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
listen
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:934
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} listen sock backlog
@deffnx {C Function} scm_listen (sock, backlog)
2001-11-11 15:01:52 +00:00
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.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
The return value is unspecified.
@end deffn
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
accept
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:1046
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} accept sock
@deffnx {C Function} scm_accept (sock)
2001-11-11 15:01:52 +00:00
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.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
The return value is a
pair in which the @emph{car} is a new socket port for the
connection and
the @emph{cdr} is an object with address information about the
client which initiated the connection.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
@var{sock} does not become part of the
connection and will continue to accept new requests.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getsockname
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:1073
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getsockname sock
@deffnx {C Function} scm_getsockname (sock)
2001-11-11 15:01:52 +00:00
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.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
getpeername
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:1095
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} getpeername sock
@deffnx {C Function} scm_getpeername (sock)
2001-11-11 15:01:52 +00:00
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.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
recv!
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:1130
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} recv! sock buf [flags]
@deffnx {C Function} scm_recv (sock, buf, flags)
2001-11-11 15:01:52 +00:00
Receive data from a socket port.
@var{sock} must already
be bound to the address from which data is to be received.
@var{buf} is a string into which
the data will be written. The size of @var{buf} limits
the amount of
data which can be received: in the case of packet
protocols, if a packet larger than this limit is encountered
then some data
will be irrevocably lost.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The optional @var{flags} argument is a value or
bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The value returned is the number of bytes read from the
socket.
* 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'.
2001-05-04 21:54:00 +00:00
2001-11-11 15:01:52 +00:00
Note that the data is read directly from the socket file
descriptor:
any unread buffered port data is ignored.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
send
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:1173
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} send sock message [flags]
@deffnx {C Function} scm_send (sock, message, flags)
2001-11-11 15:01:52 +00:00
Transmit the string @var{message} on a socket port @var{sock}.
@var{sock} must already be bound to a destination address. The
value returned is the number of bytes transmitted --
it's possible for
this to be less than the length of @var{message}
if the socket is
set to be non-blocking. The optional @var{flags} argument
is a value or
bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
Note that the data is written directly to the socket
file descriptor:
any unflushed buffered port data is ignored.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
recvfrom!
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:1224
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]]
@deffnx {C Function} scm_recvfrom (sock, str, flags, start, end)
2001-11-11 15:01:52 +00:00
Return data from the socket port @var{sock} and also
information about where the data was received from.
@var{sock} must already be bound to the address from which
data is to be received. @code{str}, is a string into which the
data will be written. The size of @var{str} limits the amount
of data which can be received: in the case of packet protocols,
if a packet larger than this limit is encountered then some
data will be irrevocably lost.
2001-03-23 15:05:40 +00:00
2001-11-11 15:01:52 +00:00
The optional @var{flags} argument is a value or bitwise OR of
@code{MSG_OOB}, @code{MSG_PEEK}, @code{MSG_DONTROUTE} etc.
The value returned is a pair: the @emph{car} is the number of
bytes read from the socket and the @emph{cdr} an address object
in the same form as returned by @code{accept}. The address
will given as @code{#f} if not available, as is usually the
case for stream sockets.
The @var{start} and @var{end} arguments specify a substring of
@var{str} to which the data should be written.
Note that the data is read directly from the socket file
descriptor: any unread buffered port data is ignored.
2001-03-23 15:05:40 +00:00
@end deffn
2001-11-11 15:01:52 +00:00
sendto
2004-08-24 16:43:07 +00:00
@c snarfed from socket.c:1289
2001-11-16 15:04:17 +00:00
@deffn {Scheme Procedure} sendto sock message fam address . args_and_flags
@deffnx {C Function} scm_sendto (sock, message, fam, address, args_and_flags)
2001-11-11 15:01:52 +00:00
Transmit the string @var{message} on the socket port
@var{sock}. The
destination address is specified using the @var{fam},
@var{address} and
@var{args_and_flags} arguments, in a similar way to the
@code{connect} procedure. @var{args_and_flags} contains
the usual connection arguments optionally followed by
a flags argument, which is a value or
bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
The value returned is the number of bytes transmitted --
it's possible for
this to be less than the length of @var{message} if the
socket is
set to be non-blocking.
Note that the data is written directly to the socket
file descriptor:
any unflushed buffered port data is ignored.
2001-03-23 15:05:40 +00:00
@end deffn
2002-03-12 21:54:22 +00:00
2002-07-10 22:21:25 +00:00
regexp?
2004-08-24 16:43:07 +00:00
@c snarfed from regex-posix.c:105
2002-07-10 22:21:25 +00:00
@deffn {Scheme Procedure} regexp? obj
@deffnx {C Function} scm_regexp_p (obj)
Return @code{#t} if @var{obj} is a compiled regular expression,
or @code{#f} otherwise.
@end deffn
make-regexp
2004-08-24 16:43:07 +00:00
@c snarfed from regex-posix.c:150
2002-07-10 22:21:25 +00:00
@deffn {Scheme Procedure} make-regexp pat . flags
@deffnx {C Function} scm_make_regexp (pat, flags)
Compile the regular expression described by @var{pat}, and
return the compiled regexp structure. If @var{pat} does not
describe a legal regular expression, @code{make-regexp} throws
a @code{regular-expression-syntax} error.
The @var{flags} arguments change the behavior of the compiled
regular expression. The following flags may be supplied:
@table @code
@item regexp/icase
Consider uppercase and lowercase letters to be the same when
matching.
@item regexp/newline
If a newline appears in the target string, then permit the
@samp{^} and @samp{$} operators to match immediately after or
immediately before the newline, respectively. Also, the
@samp{.} and @samp{[^...]} operators will never match a newline
character. The intent of this flag is to treat the target
string as a buffer containing many lines of text, and the
regular expression as a pattern that may match a single one of
those lines.
@item regexp/basic
Compile a basic (``obsolete'') regexp instead of the extended
(``modern'') regexps that are the default. Basic regexps do
not consider @samp{|}, @samp{+} or @samp{?} to be special
characters, and require the @samp{@{...@}} and @samp{(...)}
metacharacters to be backslash-escaped (@pxref{Backslash
Escapes}). There are several other differences between basic
and extended regular expressions, but these are the most
significant.
@item regexp/extended
Compile an extended regular expression rather than a basic
regexp. This is the default behavior; this flag will not
usually be needed. If a call to @code{make-regexp} includes
both @code{regexp/basic} and @code{regexp/extended} flags, the
one which comes last will override the earlier one.
@end table
@end deffn
regexp-exec
2004-08-24 16:43:07 +00:00
@c snarfed from regex-posix.c:216
2002-07-10 22:21:25 +00:00
@deffn {Scheme Procedure} regexp-exec rx str [start [flags]]
@deffnx {C Function} scm_regexp_exec (rx, str, start, flags)
Match the compiled regular expression @var{rx} against
@code{str}. If the optional integer @var{start} argument is
provided, begin matching from that position in the string.
Return a match structure describing the results of the match,
or @code{#f} if no match could be found.
The @var{flags} arguments change the matching behavior.
The following flags may be supplied:
@table @code
@item regexp/notbol
Operator @samp{^} always fails (unless @code{regexp/newline}
is used). Use this when the beginning of the string should
not be considered the beginning of a line.
@item regexp/noteol
Operator @samp{$} always fails (unless @code{regexp/newline}
is used). Use this when the end of the string should not be
considered the end of a line.
@end table
@end deffn