* Un-deprecated the *FIXABLE macros.

* Deprecated SCM_UNPACK_CAR.
* Updated NEWS and RELEASE.
This commit is contained in:
Dirk Herrmann 2000-05-25 13:53:49 +00:00
commit 894a712b28
6 changed files with 52 additions and 28 deletions

29
NEWS
View file

@ -193,6 +193,12 @@ only characters, for compatibility with R5RS.
** New procedure: port-closed? PORT
Returns #t if PORT is closed or #f if it is open.
* Changes to the gh_ interface
** Deprecated: gh_int2scmb
Use gh_bool2scm instead.
* Changes to the scm_ interface
** Guile primitives now carry docstrings!
@ -212,14 +218,15 @@ the readability of argument checking.
** All (nearly?) K&R prototypes for functions replaced with ANSI C equivalents.
** New macros: SCM_PACK, SCM_UNPACK, SCM_UNPACK_CAR
** New macros: SCM_PACK, SCM_UNPACK
Compose/decompose an SCM value.
The SCM type is now defined as void * on most architectures. This
makes it easier to find several types of bugs, for example when SCM
values are treated as integers without conversion. Values of the SCM
type should be treated as "atomic" values. These macros are used when
The SCM type is now treated as an abstract data type and may be defined as a
long, a void* or as a struct, depending on the architecture and compile time
options. This makes it easier to find several types of bugs, for example when
SCM values are treated as integers without conversion. Values of the SCM type
should be treated as "atomic" values. These macros are used when
composing/decomposing an SCM value, either because you want to access
individual bits, or because you want to treat it as an integer value.
@ -227,11 +234,11 @@ E.g., in order to set bit 7 in an SCM value x, use the expression
SCM_PACK (SCM_UNPACK (x) | 0x80)
SCM_UNPACK_CAR (X) is defined as SCM_UNPACK (SCM_CAR (X))
** Deprecated macros: SCM_INPORTP, SCM_OUTPORTP, SCM_CRDY, SCM_ICHRP,
SCM_ICHR, SCM_MAKICHR, SCM_SETJMPBUF, SCM_NSTRINGP, SCM_NRWSTRINGP,
SCM_NVECTORP
** Deprecated macros: SCM_INPORTP, SCM_OUTPORTP
These macros will be removed in next release of Guile.
These macros will be removed in a future release of Guile.
** Port internals: the rw_random variable in the scm_port structure
must be set to non-zero in any random access port. In recent Guile
@ -254,6 +261,10 @@ although to actually avoid resetting the buffers and discard unread
chars requires further hacking that depends on the characteristics
of the ptob.
** Deprecated functions: scm_fseek, scm_tag
These functions are no longer used and will be removed in a future version.
** The scm_sysmissing procedure is no longer used in libguile.
Unless it turns out to be unexpectedly useful to somebody, it will be
removed in a future version.

10
RELEASE
View file

@ -16,8 +16,16 @@ In release 1.4:
- remove deprecated function scm_newsmob.
In release 1.5:
- remove deprecated macros: SCM_INPORTP, SCM_OUTPORTP
- remove deprecated macros: SCM_INPORTP, SCM_OUTPORTP, SCM_CRDY, SCM_ICHRP,
SCM_ICHR, SCM_MAKICHR, SCM_SETJMPBUF, SCM_NSTRINGP, SCM_NRWSTRINGP,
SCM_NVECTORP
- remove gc-thunk (It has been replaced by after-gc-hook.)
- remove scm_sysmissing
- remove gh_int2scmb (replaced by gh_bool2scm)
- remove scm_fseek (replaced by scm_seek)
- remove scm_tag
Dirk:FIXME:: look into deprecated things in numbers.h and tags.h, don't forget
to update NEWS accordingly.
Modules sort.c and random.c should be factored out into separate
modules (but still be distributed with guile-core) when we get a new

View file

@ -1,6 +1,17 @@
2000-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
* filesys.h (SCM_OPDIRP), fluids (SCM_FLUIDP, SCM_FLUID_NUM),
* numbers.[ch] (SCM_POSFIXABLE, SCM_NEGFIXABLE, SCM_FIXABLE):
Un-deprecated since otherwise user code can't determine whether a
number fits into an inum any longer. The names should be changed
some time, though.
* numbers.c (scm_big2inum): Eliminated use of SCM_UNEGFIXABLE.
* tags.h (SCM_UNPACK_CAR): Deprecated.
2000-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
* filesys.h (SCM_OPDIRP), fluids.h (SCM_FLUIDP, SCM_FLUID_NUM),
fports.h (SCM_OPFPORTP, SCM_OPINFPORTP, SCM_OPOUTFPORTP), hooks.h
(SCM_HOOK_ARITY), keywords.h (SCM_KEYWORDP, SCM_KEYWORDSYM),
numbers.h (SCM_NUMP, SCM_BIGSIGN, SCM_BDIGITS, SCM_NUMDIGS):

