1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 09:10:22 +02:00

* vectors.c (s_scm_vector_p, list->vector, scm_vector)

(scm_vector_ref, scm_vector_set_x, scm_vector_to_list)
	(scm_vector_fill_x), strorder.c (scm_string_equal_p)
	(scm_string_ci_equal_p, scm_string_less_p, scm_string_leq_p)
	(scm_string_gr_p, scm_string_geq_p, scm_string_ci_less_p)
	(scm_string_ci_geq_p), symbols.c (scm_symbol_p)
	(scm_symbol_to_string, scm_string_to_symbol): Changed use of @t{}
	to @code{} as the texinfo manual recommends, converted the
	examples to use a @lisp{}-environment.

	* strports.c (scm_eval_string): Cleaned up the docstring.

	* struct.c (scm_struct_p, scm_struct_vtable_p): Added texinfo
	markup.

	* numbers.c (scm_exact_p, scm_odd_p, scm_even_p)
	(scm_number_to_string, scm_string_to_number, scm_number_p)
	(scm_real_p, scm_integer_p, scm_inexact_p, scm_make_rectangular)
	(scm_make_polar, scm_inexact_to_exact): Added texinfo markup.
	(scm_ash): Added texinfo markup and removed obsolete @refill.
	(scm_gr_p): Corrected comment.
	(scm_gr_p, scm_leq_p, scm_geq_p): Added texinfo markup to (future
	docstring) comments.
	(scm_positive_p, scm_less_p, scm_num_eq_p, scm_real_p)
	(scm_number_p, scm_negative_p, scm_max, scm_min, scm_sum)
	(scm_difference, scm_product, scm_divide, scm_asinh, scm_acosh)
	(scm_atanh, scm_truncate, scm_round, scm_exact_to_inexact)
	(floor, ceiling, $sqrt, $abs, $exp, $log, $sin, $cos, $tan, $asin)
	($acos, $atan, $sinh, $cosh, $tanh, scm_real_part, scm_imag_part)
	(scm_magnitude, scm_angle, scm_abs, scm_quotient, scm_remainder)
	(scm_modulo, scm_gcd, scm_lcm): Added (future docstring) comments.
This commit is contained in:
Martin Grabmüller 2001-03-02 09:07:22 +00:00
parent 08c608e10a
commit 942e5b9162
6 changed files with 269 additions and 193 deletions

View file

