summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS10
-rw-r--r--libguile/ChangeLog11
-rw-r--r--libguile/num2integral.i.c10
3 files changed, 20 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index d740f0ac3..5c4a214fc 100644
--- a/NEWS
+++ b/NEWS
@@ -1186,13 +1186,21 @@ intended to be used in user code. You should avoid dealing with
bignums directly, and should deal with numbers in general (which can
be bignums).
+** Change in behavior: scm_num2long, scm_num2ulong
+
+The scm_num2[u]long functions don't any longer accept an inexact
+argument. This change in behavior is motivated by concordance with
+R5RS: It is more common that a primitive doesn't want to accept an
+inexact for an exact.
+
** New functions: scm_short2num, scm_ushort2num, scm_int2num,
scm_uint2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
scm_num2ushort, scm_num2int, scm_num2uint, scm_num2ptrdiff,
scm_num2size.
These are conversion functions between the various ANSI C integral
-types and Scheme numbers.
+types and Scheme numbers. NOTE: The scm_num2xxx functions don't
+accept an inexact argument.
** New number validation macros:
SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,INT,UINT}[_DEF]
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index b1eec946a..6da89ae34 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,14 @@
+2001-09-20 Mikael Djurfeldt <mdj@linnaeus>
+
+ * error.c, error.h: Made error keys globally accessible.
+ Applications might want to test for these or use them in a direct
+ call to scm_error.
+
+ * num2integral.i.c (NUM2INTEGRAL): Report an error when these
+ routines are passed an inexact. This change in behavior is
+ motivated by concordance with R5RS: It is more common that a
+ primitive doesn't want to accept an inexact for an exact.
+
2001-09-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
The following patch partially undoes my patch from 2001-06-30,
diff --git a/libguile/num2integral.i.c b/libguile/num2integral.i.c
index 65afa2603..61b1255c8 100644
--- a/libguile/num2integral.i.c
+++ b/libguile/num2integral.i.c
@@ -69,16 +69,6 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller)
return res;
}
- else if (SCM_REALP (num))
- { /* inexact */
-
- double u = SCM_REAL_VALUE (num);
- ITYPE res = u;
- if ((double) res == u)
- return res;
- else
- scm_out_of_range (s_caller, num);
- }
else
scm_wrong_type_arg (s_caller, pos, num);
}