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_DEFINE (scm_exact_p, "exact?", 1, 0, 0,
(SCM x), (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 #define FUNC_NAME s_scm_exact_p
{ {
if (SCM_INUMP (x)) { 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_DEFINE (scm_odd_p, "odd?", 1, 0, 0,
(SCM n), (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 #define FUNC_NAME s_scm_odd_p
{ {
if (SCM_INUMP (n)) { 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_DEFINE (scm_even_p, "even?", 1, 0, 0,
(SCM n), (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 #define FUNC_NAME s_scm_even_p
{ {
if (SCM_INUMP (n)) { 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); SCM_GPROC (s_abs, "abs", 1, 0, 0, scm_abs, g_abs);
/* "Return the absolute value of @var{x}."
*/
SCM SCM
scm_abs (SCM x) scm_abs (SCM x)
{ {
@ -182,7 +186,8 @@ scm_abs (SCM x)
SCM_GPROC (s_quotient, "quotient", 2, 0, 0, scm_quotient, g_quotient); 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
scm_quotient (SCM x, SCM y) 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); 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
scm_remainder (SCM x, SCM y) 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); 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
scm_modulo (SCM x, SCM y) 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); 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
scm_gcd (SCM x, SCM y) 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); 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
scm_lcm (SCM n1, SCM n2) 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_DEFINE (scm_ash, "ash", 2, 0, 0,
(SCM n, SCM cnt), (SCM n, SCM cnt),
"The function ash performs an arithmetic shift left by CNT bits\n" "The function ash performs an arithmetic shift left by @var{CNT}\n"
"(or shift right, if CNT is negative). 'Arithmetic' means, that\n" "bits (or shift right, if @var{cnt} is negative).\n"
"the function does not guarantee to keep the bit structure of N,\n" "'Arithmetic' means, that the function does not guarantee to\n"
"but rather guarantees that the result will always be rounded\n" "keep the bit structure of @var{n}, but rather guarantees that\n"
"towards minus infinity. Therefore, the results of ash and a\n" "the result will always be rounded towards minus infinity.\n"
"corresponding bitwise shift will differ if N is negative.\n\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" "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" "Example:\n"
"@lisp\n" "@lisp\n"
"(number->string (ash #b1 3) 2)\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_DEFINE (scm_number_to_string, "number->string", 1, 1, 0,
(SCM n, SCM radix), (SCM n, SCM radix),
"Return a string holding the external representation of the\n" "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" "number @var{n} in the given @var{radix}. If @var{n} is\n"
"will be used.") "inexact, a radix of 10 will be used.")
#define FUNC_NAME s_scm_number_to_string #define FUNC_NAME s_scm_number_to_string
{ {
int base; 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_DEFINE (scm_string_to_number, "string->number", 1, 1, 0,
(SCM string, SCM radix), (SCM string, SCM radix),
"Returns a number of the maximally precise representation\n" "Returns a number of the maximally precise representation\n"
"expressed by the given STRING. RADIX must be an exact integer,\n" "expressed by the given @var{string}. @var{radix} must be an\n"
"either 2, 8, 10, or 16. If supplied, RADIX is a default radix\n" "exact integer, either 2, 8, 10, or 16. If supplied, @var{RADIX}\n"
"that may be overridden by an explicit radix prefix in STRING\n" "is a default radix that may be overridden by an explicit\n"
"(e.g. \"#o177\"). If RADIX is not supplied, then the default\n" "radix prefix in @var{string} (e.g. \"#o177\"). If @var{radix}\n"
"radix is 10. If string is not a syntactically valid notation\n" "is not supplied, then the default radix is 10. If string is\n"
"for a number, then `string->number' returns #f. (r5rs)") "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 #define FUNC_NAME s_scm_string_to_number
{ {
SCM answer; 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); 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_DEFINE (scm_number_p, "complex?", 1, 0, 0,
(SCM x), (SCM x),
"Return #t if X is a complex number, #f else. Note that the\n" "Return @code{#t} if @var{x} is a complex number, @code{#f}\n"
"sets of real, rational and integer values form subsets of the\n" "else. Note that the sets of real, rational and integer\n"
"set of complex numbers, i. e. the predicate will also be\n" "values form subsets of the set of complex numbers, i. e. the\n"
"fulfilled if X is a real, rational or integer number.") "predicate will also be fulfilled if @var{x} is a real,\n"
"rational or integer number.")
#define FUNC_NAME s_scm_number_p #define FUNC_NAME s_scm_number_p
{ {
return SCM_BOOL (SCM_NUMBERP (x)); 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); 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_DEFINE (scm_real_p, "rational?", 1, 0, 0,
(SCM x), (SCM x),
"Return #t if X is a rational number, #f else. Note that the\n" "Return @code{#t} if @var{x} is a rational number, @code{#f}\n"
"set of integer values forms a subset of the set of rational\n" "else. Note that the set of integer values forms a subset of\n"
"numbers, i. e. the predicate will also be fulfilled if X is an\n" "the set of rational numbers, i. e. the predicate will also be\n"
"integer number.") "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 #define FUNC_NAME s_scm_real_p
{ {
if (SCM_INUMP (x)) { 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_DEFINE (scm_integer_p, "integer?", 1, 0, 0,
(SCM x), (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 #define FUNC_NAME s_scm_integer_p
{ {
double r; 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_DEFINE (scm_inexact_p, "inexact?", 1, 0, 0,
(SCM x), (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 #define FUNC_NAME s_scm_inexact_p
{ {
return SCM_BOOL (SCM_INEXACTP (x)); 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); 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
scm_num_eq_p (SCM x, SCM y) 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); 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
scm_less_p (SCM x, SCM y) 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); 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" /* "Return @code{#t} if the list of parameters is monotonically\n"
* "increasing." * "decreasing."
*/ */
#define FUNC_NAME s_scm_gr_p #define FUNC_NAME s_scm_gr_p
SCM 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); 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." * "non-decreasing."
*/ */
#define FUNC_NAME s_scm_leq_p #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); 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." * "non-increasing."
*/ */
#define FUNC_NAME s_scm_geq_p #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); 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
scm_zero_p (SCM z) 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); 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
scm_positive_p (SCM x) 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); 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
scm_negative_p (SCM x) 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); SCM_GPROC1 (s_max, "max", scm_tc7_asubr, scm_max, g_max);
/* "Return the maximum of all parameter values."
*/
SCM SCM
scm_max (SCM x, SCM y) 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); SCM_GPROC1 (s_min, "min", scm_tc7_asubr, scm_min, g_min);
/* "Return the minium of all parameter values."
*/
SCM SCM
scm_min (SCM x, SCM y) 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); 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
scm_sum (SCM x, SCM y) 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); 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
scm_difference (SCM x, SCM y) 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); 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
scm_product (SCM x, SCM y) 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); SCM_GPROC1 (s_divide, "/", scm_tc7_asubr, scm_divide, g_divide);
/* "Divide the first argument by the product of the remaining arguments."
*/
SCM SCM
scm_divide (SCM x, SCM y) 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); SCM_GPROC1 (s_asinh, "$asinh", scm_tc7_cxr, (SCM (*)()) scm_asinh, g_asinh);
/* "Return the inverse hyperbolic sine of @var{x}."
*/
double double
scm_asinh (double x) 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); SCM_GPROC1 (s_acosh, "$acosh", scm_tc7_cxr, (SCM (*)()) scm_acosh, g_acosh);
/* "Return the inverse hyperbolic cosine of @var{x}."
*/
double double
scm_acosh (double x) 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); SCM_GPROC1 (s_atanh, "$atanh", scm_tc7_cxr, (SCM (*)()) scm_atanh, g_atanh);
/* "Return the inverse hyperbolic tangent of @var{x}."
*/
double double
scm_atanh (double x) 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); SCM_GPROC1 (s_truncate, "truncate", scm_tc7_cxr, (SCM (*)()) scm_truncate, g_truncate);
/* "Round the inexact number @var{x} towards zero."
*/
double double
scm_truncate (double x) 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); 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 double
scm_round (double x) 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); 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 double
scm_exact_to_inexact (double z) 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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 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_DEFINE (scm_make_rectangular, "make-rectangular", 2, 0, 0,
(SCM real, SCM imaginary), (SCM real, SCM imaginary),
"Return a complex number constructed of the given REAL and\n" "Return a complex number constructed of the given @var{real} and\n"
"IMAGINARY parts.") "@var{imaginary} parts.")
#define FUNC_NAME s_scm_make_rectangular #define FUNC_NAME s_scm_make_rectangular
{ {
struct dpair xy; 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_DEFINE (scm_make_polar, "make-polar", 2, 0, 0,
(SCM x, SCM y), (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 #define FUNC_NAME s_scm_make_polar
{ {
struct dpair xy; 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); 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
scm_real_part (SCM z) 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); 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
scm_imag_part (SCM z) 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); 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
scm_magnitude (SCM z) scm_magnitude (SCM z)
{ {
@ -4107,7 +4200,8 @@ scm_magnitude (SCM z)
SCM_GPROC (s_angle, "angle", 1, 0, 0, scm_angle, g_angle); SCM_GPROC (s_angle, "angle", 1, 0, 0, scm_angle, g_angle);
/* "Return the angle of the complex number @var{z}."
*/
SCM SCM
scm_angle (SCM z) scm_angle (SCM z)
{ {
@ -4135,7 +4229,7 @@ scm_angle (SCM z)
SCM_DEFINE (scm_inexact_to_exact, "inexact->exact", 1, 0, 0, SCM_DEFINE (scm_inexact_to_exact, "inexact->exact", 1, 0, 0,
(SCM z), (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 #define FUNC_NAME s_scm_inexact_to_exact
{ {
if (SCM_INUMP (z)) { if (SCM_INUMP (z)) {

View file

@ -56,11 +56,13 @@
SCM_DEFINE1 (scm_string_equal_p, "string=?", scm_tc7_rpsubr, SCM_DEFINE1 (scm_string_equal_p, "string=?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Lexicographic equality predicate; \n" "Lexicographic equality predicate; \n"
"Returns @t{#t} if the two strings are the same length and contain the same\n" "Returns @code{#t} if the two strings are the same length and\n"
"characters in the same positions, otherwise returns @t{#f}. (r5rs)\n\n" "contain the same characters in the same positions, otherwise\n"
"@samp{String-ci=?} treats\n" "returns @code{#f}. (r5rs)\n\n"
"upper and lower case letters as though they were the same character, but\n" "The procedure @code{string-ci=?} treats upper and lower case\n"
"@samp{string=?} treats upper and lower case as distinct characters.") "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 #define FUNC_NAME s_scm_string_equal_p
{ {
scm_sizet length; 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_DEFINE1 (scm_string_ci_equal_p, "string-ci=?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Case-insensitive string equality predicate; returns @t{#t} if\n" "Case-insensitive string equality predicate; returns @code{#t}\n"
"the two strings are the same length and their component characters\n" "if the two strings are the same length and their component\n"
"match (ignoring case) at each position; otherwise returns @t{#f}. (r5rs)") "characters match (ignoring case) at each position; otherwise\n"
"returns @code{#f}. (r5rs)")
#define FUNC_NAME s_scm_string_ci_equal_p #define FUNC_NAME s_scm_string_ci_equal_p
{ {
scm_sizet length; 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_DEFINE1 (scm_string_less_p, "string<?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Lexicographic ordering predicate; returns @t{#t} if @var{s1}\n" "Lexicographic ordering predicate; returns @code{#t} if\n"
"is lexicographically less than @var{s2}. (r5rs)") "@var{s1} is lexicographically less than @var{s2}. (r5rs)")
#define FUNC_NAME s_scm_string_less_p #define FUNC_NAME s_scm_string_less_p
{ {
SCM_VALIDATE_STRING (1, s1); 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_DEFINE1 (scm_string_leq_p, "string<=?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Lexicographic ordering predicate; returns @t{#t} if @var{s1}\n" "Lexicographic ordering predicate; returns @code{#t} if\n"
"is lexicographically less than or equal to @var{s2}. (r5rs)") "@var{s1} is lexicographically less than or equal to @var{s2}.\n"
"(r5rs)")
#define FUNC_NAME s_scm_string_leq_p #define FUNC_NAME s_scm_string_leq_p
{ {
SCM_VALIDATE_STRING (1, s1); 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_DEFINE1 (scm_string_gr_p, "string>?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Lexicographic ordering predicate; returns @t{#t} if @var{s1}\n" "Lexicographic ordering predicate; returns @code{#t} if\n"
"is lexicographically greater than @var{s2}. (r5rs)") "@var{s1} is lexicographically greater than @var{s2}. (r5rs)")
#define FUNC_NAME s_scm_string_gr_p #define FUNC_NAME s_scm_string_gr_p
{ {
SCM_VALIDATE_STRING (1, s1); 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_DEFINE1 (scm_string_geq_p, "string>=?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Lexicographic ordering predicate; returns @t{#t} if @var{s1}\n" "Lexicographic ordering predicate; returns @code{#t} if\n"
"is lexicographically greater than or equal to @var{s2}. (r5rs)") "@var{s1} is lexicographically greater than or equal to\n"
"@var{s2}. (r5rs)")
#define FUNC_NAME s_scm_string_geq_p #define FUNC_NAME s_scm_string_geq_p
{ {
SCM_VALIDATE_STRING (1, s1); SCM_VALIDATE_STRING (1, s1);
@ -231,7 +236,7 @@ string_ci_less_p (SCM s1, SCM s2)
SCM_DEFINE1 (scm_string_ci_less_p, "string-ci<?", scm_tc7_rpsubr, SCM_DEFINE1 (scm_string_ci_less_p, "string-ci<?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Case insensitive lexicographic ordering predicate;\n" "Case insensitive lexicographic ordering predicate;\n"
"returns @t{#t} if @var{s1} is lexicographically less than\n" "returns @code{#t} if @var{s1} is lexicographically less than\n"
"@var{s2} regardless of case. (r5rs)") "@var{s2} regardless of case. (r5rs)")
#define FUNC_NAME s_scm_string_ci_less_p #define FUNC_NAME s_scm_string_ci_less_p
{ {
@ -246,7 +251,7 @@ 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_DEFINE1 (scm_string_ci_leq_p, "string-ci<=?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Case insensitive lexicographic ordering predicate;\n" "Case insensitive lexicographic ordering predicate;\n"
"returns @t{#t} if @var{s1} is lexicographically less than\n" "returns @code{#t} if @var{s1} is lexicographically less than\n"
"or equal to @var{s2} regardless of case. (r5rs)") "or equal to @var{s2} regardless of case. (r5rs)")
#define FUNC_NAME s_scm_string_ci_leq_p #define FUNC_NAME s_scm_string_ci_leq_p
{ {
@ -261,8 +266,8 @@ 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_DEFINE1 (scm_string_ci_gr_p, "string-ci>?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Case insensitive lexicographic ordering predicate;\n" "Case insensitive lexicographic ordering predicate;\n"
"returns @t{#t} if @var{s1} is lexicographically greater than\n" "returns @code{#t} if @var{s1} is lexicographically greater\n"
"@var{s2} regardless of case. (r5rs)") "than @var{s2} regardless of case. (r5rs)")
#define FUNC_NAME s_scm_string_ci_gr_p #define FUNC_NAME s_scm_string_ci_gr_p
{ {
SCM_VALIDATE_STRING (1, s1); SCM_VALIDATE_STRING (1, s1);
@ -276,8 +281,8 @@ 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_DEFINE1 (scm_string_ci_geq_p, "string-ci>=?", scm_tc7_rpsubr,
(SCM s1, SCM s2), (SCM s1, SCM s2),
"Case insensitive lexicographic ordering predicate;\n" "Case insensitive lexicographic ordering predicate;\n"
"returns @t{#t} if @var{s1} is lexicographically greater than\n" "returns @code{#t} if @var{s1} is lexicographically greater\n"
"or equal to @var{s2} regardless of case. (r5rs)") "than or equal to @var{s2} regardless of case. (r5rs)")
#define FUNC_NAME s_scm_string_ci_geq_p #define FUNC_NAME s_scm_string_ci_geq_p
{ {
SCM_VALIDATE_STRING (1, s1); 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_DEFINE (scm_eval_string, "eval-string", 1, 0, 0,
(SCM string), (SCM string),
"Evaluate @var{string} as the text representation of a Scheme form\n" "Evaluate @var{string} as the text representation of a Scheme\n"
"or forms, and return whatever value they produce.\n" "form or forms, and return whatever value they produce.\n"
"Evaluation takes place in (interaction-environment).") "Evaluation takes place in the environment returned by the\n"
"procedure @code{interaction-environment}.")
#define FUNC_NAME s_scm_eval_string #define FUNC_NAME s_scm_eval_string
{ {
SCM port = scm_mkstrport (SCM_INUM0, string, SCM_OPN | SCM_RDNG, 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_DEFINE (scm_struct_p, "struct?", 1, 0, 0,
(SCM x), (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 #define FUNC_NAME s_scm_struct_p
{ {
return SCM_BOOL(SCM_STRUCTP (x)); 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_DEFINE (scm_struct_vtable_p, "struct-vtable?", 1, 0, 0,
(SCM x), (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 #define FUNC_NAME s_scm_struct_vtable_p
{ {
SCM layout; SCM layout;

View file

@ -402,7 +402,8 @@ scm_symbol_value0 (const char *name)
SCM_DEFINE (scm_symbol_p, "symbol?", 1, 0, 0, SCM_DEFINE (scm_symbol_p, "symbol?", 1, 0, 0,
(SCM obj), (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 #define FUNC_NAME s_scm_symbol_p
{ {
return SCM_BOOL (SCM_SYMBOLP (obj)); 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_DEFINE (scm_symbol_to_string, "symbol->string", 1, 0, 0,
(SCM s), (SCM s),
"Returns the name of @var{symbol} as a string. If the symbol was part of\n" "Returns the name of @var{symbol} as a string. If the symbol\n"
"an object returned as the value of a literal expression (section\n" "was part of an object returned as the value of a literal\n"
"@pxref{Literal expressions,,,r4rs, The Revised^4 Report on Scheme}) or\n" "expression (section @pxref{Literal expressions,,,r4rs, The\n"
"by a call to the @samp{read} procedure, and its name contains alphabetic\n" "Revised^4 Report on Scheme}) or by a call to the @code{read}\n"
"characters, then the string returned will contain characters in the\n" "procedure, and its name contains alphabetic characters, then\n"
"implementation's preferred standard case---some implementations will\n" "the string returned will contain characters in the\n"
"prefer upper case, others lower case. If the symbol was returned by\n" "implementation's preferred standard case---some implementations\n"
"@samp{string->symbol}, the case of characters in the string returned\n" "will prefer upper case, others lower case. If the symbol was\n"
"will be the same as the case in the string that was passed to\n" "returned by @code{string->symbol}, the case of characters in\n"
"@samp{string->symbol}. It is an error to apply mutation procedures like\n" "the string returned will be the same as the case in the string\n"
"@code{string-set!} to strings returned by this procedure. (r5rs)\n\n" "that was passed to @code{string->symbol}. It is an error to\n"
"The following examples assume that the implementation's standard case is\n" "apply mutation procedures like @code{string-set!} to strings\n"
"lower case:\n\n" "returned by this procedure. (r5rs)\n\n"
"@format\n" "The following examples assume that the implementation's\n"
"@t{(symbol->string 'flying-fish) \n" "standard case is lower case:\n\n"
" ==> \"flying-fish\"\n" "@lisp\n"
"(symbol->string 'Martin) ==> \"martin\"\n" "(symbol->string 'flying-fish) @result{} \"flying-fish\"\n"
"(symbol->string 'Martin) @result{} \"martin\"\n"
"(symbol->string\n" "(symbol->string\n"
" (string->symbol \"Malvina\")) \n" " (string->symbol \"Malvina\")) @result{} \"Malvina\"\n"
" ==> \"Malvina\"\n" "@end lisp")
"}\n"
"@end format")
#define FUNC_NAME s_scm_symbol_to_string #define FUNC_NAME s_scm_symbol_to_string
{ {
SCM_VALIDATE_SYMBOL (1, s); 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_DEFINE (scm_string_to_symbol, "string->symbol", 1, 0, 0,
(SCM s), (SCM s),
"Returns the symbol whose name is @var{string}. This procedure can\n" "Returns the symbol whose name is @var{string}. This procedure\n"
"create symbols with names containing special characters or letters in\n" "can create symbols with names containing special characters or\n"
"the non-standard case, but it is usually a bad idea to create such\n" "letters in the non-standard case, but it is usually a bad idea\n"
"symbols because in some implementations of Scheme they cannot be read as\n" "to create such because in some implementations of Scheme they\n"
"themselves. See @samp{symbol->string}.\n\n" "cannot be read as themselves. See @code{symbol->string}.\n\n"
"The following examples assume that the implementation's standard case is\n" "The following examples assume that the implementation's\n"
"lower case:\n\n" "standard case is lower case:\n\n"
"@format\n" "@lisp\n"
"@t{(eq? 'mISSISSIppi 'mississippi) \n" "(eq? 'mISSISSIppi 'mississippi) @result{} #t\n"
" ==> #t\n" "(string->symbol \"mISSISSIppi\") @result{} @r{the symbol with name \"mISSISSIppi\"}\n"
"(string->symbol \"mISSISSIppi\") \n" "(eq? 'bitBlt (string->symbol \"bitBlt\")) @result{} #f\n"
" ==>\n"
" @r{}the symbol with name \"mISSISSIppi\"\n"
"(eq? 'bitBlt (string->symbol \"bitBlt\")) \n"
" ==> #f\n"
"(eq? 'JollyWog\n" "(eq? 'JollyWog\n"
" (string->symbol\n" " (string->symbol (symbol->string 'JollyWog))) @result{} #t\n"
" (symbol->string 'JollyWog))) \n"
" ==> #t\n"
"(string=? \"K. Harper, M.D.\"\n" "(string=? \"K. Harper, M.D.\"\n"
" (symbol->string\n" " (symbol->string\n"
" (string->symbol \"K. Harper, M.D.\"))) \n" " (string->symbol \"K. Harper, M.D.\"))) @result{}#t\n"
" ==> #t\n" "@end lisp")
"}\n"
"@end format")
#define FUNC_NAME s_scm_string_to_symbol #define FUNC_NAME s_scm_string_to_symbol
{ {
SCM_VALIDATE_STRING (1, s); 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_DEFINE (scm_vector_p, "vector?", 1, 0, 0,
(SCM obj), (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 #define FUNC_NAME s_scm_vector_p
{ {
if (SCM_IMP (obj)) 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); SCM_REGISTER_PROC (s_list_to_vector, "list->vector", 1, 0, 0, scm_vector);
/* /*
"@samp{List->vector} returns a newly\n" "Return a newly created vector initialized to the elements of"
"created vector initialized to the elements of the list @var{list}.\n\n" "the list @var{list}.\n\n"
"@format\n" "@lisp\n"
"@t{(vector->list '#(dah dah didah))\n" "(vector->list '#(dah dah didah)) @result{} (dah dah didah)\n"
"=> (dah dah didah)\n" "(list->vector '(dididit dah)) @result{} #(dididit dah)\n"
"list->vector '(dididit dah))\n" "@end lisp")
"=> #(dididit dah)\n"
"}\n"
"@end format")
*/ */
SCM_DEFINE (scm_vector, "vector", 0, 0, 1, SCM_DEFINE (scm_vector, "vector", 0, 0, 1,
(SCM l), (SCM l),
"@deffnx primitive list->vector l\n" "@deffnx primitive list->vector l\n"
"Returns a newly allocated vector whose elements contain the given\n" "Returns a newly allocated vector whose elements contain the\n"
"arguments. Analogous to @samp{list}. (r5rs)\n\n" "given arguments. Analogous to @code{list}. (r5rs)\n\n"
"@format\n" "@lisp\n"
"@t{(vector 'a 'b 'c) ==> #(a b c) }\n" "(vector 'a 'b 'c) @result{} #(a b c)\n"
"@end format") "@end lisp")
#define FUNC_NAME s_scm_vector #define FUNC_NAME s_scm_vector
{ {
SCM res; 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" "@var{k} must be a valid index of @var{vector}.\n"
"@samp{Vector-ref} returns the contents of element @var{k} of\n" "@samp{Vector-ref} returns the contents of element @var{k} of\n"
"@var{vector}.\n\n" "@var{vector}.\n\n"
"@format\n" "@lisp\n"
"@t{(vector-ref '#(1 1 2 3 5 8 13 21)\n" "(vector-ref '#(1 1 2 3 5 8 13 21) 5) @result{} 8\n"
" 5)\n"
" ==> 8\n"
"(vector-ref '#(1 1 2 3 5 8 13 21)\n" "(vector-ref '#(1 1 2 3 5 8 13 21)\n"
" (let ((i (round (* 2 (acos -1)))))\n" " (let ((i (round (* 2 (acos -1)))))\n"
" (if (inexact? i)\n" " (if (inexact? i)\n"
" (inexact->exact i)\n" " (inexact->exact i)\n"
" i))) \n" " i))) @result{} 13\n"
" ==> 13\n" "@end lisp"
"}\n"
"@end format"
*/ */
SCM 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); 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}.\n"
@var{k} must be a valid index of @var{vector}. "@code{Vector-set!} stores @var{obj} in element @var{k} of @var{vector}.\n"
@samp{Vector-set!} stores @var{obj} in element @var{k} of @var{vector}. "The value returned by @samp{vector-set!} is unspecified.\n"
The value returned by @samp{vector-set!} is unspecified. "@lisp\n"
@c <!> "(let ((vec (vector 0 '(2 2 2 2) "Anna")))\n"
" (vector-set! vec 1 '("Sue" "Sue"))\n"
" vec) @result{} #(0 ("Sue" "Sue") "Anna")\n"
@format "(vector-set! '#(0 1 2) 1 "doe") @result{} @emph{error} ; constant vector\n"
@t{(let ((vec (vector 0 '(2 2 2 2) "Anna"))) "@end lisp"
(vector-set! vec 1 '("Sue" "Sue"))
vec)
==> #(0 ("Sue" "Sue") "Anna")
(vector-set! '#(0 1 2) 1 "doe")
==> @emph{error} ; constant vector
}
@end format
*/ */
SCM 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_DEFINE (scm_vector_to_list, "vector->list", 1, 0, 0,
(SCM v), (SCM v),
"@samp{Vector->list} returns a newly allocated list of the objects contained\n" "@samp{Vector->list} returns a newly allocated list of the\n"
"in the elements of @var{vector}. (r5rs)\n\n" "objects contained in the elements of @var{vector}. (r5rs)\n\n"
"@format\n" "@lisp\n"
"@t{(vector->list '#(dah dah didah))\n" "(vector->list '#(dah dah didah)) @result{} (dah dah didah)\n"
"=> (dah dah didah)\n" "(list->vector '(dididit dah)) @result{} #(dididit dah)\n"
"list->vector '(dididit dah))\n" "@end lisp")
"=> #(dididit dah)\n"
"}\n"
"@end format")
#define FUNC_NAME s_scm_vector_to_list #define FUNC_NAME s_scm_vector_to_list
{ {
SCM res = SCM_EOL; 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_DEFINE (scm_vector_fill_x, "vector-fill!", 2, 0, 0,
(SCM v, SCM fill_x), (SCM v, SCM fill_x),
"Stores @var{fill} in every element of @var{vector}.\n" "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 #define FUNC_NAME s_scm_vector_fill_x
{ {
register long i; register long i;