@ -103,7 +103,8 @@ static SCM abs_most_negative_fixnum;
SCM_DEFINE (scm_exact_p, "exact?", 1, 0, 0,
(SCM x),
"Return #t if X is an exact number, #f otherwise.")
"Return @code{#t} if @var{x} is an exact number, @code{#f}\n"
"otherwise.")
#define FUNC_NAME s_scm_exact_p
{
if (SCM_INUMP (x)) {
@ -119,7 +120,8 @@ SCM_DEFINE (scm_exact_p, "exact?", 1, 0, 0,
SCM_DEFINE (scm_odd_p, "odd?", 1, 0, 0,
(SCM n),
"Return #t if N is an odd number, #f otherwise.")
"Return @code{#t} if @var{n} is an odd number, @code{#f}\n"
"otherwise.")
#define FUNC_NAME s_scm_odd_p
{
if (SCM_INUMP (n)) {
@ -135,7 +137,8 @@ SCM_DEFINE (scm_odd_p, "odd?", 1, 0, 0,
SCM_DEFINE (scm_even_p, "even?", 1, 0, 0,
(SCM n),
"Return #t if N is an even number, #f otherwise.")
"Return @code{#t} if @var{n} is an even number, @code{#f}\n"
"otherwise.")
#define FUNC_NAME s_scm_even_p
{
if (SCM_INUMP (n)) {
@ -150,7 +153,8 @@ SCM_DEFINE (scm_even_p, "even?", 1, 0, 0,
SCM_GPROC (s_abs, "abs", 1, 0, 0, scm_abs, g_abs);
/* "Return the absolute value of @var{x}."
*/
SCM
scm_abs (SCM x)
{
@ -182,7 +186,8 @@ scm_abs (SCM x)
SCM_GPROC (s_quotient, "quotient", 2, 0, 0, scm_quotient, g_quotient);
/* "Return the quotient of the numbers @var{x} and @var{y}."
*/
SCM
scm_quotient (SCM x, SCM y)
{
@ -259,7 +264,12 @@ scm_quotient (SCM x, SCM y)
SCM_GPROC (s_remainder, "remainder", 2, 0, 0, scm_remainder, g_remainder);
/* "Return the remainder of the numbers @var{x} and @var{y}.\n"
* "@lisp\n"
* "(remainder 13 4) @result{} 1\n"
* "(remainder -13 4) @result{} -1\n"
* "@end lisp"
*/
SCM
scm_remainder (SCM x, SCM y)
{
@ -306,7 +316,12 @@ scm_remainder (SCM x, SCM y)
SCM_GPROC (s_modulo, "modulo", 2, 0, 0, scm_modulo, g_modulo);
/* "Return the modulo of the numbers @var{x} and @var{y}.\n"
* "@lisp\n"
* "(modulo 13 4) @result{} 1\n"
* "(modulo -13 4) @result{} 3\n"
* "@end lisp"
*/
SCM
scm_modulo (SCM x, SCM y)
{
@ -349,7 +364,9 @@ scm_modulo (SCM x, SCM y)
SCM_GPROC1 (s_gcd, "gcd", scm_tc7_asubr, scm_gcd, g_gcd);
/* "Return the greatest common divisor of all arguments.\n"
* "If called without arguments, 0 is returned."
*/
SCM
scm_gcd (SCM x, SCM y)
{
@ -462,7 +479,9 @@ scm_gcd (SCM x, SCM y)
SCM_GPROC1 (s_lcm, "lcm", scm_tc7_asubr, scm_lcm, g_lcm);
/* "Return the least common multiple of the arguments.\n"
* "If called without arguments, 1 is returned."
*/
SCM
scm_lcm (SCM n1, SCM n2)
{
@ -1130,14 +1149,15 @@ SCM_DEFINE (scm_integer_expt, "integer-expt", 2, 0, 0,
SCM_DEFINE (scm_ash, "ash", 2, 0, 0,
(SCM n, SCM cnt),
"The function ash performs an arithmetic shift left by CNT bits\n"
"(or shift right, if CNT is negative). 'Arithmetic' means, that\n"
"the function does not guarantee to keep the bit structure of N,\n"
"but rather guarantees that the result will always be rounded\n"
"towards minus infinity. Therefore, the results of ash and a\n"
"corresponding bitwise shift will differ if N is negative.\n\n"
"The function ash performs an arithmetic shift left by @var{CNT}\n"
"bits (or shift right, if @var{cnt} is negative).\n"
"'Arithmetic' means, that the function does not guarantee to\n"
"keep the bit structure of @var{n}, but rather guarantees that\n"
"the result will always be rounded towards minus infinity.\n"
"Therefore, the results of ash and a corresponding bitwise\n"
"shift will differ if N is negative.\n\n"
"Formally, the function returns an integer equivalent to\n"
"@code{(inexact->exact (floor (* N (expt 2 CNT))))}.@refill\n\n"
"@code{(inexact->exact (floor (* @var{n} (expt 2 @var{cnt}))))}.\n\n"
"Example:\n"
"@lisp\n"
"(number->string (ash #b1 3) 2)\n"
@ -2265,8 +2285,8 @@ big2str (SCM b, unsigned int radix)
SCM_DEFINE (scm_number_to_string, "number->string", 1, 1, 0,
(SCM n, SCM radix),
"Return a string holding the external representation of the\n"
"number N in the given RADIX. If N is inexact, a radix of 10\n"
"will be used.")
"number @var{n} in the given @var{radix}. If @var{n} is\n"
"inexact, a radix of 10 will be used.")
#define FUNC_NAME s_scm_number_to_string
{
int base;
@ -2845,12 +2865,13 @@ scm_istring2number (char *str, long len, long radix)
SCM_DEFINE (scm_string_to_number, "string->number", 1, 1, 0,
(SCM string, SCM radix),
"Returns a number of the maximally precise representation\n"
"expressed by the given STRING. RADIX must be an exact integer,\n"
"either 2, 8, 10, or 16. If supplied, RADIX is a default radix\n"
"that may be overridden by an explicit radix prefix in STRING\n"
"(e.g. \"#o177\"). If RADIX is not supplied, then the default\n"
"radix is 10. If string is not a syntactically valid notation\n"
"for a number, then `string->number' returns #f. (r5rs)")
"expressed by the given @var{string}. @var{radix} must be an\n"
"exact integer, either 2, 8, 10, or 16. If supplied, @var{RADIX}\n"
"is a default radix that may be overridden by an explicit\n"
"radix prefix in @var{string} (e.g. \"#o177\"). If @var{radix}\n"
"is not supplied, then the default radix is 10. If string is\n"
"not a syntactically valid notation for a number, then\n"
"@code{string->number} returns @code{#f}. (r5rs)")
#define FUNC_NAME s_scm_string_to_number
{
SCM answer;
@ -2918,13 +2939,18 @@ scm_complex_equalp (SCM x, SCM y)
SCM_REGISTER_PROC (s_number_p, "number?", 1, 0, 0, scm_number_p);
/* "Return @code{#t} if @var{x} is a number, @code{#f}\n"
* "else. Note that the sets of complex, real, rational and\n"
* "integer values form subsets of the set of numbers, i. e. the\n"
* "predicate will be fulfilled for any number."
*/
SCM_DEFINE (scm_number_p, "complex?", 1, 0, 0,
(SCM x),
"Return #t if X is a complex number, #f else. Note that the\n"
"sets of real, rational and integer values form subsets of the\n"
"set of complex numbers, i. e. the predicate will also be\n"
"fulfilled if X is a real, rational or integer number.")
"Return @code{#t} if @var{x} is a complex number, @code{#f}\n"
"else. Note that the sets of real, rational and integer\n"
"values form subsets of the set of complex numbers, i. e. the\n"
"predicate will also be fulfilled if @var{x} is a real,\n"
"rational or integer number.")
#define FUNC_NAME s_scm_number_p
{
return SCM_BOOL (SCM_NUMBERP (x));
@ -2933,13 +2959,19 @@ SCM_DEFINE (scm_number_p, "complex?", 1, 0, 0,
SCM_REGISTER_PROC (s_real_p, "real?", 1, 0, 0, scm_real_p);
/* "Return @code{#t} if @var{x} is a real number, @code{#f} else.\n"
* "Note that the sets of integer and rational values form a subset\n"
* "of the set of real numbers, i. e. the predicate will also\n"
* "be fulfilled if @var{x} is an integer or a rational number."
*/
SCM_DEFINE (scm_real_p, "rational?", 1, 0, 0,
(SCM x),
"Return #t if X is a rational number, #f else. Note that the\n"
"set of integer values forms a subset of the set of rational\n"
"numbers, i. e. the predicate will also be fulfilled if X is an\n"
"integer number.")
"Return @code{#t} if @var{x} is a rational number, @code{#f}\n"
"else. Note that the set of integer values forms a subset of\n"
"the set of rational numbers, i. e. the predicate will also be\n"
"fulfilled if @var{x} is an integer number. Real numbers\n"
"will also satisfy this predicate, because of their limited\n"
"precision.")
#define FUNC_NAME s_scm_real_p
{
if (SCM_INUMP (x)) {
@ -2959,7 +2991,8 @@ SCM_DEFINE (scm_real_p, "rational?", 1, 0, 0,
SCM_DEFINE (scm_integer_p, "integer?", 1, 0, 0,
(SCM x),
"Return #t if X is an integer number, #f else.")
"Return @code{#t} if @var{x} is an integer number, @code{#f}\n"
"else.")
#define FUNC_NAME s_scm_integer_p
{
double r;
@ -2983,7 +3016,8 @@ SCM_DEFINE (scm_integer_p, "integer?", 1, 0, 0,
SCM_DEFINE (scm_inexact_p, "inexact?", 1, 0, 0,
(SCM x),
"Return #t if X is an inexact number, #f else.")
"Return @code{#t} if @var{x} is an inexact number, @code{#f}\n"
"else.")
#define FUNC_NAME s_scm_inexact_p
{
return SCM_BOOL (SCM_INEXACTP (x));
@ -2992,7 +3026,7 @@ SCM_DEFINE (scm_inexact_p, "inexact?", 1, 0, 0,
SCM_GPROC1 (s_eq_p, "=", scm_tc7_rpsubr, scm_num_eq_p, g_eq_p);
/* "Return @code{#t} if all parameters are numerically equal." */
SCM
scm_num_eq_p (SCM x, SCM y)
{
@ -3060,7 +3094,9 @@ scm_num_eq_p (SCM x, SCM y)
SCM_GPROC1 (s_less_p, "<", scm_tc7_rpsubr, scm_less_p, g_less_p);
/* "Return @code{#t} if the list of parameters is monotonically\n"
* "increasing."
*/
SCM
scm_less_p (SCM x, SCM y)
{
@ -3103,8 +3139,8 @@ scm_less_p (SCM x, SCM y)
SCM_GPROC1 (s_scm_gr_p, ">", scm_tc7_rpsubr, scm_gr_p, g_gr_p);
/* "Return #t if the list of parameters is monotonically\n"
* "increasing."
/* "Return @code{#t} if the list of parameters is monotonically\n"
* "decreasing."
*/
#define FUNC_NAME s_scm_gr_p
SCM
@ -3121,7 +3157,7 @@ scm_gr_p (SCM x, SCM y)
SCM_GPROC1 (s_scm_leq_p, "<=", scm_tc7_rpsubr, scm_leq_p, g_leq_p);
/* "Return #t if the list of parameters is monotonically\n"
/* "Return @code{#t} if the list of parameters is monotonically\n"
* "non-decreasing."
*/
#define FUNC_NAME s_scm_leq_p
@ -3139,7 +3175,7 @@ scm_leq_p (SCM x, SCM y)
SCM_GPROC1 (s_scm_geq_p, ">=", scm_tc7_rpsubr, scm_geq_p, g_geq_p);
/* "Return #t if the list of parameters is monotonically\n"
/* "Return @code{#t} if the list of parameters is monotonically\n"
* "non-increasing."
*/
#define FUNC_NAME s_scm_geq_p
@ -3157,7 +3193,9 @@ scm_geq_p (SCM x, SCM y)
SCM_GPROC (s_zero_p, "zero?", 1, 0, 0, scm_zero_p, g_zero_p);
/* "Return @code{#t} if @var{z} is an exact or inexact number equal to\n"
* "zero."
*/
SCM
scm_zero_p (SCM z)
{
@ -3177,7 +3215,9 @@ scm_zero_p (SCM z)
SCM_GPROC (s_positive_p, "positive?", 1, 0, 0, scm_positive_p, g_positive_p);
/* "Return @code{#t} if @var{x} is an exact or inexact number greater than\n"
* "zero."
*/
SCM
scm_positive_p (SCM x)
{
@ -3194,7 +3234,9 @@ scm_positive_p (SCM x)
SCM_GPROC (s_negative_p, "negative?", 1, 0, 0, scm_negative_p, g_negative_p);
/* "Return @code{#t} if @var{x} is an exact or inexact number less than\n"
* "zero."
*/
SCM
scm_negative_p (SCM x)
{
@ -3211,7 +3253,8 @@ scm_negative_p (SCM x)
SCM_GPROC1 (s_max, "max", scm_tc7_asubr, scm_max, g_max);
/* "Return the maximum of all parameter values."
*/
SCM
scm_max (SCM x, SCM y)
{
@ -3268,7 +3311,8 @@ scm_max (SCM x, SCM y)
SCM_GPROC1 (s_min, "min", scm_tc7_asubr, scm_min, g_min);
/* "Return the minium of all parameter values."
*/
SCM
scm_min (SCM x, SCM y)
{
@ -3325,7 +3369,9 @@ scm_min (SCM x, SCM y)
SCM_GPROC1 (s_sum, "+", scm_tc7_asubr, scm_sum, g_sum);
/* "Return the sum of all parameter values. Return 0 if called without\n"
* "any parameters."
*/
SCM
scm_sum (SCM x, SCM y)
{
@ -3430,7 +3476,10 @@ scm_sum (SCM x, SCM y)
SCM_GPROC1 (s_difference, "-", scm_tc7_asubr, scm_difference, g_difference);
/* "If called without arguments, 0 is returned. Otherwise the sum of\n"
* "all but the first argument are subtracted from the first\n"
* "argument."
*/
SCM
scm_difference (SCM x, SCM y)
{
@ -3556,7 +3605,9 @@ scm_difference (SCM x, SCM y)
SCM_GPROC1 (s_product, "*", scm_tc7_asubr, scm_product, g_product);
/* "Return the product of all arguments. If called without arguments,\n"
* "1 is returned."
*/
SCM
scm_product (SCM x, SCM y)
{
@ -3703,7 +3754,8 @@ scm_num2dbl (SCM a, const char *why)
SCM_GPROC1 (s_divide, "/", scm_tc7_asubr, scm_divide, g_divide);
/* "Divide the first argument by the product of the remaining arguments."
*/
SCM
scm_divide (SCM x, SCM y)
{
@ -3859,7 +3911,8 @@ scm_divide (SCM x, SCM y)
SCM_GPROC1 (s_asinh, "$asinh", scm_tc7_cxr, (SCM (*)()) scm_asinh, g_asinh);
/* "Return the inverse hyperbolic sine of @var{x}."
*/
double
scm_asinh (double x)
{
@ -3870,7 +3923,8 @@ scm_asinh (double x)
SCM_GPROC1 (s_acosh, "$acosh", scm_tc7_cxr, (SCM (*)()) scm_acosh, g_acosh);
/* "Return the inverse hyperbolic cosine of @var{x}."
*/
double
scm_acosh (double x)
{
@ -3881,7 +3935,8 @@ scm_acosh (double x)
SCM_GPROC1 (s_atanh, "$atanh", scm_tc7_cxr, (SCM (*)()) scm_atanh, g_atanh);
/* "Return the inverse hyperbolic tangent of @var{x}."
*/
double
scm_atanh (double x)
{
@ -3892,7 +3947,8 @@ scm_atanh (double x)
SCM_GPROC1 (s_truncate, "truncate", scm_tc7_cxr, (SCM (*)()) scm_truncate, g_truncate);
/* "Round the inexact number @var{x} towards zero."
*/
double
scm_truncate (double x)
{
@ -3904,7 +3960,9 @@ scm_truncate (double x)
SCM_GPROC1 (s_round, "round", scm_tc7_cxr, (SCM (*)()) scm_round, g_round);
/* "Round the inexact number @var{x}. If @var{x} is halfway between two\n"
* "numbers, round towards even."
*/
double
scm_round (double x)
{
@ -3918,7 +3976,8 @@ scm_round (double x)
SCM_GPROC1 (s_exact_to_inexact, "exact->inexact", scm_tc7_cxr, (SCM (*)()) scm_exact_to_inexact, g_exact_to_inexact);
/* Convert the number @var{x} to its inexact representation.\n"
*/
double
scm_exact_to_inexact (double z)
{
@ -3927,20 +3986,50 @@ scm_exact_to_inexact (double z)
SCM_GPROC1 (s_i_floor, "floor", scm_tc7_cxr, (SCM (*)()) floor, g_i_floor);
/* "Round the number @var{x} towards minus infinity."
*/
SCM_GPROC1 (s_i_ceil, "ceiling", scm_tc7_cxr, (SCM (*)()) ceil, g_i_ceil);
/* "Round the number @var{x} towards infinity."
*/
SCM_GPROC1 (s_i_sqrt, "$sqrt", scm_tc7_cxr, (SCM (*)()) sqrt, g_i_sqrt);
/* "Return the square root of the real number @var{x}."
*/
SCM_GPROC1 (s_i_abs, "$abs", scm_tc7_cxr, (SCM (*)()) fabs, g_i_abs);
/* "Return the absolute value of the real number @var{x}."
*/
SCM_GPROC1 (s_i_exp, "$exp", scm_tc7_cxr, (SCM (*)()) exp, g_i_exp);
/* "Return the @var{x}th power of e."
*/
SCM_GPROC1 (s_i_log, "$log", scm_tc7_cxr, (SCM (*)()) log, g_i_log);
/* "Return the natural logarithm of the real number@var{x}."
*/
SCM_GPROC1 (s_i_sin, "$sin", scm_tc7_cxr, (SCM (*)()) sin, g_i_sin);
/* "Return the sine of the real number @var{x}."
*/
SCM_GPROC1 (s_i_cos, "$cos", scm_tc7_cxr, (SCM (*)()) cos, g_i_cos);
/* "Return the cosine of the real number @var{x}."
*/
SCM_GPROC1 (s_i_tan, "$tan", scm_tc7_cxr, (SCM (*)()) tan, g_i_tan);
/* "Return the tangent of the real number @var{x}."
*/
SCM_GPROC1 (s_i_asin, "$asin", scm_tc7_cxr, (SCM (*)()) asin, g_i_asin);
/* "Return the arc sine of the real number @var{x}."
*/
SCM_GPROC1 (s_i_acos, "$acos", scm_tc7_cxr, (SCM (*)()) acos, g_i_acos);
/* "Return the arc cosine of the real number @var{x}."
*/
SCM_GPROC1 (s_i_atan, "$atan", scm_tc7_cxr, (SCM (*)()) atan, g_i_atan);
/* "Return the arc tangent of the real number @var{x}."
*/
SCM_GPROC1 (s_i_sinh, "$sinh", scm_tc7_cxr, (SCM (*)()) sinh, g_i_sinh);
/* "Return the hyperbolic sine of the real number @var{x}."
*/
SCM_GPROC1 (s_i_cosh, "$cosh", scm_tc7_cxr, (SCM (*)()) cosh, g_i_cosh);
/* "Return the hyperbolic cosine of the real number @var{x}."
*/
SCM_GPROC1 (s_i_tanh, "$tanh", scm_tc7_cxr, (SCM (*)()) tanh, g_i_tanh);
/* "Return the hyperbolic tangent of the real number @var{x}."
*/
struct dpair
{
@ -4008,8 +4097,8 @@ SCM_DEFINE (scm_sys_atan2, "$atan2", 2, 0, 0,
SCM_DEFINE (scm_make_rectangular, "make-rectangular", 2, 0, 0,
(SCM real, SCM imaginary),
"Return a complex number constructed of the given REAL and\n"
"IMAGINARY parts.")
"Return a complex number constructed of the given @var{real} and\n"
"@var{imaginary} parts.")
#define FUNC_NAME s_scm_make_rectangular
{
struct dpair xy;
@ -4022,7 +4111,7 @@ SCM_DEFINE (scm_make_rectangular, "make-rectangular", 2, 0, 0,
SCM_DEFINE (scm_make_polar, "make-polar", 2, 0, 0,
(SCM x, SCM y),
"Return the complex number X * e^(i * Y).")
"Return the complex number @var{x} * e^(i * @var{y}).")
#define FUNC_NAME s_scm_make_polar
{
struct dpair xy;
@ -4033,7 +4122,8 @@ SCM_DEFINE (scm_make_polar, "make-polar", 2, 0, 0,
SCM_GPROC (s_real_part, "real-part", 1, 0, 0, scm_real_part, g_real_part);
/* "Return the real part of the number @var{z}."
*/
SCM
scm_real_part (SCM z)
{
@ -4052,7 +4142,8 @@ scm_real_part (SCM z)
SCM_GPROC (s_imag_part, "imag-part", 1, 0, 0, scm_imag_part, g_imag_part);
/* "Return the imaginary part of the number @var{z}."
*/
SCM
scm_imag_part (SCM z)
{
@ -4071,7 +4162,9 @@ scm_imag_part (SCM z)
SCM_GPROC (s_magnitude, "magnitude", 1, 0, 0, scm_magnitude, g_magnitude);
/* "Return the magnitude of the number @var{z}. This is the same as\n"
* "@code{abs} for real arguments, but also allows complex numbers."
*/
SCM
scm_magnitude (SCM z)
{
@ -4107,7 +4200,8 @@ scm_magnitude (SCM z)
SCM_GPROC (s_angle, "angle", 1, 0, 0, scm_angle, g_angle);
/* "Return the angle of the complex number @var{z}."
*/
SCM
scm_angle (SCM z)
{
@ -4135,7 +4229,7 @@ scm_angle (SCM z)
SCM_DEFINE (scm_inexact_to_exact, "inexact->exact", 1, 0, 0,
(SCM z),
"Returns an exact number that is numerically closest to Z.")
"Returns an exact number that is numerically closest to @var{z}.")
#define FUNC_NAME s_scm_inexact_to_exact
{
if (SCM_INUMP (z)) {

View file

@ -56,11 +56,13 @@
SCM_DEFINE1 (scm_string_equal_p, "string=?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Lexicographic equality predicate; \n"
"Returns @t{#t} if the two strings are the same length and contain the same\n"
"characters in the same positions, otherwise returns @t{#f}. (r5rs)\n\n"
"@samp{String-ci=?} treats\n"
"upper and lower case letters as though they were the same character, but\n"
"@samp{string=?} treats upper and lower case as distinct characters.")
"Returns @code{#t} if the two strings are the same length and\n"
"contain the same characters in the same positions, otherwise\n"
"returns @code{#f}. (r5rs)\n\n"
"The procedure @code{string-ci=?} treats upper and lower case\n"
"letters as though they were the same character, but\n"
"@code{string=?} treats upper and lower case as distinct\n"
"characters.")
#define FUNC_NAME s_scm_string_equal_p
{
scm_sizet length;
@ -92,9 +94,10 @@ SCM_DEFINE1 (scm_string_equal_p, "string=?", scm_tc7_rpsubr,
SCM_DEFINE1 (scm_string_ci_equal_p, "string-ci=?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Case-insensitive string equality predicate; returns @t{#t} if\n"
"the two strings are the same length and their component characters\n"
"match (ignoring case) at each position; otherwise returns @t{#f}. (r5rs)")
"Case-insensitive string equality predicate; returns @code{#t}\n"
"if the two strings are the same length and their component\n"
"characters match (ignoring case) at each position; otherwise\n"
"returns @code{#f}. (r5rs)")
#define FUNC_NAME s_scm_string_ci_equal_p
{
scm_sizet length;
@ -150,8 +153,8 @@ string_less_p (SCM s1, SCM s2)
SCM_DEFINE1 (scm_string_less_p, "string<?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Lexicographic ordering predicate; returns @t{#t} if @var{s1}\n"
"is lexicographically less than @var{s2}. (r5rs)")
"Lexicographic ordering predicate; returns @code{#t} if\n"
"@var{s1} is lexicographically less than @var{s2}. (r5rs)")
#define FUNC_NAME s_scm_string_less_p
{
SCM_VALIDATE_STRING (1, s1);
@ -164,8 +167,9 @@ SCM_DEFINE1 (scm_string_less_p, "string<?", scm_tc7_rpsubr,
SCM_DEFINE1 (scm_string_leq_p, "string<=?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Lexicographic ordering predicate; returns @t{#t} if @var{s1}\n"
"is lexicographically less than or equal to @var{s2}. (r5rs)")
"Lexicographic ordering predicate; returns @code{#t} if\n"
"@var{s1} is lexicographically less than or equal to @var{s2}.\n"
"(r5rs)")
#define FUNC_NAME s_scm_string_leq_p
{
SCM_VALIDATE_STRING (1, s1);
@ -178,8 +182,8 @@ SCM_DEFINE1 (scm_string_leq_p, "string<=?", scm_tc7_rpsubr,
SCM_DEFINE1 (scm_string_gr_p, "string>?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Lexicographic ordering predicate; returns @t{#t} if @var{s1}\n"
"is lexicographically greater than @var{s2}. (r5rs)")
"Lexicographic ordering predicate; returns @code{#t} if\n"
"@var{s1} is lexicographically greater than @var{s2}. (r5rs)")
#define FUNC_NAME s_scm_string_gr_p
{
SCM_VALIDATE_STRING (1, s1);
@ -192,8 +196,9 @@ SCM_DEFINE1 (scm_string_gr_p, "string>?", scm_tc7_rpsubr,
SCM_DEFINE1 (scm_string_geq_p, "string>=?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Lexicographic ordering predicate; returns @t{#t} if @var{s1}\n"
"is lexicographically greater than or equal to @var{s2}. (r5rs)")
"Lexicographic ordering predicate; returns @code{#t} if\n"
"@var{s1} is lexicographically greater than or equal to\n"
"@var{s2}. (r5rs)")
#define FUNC_NAME s_scm_string_geq_p
{
SCM_VALIDATE_STRING (1, s1);
@ -230,8 +235,8 @@ string_ci_less_p (SCM s1, SCM s2)
SCM_DEFINE1 (scm_string_ci_less_p, "string-ci<?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Case insensitive lexicographic ordering predicate; \n"
"returns @t{#t} if @var{s1} is lexicographically less than\n"
"Case insensitive lexicographic ordering predicate;\n"
"returns @code{#t} if @var{s1} is lexicographically less than\n"
"@var{s2} regardless of case. (r5rs)")
#define FUNC_NAME s_scm_string_ci_less_p
{
@ -245,8 +250,8 @@ SCM_DEFINE1 (scm_string_ci_less_p, "string-ci<?", scm_tc7_rpsubr,
SCM_DEFINE1 (scm_string_ci_leq_p, "string-ci<=?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Case insensitive lexicographic ordering predicate; \n"
"returns @t{#t} if @var{s1} is lexicographically less than\n"
"Case insensitive lexicographic ordering predicate;\n"
"returns @code{#t} if @var{s1} is lexicographically less than\n"
"or equal to @var{s2} regardless of case. (r5rs)")
#define FUNC_NAME s_scm_string_ci_leq_p
{
@ -260,9 +265,9 @@ SCM_DEFINE1 (scm_string_ci_leq_p, "string-ci<=?", scm_tc7_rpsubr,
SCM_DEFINE1 (scm_string_ci_gr_p, "string-ci>?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Case insensitive lexicographic ordering predicate; \n"
"returns @t{#t} if @var{s1} is lexicographically greater than\n"
"@var{s2} regardless of case. (r5rs)")
"Case insensitive lexicographic ordering predicate;\n"
"returns @code{#t} if @var{s1} is lexicographically greater\n"
"than @var{s2} regardless of case. (r5rs)")
#define FUNC_NAME s_scm_string_ci_gr_p
{
SCM_VALIDATE_STRING (1, s1);
@ -275,9 +280,9 @@ SCM_DEFINE1 (scm_string_ci_gr_p, "string-ci>?", scm_tc7_rpsubr,
SCM_DEFINE1 (scm_string_ci_geq_p, "string-ci>=?", scm_tc7_rpsubr,
(SCM s1, SCM s2),
"Case insensitive lexicographic ordering predicate; \n"
"returns @t{#t} if @var{s1} is lexicographically greater than\n"
"or equal to @var{s2} regardless of case. (r5rs)")
"Case insensitive lexicographic ordering predicate;\n"
"returns @code{#t} if @var{s1} is lexicographically greater\n"
"than or equal to @var{s2} regardless of case. (r5rs)")
#define FUNC_NAME s_scm_string_ci_geq_p
{
SCM_VALIDATE_STRING (1, s1);

View file

@ -396,9 +396,10 @@ scm_eval_0str (const char *expr)
SCM_DEFINE (scm_eval_string, "eval-string", 1, 0, 0,
(SCM string),
"Evaluate @var{string} as the text representation of a Scheme form\n"
"or forms, and return whatever value they produce.\n"
"Evaluation takes place in (interaction-environment).")
"Evaluate @var{string} as the text representation of a Scheme\n"
"form or forms, and return whatever value they produce.\n"
"Evaluation takes place in the environment returned by the\n"
"procedure @code{interaction-environment}.")
#define FUNC_NAME s_scm_eval_string
{
SCM port = scm_mkstrport (SCM_INUM0, string, SCM_OPN | SCM_RDNG,

View file

@ -236,7 +236,8 @@ scm_struct_init (SCM handle, SCM layout, scm_bits_t * mem, int tail_elts, SCM in
SCM_DEFINE (scm_struct_p, "struct?", 1, 0, 0,
(SCM x),
"Return #t iff @var{obj} is a structure object, else #f.")
"Return @code{#t} iff @var{obj} is a structure object, else\n"
"@code{#f}.")
#define FUNC_NAME s_scm_struct_p
{
return SCM_BOOL(SCM_STRUCTP (x));
@ -245,7 +246,7 @@ SCM_DEFINE (scm_struct_p, "struct?", 1, 0, 0,
SCM_DEFINE (scm_struct_vtable_p, "struct-vtable?", 1, 0, 0,
(SCM x),
"Return #t iff obj is a vtable structure.")
"Return @code{#t} iff obj is a vtable structure.")
#define FUNC_NAME s_scm_struct_vtable_p
{
SCM layout;

View file

@ -402,7 +402,8 @@ scm_symbol_value0 (const char *name)
SCM_DEFINE (scm_symbol_p, "symbol?", 1, 0, 0,
(SCM obj),
"Returns @t{#t} if @var{obj} is a symbol, otherwise returns @t{#f}. (r5rs)")
"Returns @code{#t} if @var{obj} is a symbol, otherwise returns\n"
"@code{#f}. (r5rs)")
#define FUNC_NAME s_scm_symbol_p
{
return SCM_BOOL (SCM_SYMBOLP (obj));
@ -411,28 +412,27 @@ SCM_DEFINE (scm_symbol_p, "symbol?", 1, 0, 0,
SCM_DEFINE (scm_symbol_to_string, "symbol->string", 1, 0, 0,
(SCM s),
"Returns the name of @var{symbol} as a string. If the symbol was part of\n"
"an object returned as the value of a literal expression (section\n"
"@pxref{Literal expressions,,,r4rs, The Revised^4 Report on Scheme}) or\n"
"by a call to the @samp{read} procedure, and its name contains alphabetic\n"
"characters, then the string returned will contain characters in the\n"
"implementation's preferred standard case---some implementations will\n"
"prefer upper case, others lower case. If the symbol was returned by\n"
"@samp{string->symbol}, the case of characters in the string returned\n"
"will be the same as the case in the string that was passed to\n"
"@samp{string->symbol}. It is an error to apply mutation procedures like\n"
"@code{string-set!} to strings returned by this procedure. (r5rs)\n\n"
"The following examples assume that the implementation's standard case is\n"
"lower case:\n\n"
"@format\n"
"@t{(symbol->string 'flying-fish) \n"
" ==> \"flying-fish\"\n"
"(symbol->string 'Martin) ==> \"martin\"\n"
"Returns the name of @var{symbol} as a string. If the symbol\n"
"was part of an object returned as the value of a literal\n"
"expression (section @pxref{Literal expressions,,,r4rs, The\n"
"Revised^4 Report on Scheme}) or by a call to the @code{read}\n"
"procedure, and its name contains alphabetic characters, then\n"
"the string returned will contain characters in the\n"
"implementation's preferred standard case---some implementations\n"
"will prefer upper case, others lower case. If the symbol was\n"
"returned by @code{string->symbol}, the case of characters in\n"
"the string returned will be the same as the case in the string\n"
"that was passed to @code{string->symbol}. It is an error to\n"
"apply mutation procedures like @code{string-set!} to strings\n"
"returned by this procedure. (r5rs)\n\n"
"The following examples assume that the implementation's\n"
"standard case is lower case:\n\n"
"@lisp\n"
"(symbol->string 'flying-fish) @result{} \"flying-fish\"\n"
"(symbol->string 'Martin) @result{} \"martin\"\n"
"(symbol->string\n"
" (string->symbol \"Malvina\")) \n"
" ==> \"Malvina\"\n"
"}\n"
"@end format")
" (string->symbol \"Malvina\")) @result{} \"Malvina\"\n"
"@end lisp")
#define FUNC_NAME s_scm_symbol_to_string
{
SCM_VALIDATE_SYMBOL (1, s);
@ -443,31 +443,23 @@ SCM_DEFINE (scm_symbol_to_string, "symbol->string", 1, 0, 0,
SCM_DEFINE (scm_string_to_symbol, "string->symbol", 1, 0, 0,
(SCM s),
"Returns the symbol whose name is @var{string}. This procedure can\n"
"create symbols with names containing special characters or letters in\n"
"the non-standard case, but it is usually a bad idea to create such\n"
"symbols because in some implementations of Scheme they cannot be read as\n"
"themselves. See @samp{symbol->string}.\n\n"
"The following examples assume that the implementation's standard case is\n"
"lower case:\n\n"
"@format\n"
"@t{(eq? 'mISSISSIppi 'mississippi) \n"
" ==> #t\n"
"(string->symbol \"mISSISSIppi\") \n"
" ==>\n"
" @r{}the symbol with name \"mISSISSIppi\"\n"
"(eq? 'bitBlt (string->symbol \"bitBlt\")) \n"
" ==> #f\n"
"(eq? 'JollyWog\n"
" (string->symbol\n"
" (symbol->string 'JollyWog))) \n"
" ==> #t\n"
"(string=? \"K. Harper, M.D.\"\n"
" (symbol->string\n"
" (string->symbol \"K. Harper, M.D.\"))) \n"
" ==> #t\n"
"}\n"
"@end format")
"Returns the symbol whose name is @var{string}. This procedure\n"
"can create symbols with names containing special characters or\n"
"letters in the non-standard case, but it is usually a bad idea\n"
"to create such because in some implementations of Scheme they\n"
"cannot be read as themselves. See @code{symbol->string}.\n\n"
"The following examples assume that the implementation's\n"
"standard case is lower case:\n\n"
"@lisp\n"
"(eq? 'mISSISSIppi 'mississippi) @result{} #t\n"
"(string->symbol \"mISSISSIppi\") @result{} @r{the symbol with name \"mISSISSIppi\"}\n"
"(eq? 'bitBlt (string->symbol \"bitBlt\")) @result{} #f\n"
"(eq? 'JollyWog\n"
" (string->symbol (symbol->string 'JollyWog))) @result{} #t\n"
"(string=? \"K. Harper, M.D.\"\n"
" (symbol->string\n"
" (string->symbol \"K. Harper, M.D.\"))) @result{}#t\n"
"@end lisp")
#define FUNC_NAME s_scm_string_to_symbol
{
SCM_VALIDATE_STRING (1, s);

View file

@ -139,7 +139,8 @@ scm_vector_set_length_x (SCM vect, SCM len)
SCM_DEFINE (scm_vector_p, "vector?", 1, 0, 0,
(SCM obj),
"Returns @t{#t} if @var{obj} is a vector, otherwise returns @t{#f}. (r5rs)")
"Returns @code{#t} if @var{obj} is a vector, otherwise returns\n"
"@code{#f}. (r5rs)")
#define FUNC_NAME s_scm_vector_p
{
if (SCM_IMP (obj))
@ -160,24 +161,21 @@ scm_vector_length (SCM v)
SCM_REGISTER_PROC (s_list_to_vector, "list->vector", 1, 0, 0, scm_vector);
/*
"@samp{List->vector} returns a newly\n"
"created vector initialized to the elements of the list @var{list}.\n\n"
"@format\n"
"@t{(vector->list '#(dah dah didah))\n"
"=> (dah dah didah)\n"
"list->vector '(dididit dah))\n"
"=> #(dididit dah)\n"
"}\n"
"@end format")
"Return a newly created vector initialized to the elements of"
"the list @var{list}.\n\n"
"@lisp\n"
"(vector->list '#(dah dah didah)) @result{} (dah dah didah)\n"
"(list->vector '(dididit dah)) @result{} #(dididit dah)\n"
"@end lisp")
*/
SCM_DEFINE (scm_vector, "vector", 0, 0, 1,
(SCM l),
"@deffnx primitive list->vector l\n"
"Returns a newly allocated vector whose elements contain the given\n"
"arguments. Analogous to @samp{list}. (r5rs)\n\n"
"@format\n"
"@t{(vector 'a 'b 'c) ==> #(a b c) }\n"
"@end format")
"Returns a newly allocated vector whose elements contain the\n"
"given arguments. Analogous to @code{list}. (r5rs)\n\n"
"@lisp\n"
"(vector 'a 'b 'c) @result{} #(a b c)\n"
"@end lisp")
#define FUNC_NAME s_scm_vector
{
SCM res;
@ -198,18 +196,14 @@ SCM_GPROC (s_vector_ref, "vector-ref", 2, 0, 0, scm_vector_ref, g_vector_ref);
"@var{k} must be a valid index of @var{vector}.\n"
"@samp{Vector-ref} returns the contents of element @var{k} of\n"
"@var{vector}.\n\n"
"@format\n"
"@t{(vector-ref '#(1 1 2 3 5 8 13 21)\n"
" 5)\n"
" ==> 8\n"
"@lisp\n"
"(vector-ref '#(1 1 2 3 5 8 13 21) 5) @result{} 8\n"
"(vector-ref '#(1 1 2 3 5 8 13 21)\n"
" (let ((i (round (* 2 (acos -1)))))\n"
" (if (inexact? i)\n"
" (inexact->exact i)\n"
" i))) \n"
" ==> 13\n"
"}\n"
"@end format"
" i))) @result{} 13\n"
"@end lisp"
*/
SCM
@ -227,23 +221,15 @@ scm_vector_ref (SCM v, SCM k)
SCM_GPROC (s_vector_set_x, "vector-set!", 3, 0, 0, scm_vector_set_x, g_vector_set_x);
/* (r5rs)
@var{k} must be a valid index of @var{vector}.
@samp{Vector-set!} stores @var{obj} in element @var{k} of @var{vector}.
The value returned by @samp{vector-set!} is unspecified.
@c <!>
@format
@t{(let ((vec (vector 0 '(2 2 2 2) "Anna")))
(vector-set! vec 1 '("Sue" "Sue"))
vec)
==> #(0 ("Sue" "Sue") "Anna")
(vector-set! '#(0 1 2) 1 "doe")
==> @emph{error} ; constant vector
}
@end format
/* "@var{k} must be a valid index of @var{vector}.\n"
"@code{Vector-set!} stores @var{obj} in element @var{k} of @var{vector}.\n"
"The value returned by @samp{vector-set!} is unspecified.\n"
"@lisp\n"
"(let ((vec (vector 0 '(2 2 2 2) "Anna")))\n"
" (vector-set! vec 1 '("Sue" "Sue"))\n"
" vec) @result{} #(0 ("Sue" "Sue") "Anna")\n"
"(vector-set! '#(0 1 2) 1 "doe") @result{} @emph{error} ; constant vector\n"
"@end lisp"
*/
SCM
@ -318,15 +304,12 @@ scm_c_make_vector (unsigned long int k, SCM fill)
SCM_DEFINE (scm_vector_to_list, "vector->list", 1, 0, 0,
(SCM v),
"@samp{Vector->list} returns a newly allocated list of the objects contained\n"
"in the elements of @var{vector}. (r5rs)\n\n"
"@format\n"
"@t{(vector->list '#(dah dah didah))\n"
"=> (dah dah didah)\n"
"list->vector '(dididit dah))\n"
"=> #(dididit dah)\n"
"}\n"
"@end format")
"@samp{Vector->list} returns a newly allocated list of the\n"
"objects contained in the elements of @var{vector}. (r5rs)\n\n"
"@lisp\n"
"(vector->list '#(dah dah didah)) @result{} (dah dah didah)\n"
"(list->vector '(dididit dah)) @result{} #(dididit dah)\n"
"@end lisp")
#define FUNC_NAME s_scm_vector_to_list
{
SCM res = SCM_EOL;
@ -343,7 +326,7 @@ SCM_DEFINE (scm_vector_to_list, "vector->list", 1, 0, 0,
SCM_DEFINE (scm_vector_fill_x, "vector-fill!", 2, 0, 0,
(SCM v, SCM fill_x),
"Stores @var{fill} in every element of @var{vector}.\n"
"The value returned by @samp{vector-fill!} is unspecified. (r5rs)")
"The value returned by @code{vector-fill!} is unspecified. (r5rs)")
#define FUNC_NAME s_scm_vector_fill_x
{
register long i;