1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-04 16:50:25 +02:00

Remove deprecated array functions

* libguile/array-map.c (scm_array_fill_int, scm_array_fill_int,
    scm_ra_eqp, scm_ra_lessp scm_ra_leqp, scm_ra_grp, scm_ra_greqp,
    scm_ra_sum, scm_ra_difference, scm_ra_product, scm_ra_divide,
    scm_array_identity): Remove deprecated functions.

* libguile/array-map.h: Remove declaration of deprecated functions.

* libguile/generalized-vectors.h, libguile/generalized-vectors.c
  (scm_is_generalized_vector, scm_c_generalized_vector_length,
  scm_c_generalized_vector_ref, scm_c_generalized_vector_set_x): These
  functions were deprecated in 2.0.9. Remove.

* doc/ref/api-compound.texi: Remove uniform-array-read!,
  uniform-array-write from the manual. These procedures where removed in
  fc7bd367ab (2011-05-12).
This commit is contained in:
Daniel Llorens 2015-02-13 16:45:21 +01:00
parent 5cc1454b0f
commit 0ebea8746b
5 changed files with 0 additions and 345 deletions

View file

@ -1568,39 +1568,6 @@ $\left(\matrix{%
@end example @end example
@end deffn @end deffn
@deffn {Scheme Procedure} uniform-array-read! ra [port_or_fd [start [end]]]
@deffnx {C Function} scm_uniform_array_read_x (ra, port_or_fd, start, end)
Attempt to read all elements of array @var{ra}, in lexicographic order, as
binary objects from @var{port_or_fd}.
If an end of file is encountered,
the objects up to that point are put into @var{ra}
(starting at the beginning) and the remainder of the array is
unchanged.
The optional arguments @var{start} and @var{end} allow
a specified region of a vector (or linearized array) to be read,
leaving the remainder of the vector unchanged.
@code{uniform-array-read!} returns the number of objects read.
@var{port_or_fd} may be omitted, in which case it defaults to the value
returned by @code{(current-input-port)}.
@end deffn
@deffn {Scheme Procedure} uniform-array-write ra [port_or_fd [start [end]]]
@deffnx {C Function} scm_uniform_array_write (ra, port_or_fd, start, end)
Writes all elements of @var{ra} as binary objects to
@var{port_or_fd}.
The optional arguments @var{start}
and @var{end} allow
a specified region of a vector (or linearized array) to be written.
The number of objects actually written is returned.
@var{port_or_fd} may be
omitted, in which case it defaults to the value returned by
@code{(current-output-port)}.
@end deffn
@node Shared Arrays @node Shared Arrays
@subsubsection Shared Arrays @subsubsection Shared Arrays

View file

@ -307,267 +307,6 @@ SCM_DEFINE (scm_array_copy_x, "array-copy!", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
#if SCM_ENABLE_DEPRECATED == 1
/* to be used as cproc in scm_ramapc to fill an array dimension with
"fill". */
int
scm_array_fill_int (SCM ra, SCM fill, SCM ignore SCM_UNUSED)
{
unsigned long i;
unsigned long n = SCM_I_ARRAY_DIMS (ra)->ubnd - SCM_I_ARRAY_DIMS (ra)->lbnd + 1;
long inc = SCM_I_ARRAY_DIMS (ra)->inc;
unsigned long base = SCM_I_ARRAY_BASE (ra);
ra = SCM_I_ARRAY_V (ra);
for (i = base; n--; i += inc)
ASET (ra, i, fill);
return 1;
}
/* Functions callable by ARRAY-MAP! */
int
scm_ra_eqp (SCM ra0, SCM ras)
{
SCM ra1 = SCM_CAR (ras), ra2 = SCM_CAR (SCM_CDR (ras));
scm_t_array_handle ra0_handle;
scm_t_array_dim *ra0_dims;
size_t n;
ssize_t inc0;
size_t i0 = 0;
unsigned long i1 = SCM_I_ARRAY_BASE (ra1), i2 = SCM_I_ARRAY_BASE (ra2);
long inc1 = SCM_I_ARRAY_DIMS (ra1)->inc;
long inc2 = SCM_I_ARRAY_DIMS (ra1)->inc;
ra1 = SCM_I_ARRAY_V (ra1);
ra2 = SCM_I_ARRAY_V (ra2);
scm_array_get_handle (ra0, &ra0_handle);
ra0_dims = scm_array_handle_dims (&ra0_handle);
n = ra0_dims[0].ubnd - ra0_dims[0].lbnd + 1;
inc0 = ra0_dims[0].inc;
{
for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2)
if (scm_is_true (scm_array_handle_ref (&ra0_handle, i0)))
if (!scm_is_eq (AREF (ra1, i1), AREF (ra2, i2)))
scm_array_handle_set (&ra0_handle, i0, SCM_BOOL_F);
}
scm_array_handle_release (&ra0_handle);
return 1;
}
/* opt 0 means <, nonzero means >= */
static int
ra_compare (SCM ra0, SCM ra1, SCM ra2, int opt)
{
scm_t_array_handle ra0_handle;
scm_t_array_dim *ra0_dims;
size_t n;
ssize_t inc0;
size_t i0 = 0;
unsigned long i1 = SCM_I_ARRAY_BASE (ra1), i2 = SCM_I_ARRAY_BASE (ra2);
long inc1 = SCM_I_ARRAY_DIMS (ra1)->inc;
long inc2 = SCM_I_ARRAY_DIMS (ra1)->inc;
ra1 = SCM_I_ARRAY_V (ra1);
ra2 = SCM_I_ARRAY_V (ra2);
scm_array_get_handle (ra0, &ra0_handle);
ra0_dims = scm_array_handle_dims (&ra0_handle);
n = ra0_dims[0].ubnd - ra0_dims[0].lbnd + 1;
inc0 = ra0_dims[0].inc;
{
for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2)
if (scm_is_true (scm_array_handle_ref (&ra0_handle, i0)))
if (opt ?
scm_is_true (scm_less_p (AREF (ra1, i1), AREF (ra2, i2))) :
scm_is_false (scm_less_p (AREF (ra1, i1), AREF (ra2, i2))))
scm_array_handle_set (&ra0_handle, i0, SCM_BOOL_F);
}
scm_array_handle_release (&ra0_handle);
return 1;
}
int
scm_ra_lessp (SCM ra0, SCM ras)
{
return ra_compare (ra0, SCM_CAR (ras), SCM_CAR (SCM_CDR (ras)), 0);
}
int
scm_ra_leqp (SCM ra0, SCM ras)
{
return ra_compare (ra0, SCM_CAR (SCM_CDR (ras)), SCM_CAR (ras), 1);
}
int
scm_ra_grp (SCM ra0, SCM ras)
{
return ra_compare (ra0, SCM_CAR (SCM_CDR (ras)), SCM_CAR (ras), 0);
}
int
scm_ra_greqp (SCM ra0, SCM ras)
{
return ra_compare (ra0, SCM_CAR (ras), SCM_CAR (SCM_CDR (ras)), 1);
}
int
scm_ra_sum (SCM ra0, SCM ras)
{
long n = SCM_I_ARRAY_DIMS (ra0)->ubnd - SCM_I_ARRAY_DIMS (ra0)->lbnd + 1;
unsigned long i0 = SCM_I_ARRAY_BASE (ra0);
long inc0 = SCM_I_ARRAY_DIMS (ra0)->inc;
ra0 = SCM_I_ARRAY_V (ra0);
if (!scm_is_null(ras))
{
SCM ra1 = SCM_CAR (ras);
unsigned long i1 = SCM_I_ARRAY_BASE (ra1);
long inc1 = SCM_I_ARRAY_DIMS (ra1)->inc;
ra1 = SCM_I_ARRAY_V (ra1);
switch (SCM_TYP7 (ra0) == SCM_TYP7 (ra1) ? SCM_TYP7 (ra0) : 0)
{
default:
{
for (; n-- > 0; i0 += inc0, i1 += inc1)
ASET (ra0, i0, scm_sum (AREF(ra0, i0), AREF(ra1, i1)));
break;
}
}
}
return 1;
}
int
scm_ra_difference (SCM ra0, SCM ras)
{
long n = SCM_I_ARRAY_DIMS (ra0)->ubnd - SCM_I_ARRAY_DIMS (ra0)->lbnd + 1;
unsigned long i0 = SCM_I_ARRAY_BASE (ra0);
long inc0 = SCM_I_ARRAY_DIMS (ra0)->inc;
ra0 = SCM_I_ARRAY_V (ra0);
if (scm_is_null (ras))
{
switch (SCM_TYP7 (ra0))
{
default:
{
for (; n-- > 0; i0 += inc0)
ASET (ra0, i0, scm_difference (AREF(ra0, i0), SCM_UNDEFINED));
break;
}
}
}
else
{
SCM ra1 = SCM_CAR (ras);
unsigned long i1 = SCM_I_ARRAY_BASE (ra1);
long inc1 = SCM_I_ARRAY_DIMS (ra1)->inc;
ra1 = SCM_I_ARRAY_V (ra1);
switch (SCM_TYP7 (ra0) == SCM_TYP7 (ra1) ? SCM_TYP7 (ra0) : 0)
{
default:
{
for (; n-- > 0; i0 += inc0, i1 += inc1)
ASET (ra0, i0, scm_difference (AREF (ra0, i0), AREF (ra1, i1)));
break;
}
}
}
return 1;
}
int
scm_ra_product (SCM ra0, SCM ras)
{
long n = SCM_I_ARRAY_DIMS (ra0)->ubnd - SCM_I_ARRAY_DIMS (ra0)->lbnd + 1;
unsigned long i0 = SCM_I_ARRAY_BASE (ra0);
long inc0 = SCM_I_ARRAY_DIMS (ra0)->inc;
ra0 = SCM_I_ARRAY_V (ra0);
if (!scm_is_null (ras))
{
SCM ra1 = SCM_CAR (ras);
unsigned long i1 = SCM_I_ARRAY_BASE (ra1);
long inc1 = SCM_I_ARRAY_DIMS (ra1)->inc;
ra1 = SCM_I_ARRAY_V (ra1);
switch (SCM_TYP7 (ra0) == SCM_TYP7 (ra1) ? SCM_TYP7 (ra0) : 0)
{
default:
{
for (; n-- > 0; i0 += inc0, i1 += inc1)
ASET (ra0, i0, scm_product (AREF (ra0, i0), AREF (ra1, i1)));
}
}
}
return 1;
}
int
scm_ra_divide (SCM ra0, SCM ras)
{
long n = SCM_I_ARRAY_DIMS (ra0)->ubnd - SCM_I_ARRAY_DIMS (ra0)->lbnd + 1;
unsigned long i0 = SCM_I_ARRAY_BASE (ra0);
long inc0 = SCM_I_ARRAY_DIMS (ra0)->inc;
ra0 = SCM_I_ARRAY_V (ra0);
if (scm_is_null (ras))
{
switch (SCM_TYP7 (ra0))
{
default:
{
for (; n-- > 0; i0 += inc0)
ASET (ra0, i0, scm_divide (AREF (ra0, i0), SCM_UNDEFINED));
break;
}
}
}
else
{
SCM ra1 = SCM_CAR (ras);
unsigned long i1 = SCM_I_ARRAY_BASE (ra1);
long inc1 = SCM_I_ARRAY_DIMS (ra1)->inc;
ra1 = SCM_I_ARRAY_V (ra1);
switch (SCM_TYP7 (ra0) == SCM_TYP7 (ra1) ? SCM_TYP7 (ra0) : 0)
{
default:
{
for (; n-- > 0; i0 += inc0, i1 += inc1)
{
SCM res = scm_divide (AREF (ra0, i0), AREF (ra1, i1));
ASET (ra0, i0, res);
}
break;
}
}
}
return 1;
}
int
scm_array_identity (SCM dst, SCM src)
{
return racp (SCM_CAR (src), scm_cons (dst, SCM_EOL));
}
#endif /* SCM_ENABLE_DEPRECATED */
static int static int
ramap (SCM ra0, SCM proc, SCM ras) ramap (SCM ra0, SCM proc, SCM ras)
{ {

View file

@ -39,22 +39,6 @@ SCM_API SCM scm_array_index_map_x (SCM ra, SCM proc);
SCM_API SCM scm_array_equal_p (SCM ra0, SCM ra1); SCM_API SCM scm_array_equal_p (SCM ra0, SCM ra1);
SCM_INTERNAL void scm_init_array_map (void); SCM_INTERNAL void scm_init_array_map (void);
#if SCM_ENABLE_DEPRECATED == 1
SCM_DEPRECATED int scm_array_fill_int (SCM ra, SCM fill, SCM ignore);
SCM_DEPRECATED int scm_ra_eqp (SCM ra0, SCM ras);
SCM_DEPRECATED int scm_ra_lessp (SCM ra0, SCM ras);
SCM_DEPRECATED int scm_ra_leqp (SCM ra0, SCM ras);
SCM_DEPRECATED int scm_ra_grp (SCM ra0, SCM ras);
SCM_DEPRECATED int scm_ra_greqp (SCM ra0, SCM ras);
SCM_DEPRECATED int scm_ra_sum (SCM ra0, SCM ras);
SCM_DEPRECATED int scm_ra_difference (SCM ra0, SCM ras);
SCM_DEPRECATED int scm_ra_product (SCM ra0, SCM ras);
SCM_DEPRECATED int scm_ra_divide (SCM ra0, SCM ras);
SCM_DEPRECATED int scm_array_identity (SCM src, SCM dst);
#endif /* SCM_ENABLE_DEPRECATED == 1 */
#endif /* SCM_ARRAY_MAP_H */ #endif /* SCM_ARRAY_MAP_H */
/* /*

View file

@ -69,19 +69,6 @@ SCM_DEFINE (scm_make_generalized_vector, "make-generalized-vector", 2, 1, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
int
scm_is_generalized_vector (SCM obj)
{
int ret = 0;
if (scm_is_array (obj))
{
scm_t_array_handle h;
scm_array_get_handle (obj, &h);
ret = scm_array_handle_rank (&h) == 1;
scm_array_handle_release (&h);
}
return ret;
}
#define SCM_VALIDATE_VECTOR_WITH_HANDLE(pos, val, handle) \ #define SCM_VALIDATE_VECTOR_WITH_HANDLE(pos, val, handle) \
scm_generalized_vector_get_handle (val, handle) scm_generalized_vector_get_handle (val, handle)
@ -98,24 +85,6 @@ scm_generalized_vector_get_handle (SCM vec, scm_t_array_handle *h)
} }
} }
size_t
scm_c_generalized_vector_length (SCM v)
{
return scm_c_array_length (v);
}
SCM
scm_c_generalized_vector_ref (SCM v, ssize_t idx)
{
return scm_c_array_ref_1 (v, idx);
}
void
scm_c_generalized_vector_set_x (SCM v, ssize_t idx, SCM val)
{
scm_c_array_set_1_x (v, val, idx);
}
void void
scm_init_generalized_vectors () scm_init_generalized_vectors ()
{ {

View file

@ -30,10 +30,6 @@
/* Generalized vectors */ /* Generalized vectors */
SCM_API int scm_is_generalized_vector (SCM obj);
SCM_API size_t scm_c_generalized_vector_length (SCM v);
SCM_API SCM scm_c_generalized_vector_ref (SCM v, ssize_t idx);
SCM_API void scm_c_generalized_vector_set_x (SCM v, ssize_t idx, SCM val);
SCM_API void scm_generalized_vector_get_handle (SCM vec, SCM_API void scm_generalized_vector_get_handle (SCM vec,
scm_t_array_handle *h); scm_t_array_handle *h);