1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00

(scm_difference): Call SCM_WTA_DISPATCH_0 when zero

arguments are supplied.
This commit is contained in:
Marius Vollmer 2001-05-06 01:26:23 +00:00
parent e68fc82964
commit c05e97b749

View file

@ -3261,7 +3261,7 @@ scm_max (SCM x, SCM y)
{ {
if (SCM_UNBNDP (y)) { if (SCM_UNBNDP (y)) {
if (SCM_UNBNDP (x)) { if (SCM_UNBNDP (x)) {
SCM_WTA_DISPATCH_0 (g_max, x, SCM_ARG1, s_max); SCM_WTA_DISPATCH_0 (g_max, s_max);
} else if (SCM_NUMBERP (x)) { } else if (SCM_NUMBERP (x)) {
return x; return x;
} else { } else {
@ -3319,7 +3319,7 @@ scm_min (SCM x, SCM y)
{ {
if (SCM_UNBNDP (y)) { if (SCM_UNBNDP (y)) {
if (SCM_UNBNDP (x)) { if (SCM_UNBNDP (x)) {
SCM_WTA_DISPATCH_0 (g_min, x, SCM_ARG1, s_min); SCM_WTA_DISPATCH_0 (g_min, s_min);
} else if (SCM_NUMBERP (x)) { } else if (SCM_NUMBERP (x)) {
return x; return x;
} else { } else {
@ -3481,11 +3481,14 @@ SCM_GPROC1 (s_difference, "-", scm_tc7_asubr, scm_difference, g_difference);
* "all but the first argument are subtracted from the first\n" * "all but the first argument are subtracted from the first\n"
* "argument." * "argument."
*/ */
#define FUNC_NAME s_difference
SCM SCM
scm_difference (SCM x, SCM y) scm_difference (SCM x, SCM y)
{ {
if (SCM_UNBNDP (y)) { if (SCM_UNBNDP (y)) {
if (SCM_INUMP (x)) { if (SCM_UNBNDP (x)) {
SCM_WTA_DISPATCH_0 (g_difference, s_difference);
} else if (SCM_INUMP (x)) {
long xx = -SCM_INUM (x); long xx = -SCM_INUM (x);
if (SCM_FIXABLE (xx)) { if (SCM_FIXABLE (xx)) {
return SCM_MAKINUM (xx); return SCM_MAKINUM (xx);
@ -3603,7 +3606,7 @@ scm_difference (SCM x, SCM y)
SCM_WTA_DISPATCH_2 (g_difference, x, y, SCM_ARG1, s_difference); SCM_WTA_DISPATCH_2 (g_difference, x, y, SCM_ARG1, s_difference);
} }
} }
#undef FUNC_NAME
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" /* "Return the product of all arguments. If called without arguments,\n"
@ -3757,6 +3760,7 @@ 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." /* "Divide the first argument by the product of the remaining arguments."
*/ */
#define FUNC_NAME s_divide
SCM SCM
scm_divide (SCM x, SCM y) scm_divide (SCM x, SCM y)
{ {
@ -3764,7 +3768,7 @@ scm_divide (SCM x, SCM y)
if (SCM_UNBNDP (y)) { if (SCM_UNBNDP (y)) {
if (SCM_UNBNDP (x)) { if (SCM_UNBNDP (x)) {
SCM_WTA_DISPATCH_0 (g_divide, x, SCM_ARG1, s_divide); SCM_WTA_DISPATCH_0 (g_divide, s_divide);
} else if (SCM_INUMP (x)) { } else if (SCM_INUMP (x)) {
if (SCM_EQ_P (x, SCM_MAKINUM (1L)) || SCM_EQ_P (x, SCM_MAKINUM (-1L))) { if (SCM_EQ_P (x, SCM_MAKINUM (1L)) || SCM_EQ_P (x, SCM_MAKINUM (-1L))) {
return x; return x;
@ -3909,7 +3913,7 @@ scm_divide (SCM x, SCM y)
SCM_WTA_DISPATCH_2 (g_divide, x, y, SCM_ARG1, s_divide); SCM_WTA_DISPATCH_2 (g_divide, x, y, SCM_ARG1, s_divide);
} }
} }
#undef FUNC_NAME
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}." /* "Return the inverse hyperbolic sine of @var{x}."