1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
Commit graph

13 commits

Author SHA1 Message Date
Andy Wingo
fb7dd00169 Deprecate general "uniform-vector" interface
* libguile/uniform.h:
* libguile/uniform.c (scm_is_uniform_vector, scm_uniform_vector_p)
  (scm_c_uniform_vector_length, scm_uniform_vector_length)
  (scm_uniform_vector_element_type, scm_uniform_vector_element_size)
  (scm_c_uniform_vector_ref, scm_uniform_vector_ref):
  (scm_c_uniform_vector_set_x, scm_uniform_vector_set_x):
  (scm_uniform_vector_to_list)
  (scm_uniform_vector_elements, scm_uniform_vector_writable_elements):
  Deprecate.  This interface lacked both generality and specificity.
  The general replacement is array-length, array-ref, and friends on the
  scheme side, or the array handle interface on the C side.  On the
  specific side of things, there are the specific bytevector, srfi-4,
  and bitvector interfaces.

* test-suite/tests/arrays.test:
* test-suite/tests/bitvectors.test:
* test-suite/tests/ports.test:
* test-suite/tests/srfi-4.test: Update to use array interfaces.

* doc/ref/api-foreign.texi (Void Pointers and Byte Access):
* doc/ref/srfi-modules.texi (SRFI-4): Update.
2014-02-08 14:28:07 +01:00
Andy Wingo
118ff892be deprecate generalized vectors in favor of arrays
* libguile/generalized-arrays.h:
* libguile/generalized-arrays.c (scm_c_array_length):
  (scm_array_length): New functions.

* module/ice-9/deprecated.scm:
* libguile/generalized-vectors.c:
* libguile/generalized-vectors.h:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_generalized_vector_p)
  (scm_generalized_vector_length, scm_generalized_vector_ref)
  (scm_generalized_vector_set_x, scm_generalized_vector_to_list):
  Deprecate.

* libguile/uniform.c (scm_uniform_vector_to_list): Use
  scm_array_to_list.

* module/ice-9/boot-9.scm (case): Arrays are generalized vectors.

* module/srfi/srfi-4/gnu.scm (define-any->vector): Use the array
  functions instead of the generalized-vector functions.

* test-suite/tests/arrays.test: Remove generalized-vector->list test;
  covered by array->list test.

* test-suite/tests/bitvectors.test:
* test-suite/tests/bytevectors.test:
* test-suite/tests/srfi-4.test: Adapt to test using array interfaces
  instead of generalized-vector interfaces.

* doc/ref/api-compound.texi: Remove generalized vector docs.
* doc/ref/api-data.texi:
* doc/ref/srfi-modules.texi: Adapt.
2013-02-18 16:57:15 +01:00
Mark H Weaver
ef405f8ba7 Fix <TAG>vector-length when applied to other uniform vector types
* module/srfi/srfi-4.scm, module/srfi/srfi-4/gnu.scm
  (define-bytevector-type): Fix definition of <TAG>vector-length when
  applied to uniform vectors of different element sizes.  Thanks to
  Tobias Brandt <tob.brandt@googlemail.com> for reporting this bug.

* test-suite/tests/srfi-4.test: Add tests.
2012-03-01 16:16:18 -05:00
Ludovic Courtès
4bc95fccad Add type and range checks to the complex generalized vector accessors.
* libguile/bytevectors.c (COMPLEX_ACCESSOR_PROLOGUE, COMPLEX_NATIVE_REF,
  COMPLEX_NATIVE_SET): New macros.
  (bytevector_ref_c32, bytevector_ref_c64): Defined in terms of
  `COMPLEX_NATIVE_REF'.
  (bytevector_set_c32, bytevector_set_c64): Defined in terms of
  `COMPLEX_NATIVE_SET'.
  (bytevector_ref_fns): Make `static'.

* test-suite/tests/srfi-4.test ("c32 vectors")["generalized-vector-ref",
  "generalized-vector-set!", "generalized-vector-ref, out-of-range",
  "generalized-vector-set!, out-of-range"]: New tests.
  ("c64 vectors")["generalized-vector-ref", "generalized-vector-set!",
  "generalized-vector-ref, out-of-range",
  "generalized-vector-set!, out-of-range"]: New tests.
2011-07-01 19:09:29 +02:00
Andy Wingo
39bed56f67 fix c32vector-set!, c64vector-set!
* module/srfi/srfi-4/gnu.scm (bytevector-c32-native-set!):
  (bytevector-c64-native-set!): Fix to actually allow complex numbers.

* test-suite/tests/srfi-4.test: Add tests.
2011-04-01 16:45:58 +02:00
Mark H Weaver
73ea546c51 Fix bytevectors VALIDATE_REAL to test for reals, not rationals
Reported and fixed by Daniel Llorens <dll@bluewin.ch>.

* libguile/bytevectors.c (VALIDATE_REAL): Test for reals, not rationals.

* test-suite/tests/srfi-4.test (f32 vectors, f64 vectors): Add tests.
2011-03-08 17:50:47 -05:00
Ludovic Courtès
d900a8557d Fix off-by-one error when initializing vectors in `make-srfi-4-vector'.
* libguile/srfi-4.c (scm_make_srfi_4_vector): When FILL is bound and
  non-zero, initialize the last element.

* test-suite/tests/srfi-4.test ("TAG vectors")["make-TAGvector"]: New
  tests.
2010-03-02 23:16:26 +01:00
Andy Wingo
09834e439b fix bug in generalized-vector->list
* libguile/generalized-vectors.c (scm_generalized_vector_to_list): Fix
  bug iterating over indices of array. Thanks to Tristan Colgate for the
  report.

* test-suite/tests/srfi-4.test: Add tests that uniform-vector->list
  works for all kinds of uniform vectors.
2010-01-03 12:37:07 +01:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Kevin Ryde
6e7d5622ee merge from 1.8 branch 2006-04-16 23:37:40 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
f16f4d3cae Use (test-suite lib) module. 2005-01-07 00:31:36 +00:00
Martin Grabmüller
39cb0b041d * tests/srfi-4.test: New file. 2001-06-27 13:17:12 +00:00