View file

@ -71,19 +71,13 @@ static SCM scm_divbigint (SCM x, long z, int sgn, int mode);
#if (SCM_DEBUG_DEPRECATED == 1) /* not defined in header yet? */
/* SCM_FIXABLE is non-0 if its long argument can be encoded in an SCM_INUM.
*/
#define SCM_POSFIXABLE(n) ((n) <= SCM_MOST_POSITIVE_FIXNUM)
#define SCM_NEGFIXABLE(n) ((n) >= SCM_MOST_NEGATIVE_FIXNUM)
#define SCM_UNEGFIXABLE(n) ((n) <= -SCM_MOST_NEGATIVE_FIXNUM)
#define SCM_FIXABLE(n) (SCM_POSFIXABLE(n) && SCM_NEGFIXABLE(n))
/* SCM_FLOBUFLEN is the maximum number of characters neccessary for the
* printed or scm_string representation of an inexact number.
*/
#define SCM_FLOBUFLEN (10+2*(sizeof(double)/sizeof(char)*SCM_CHAR_BIT*3+9)/10)
#endif
#endif /* SCM_DEBUG_DEPRECATED == 1 */
/* IS_INF tests its floating point number for infiniteness
@ -1349,7 +1343,7 @@ scm_big2inum (SCM b, scm_sizet l)
if (SCM_POSFIXABLE (num))
return SCM_MAKINUM (num);
}
else if (SCM_UNEGFIXABLE (num))
else if (num <= -SCM_MOST_NEGATIVE_FIXNUM)
return SCM_MAKINUM (-num);
return b;
}

View file

@ -77,6 +77,12 @@
#define SCM_INUM(x) (SCM_SRS (SCM_UNPACK (x), 2))
/* SCM_FIXABLE is true if its long argument can be encoded in an SCM_INUM. */
#define SCM_POSFIXABLE(n) ((n) <= SCM_MOST_POSITIVE_FIXNUM)
#define SCM_NEGFIXABLE(n) ((n) >= SCM_MOST_NEGATIVE_FIXNUM)
#define SCM_FIXABLE(n) (SCM_POSFIXABLE(n) && SCM_NEGFIXABLE(n))
/* A name for 0. */
#define SCM_INUM0 (SCM_MAKINUM (0))
@ -304,10 +310,7 @@ typedef struct scm_dblproc
#define SCM_NEWREAL(z, x) do { z = scm_make_real (x); } while (0)
#define SCM_NEWCOMPLEX(z, x, y) do { z = scm_make_complex (x, y); } while (0)
#define SCM_POSFIXABLE(n) ((n) <= SCM_MOST_POSITIVE_FIXNUM)
#define SCM_NEGFIXABLE(n) ((n) >= SCM_MOST_NEGATIVE_FIXNUM)
#define SCM_UNEGFIXABLE(n) ((n) <= -SCM_MOST_NEGATIVE_FIXNUM)
#define SCM_FIXABLE(n) (SCM_POSFIXABLE(n) && SCM_NEGFIXABLE(n))
#define SCM_FLOBUFLEN (10+2*(sizeof(double)/sizeof(char)*SCM_CHAR_BIT*3+9)/10)
#define SCM_INEXP(x) SCM_INEXACTP(x)
#define SCM_CPLXP(x) SCM_COMPLEXP(x)

View file

@ -91,10 +91,6 @@ typedef long scm_bits_t;
*/
#define SCM_EQ_P(x, y) (SCM_UNPACK (x) == SCM_UNPACK (y))
/* SCM_UNPACK_CAR is a convenience for treating the CAR of X as a word */
#define SCM_UNPACK_CAR(x) (SCM_CELL_TYPE (x))
/* SCM variables can contain:
@ -580,7 +576,8 @@ extern char *scm_isymnames[]; /* defined in print.c */
#if (SCM_DEBUG_DEPRECATED == 0)
#define SCM_NDOUBLE_CELLP(x) (!SCM_DOUBLE_CELLP (x))
#define SCM_UNPACK_CAR(x) (SCM_CELL_WORD_0 (x))
#define SCM_NDOUBLE_CELLP(x) (!SCM_DOUBLE_CELLP (x))
#define scm_tc16_flo scm_tc16_real
#define scm_tc_flo 0x017fL