diff options
author | Marius Vollmer <mvo@zagadka.de> | 2004-11-12 18:55:25 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2004-11-12 18:55:25 +0000 |
commit | 02339e5b9b0b93c4181991b259cf38d71066a5dd (patch) | |
tree | d152b6c9c9d0f31f4e1c5859bcd44c4d4baabe33 /libguile/unif.h | |
parent | 4049959855462b48da4a4e1fdd9aafd3cc20fd1a (diff) | |
download | guile-02339e5b9b0b93c4181991b259cf38d71066a5dd.tar.gz |
(scm_tc16_enclosed_array, SCM_ENCLOSED_ARRAYP):
New.
(exactly_one_third, singp): Removed.
(scm_array_p, scm_array_dimensions, scm_shared_array_root,
scm_shared_array_offset, scm_shared_array_increments): Handle
enclosed arrays explicitely.
(scm_array_rank): Likewise. Also, do not return zero for
non-arrays, signal an error instead since arrays with rank zero do
exist.
(scm_i_make_ra): New, for specifying the tag of the new array.
(scm_make_enclosed_array): Use it.
(scm_make_ra): Reimplemented in terms of scm_i_make_ra.
(scm_make_shared_array): Use scm_c_generalized_vector_length
instead of scm_uniform_vector_length.
(scm_array_in_bounds_p): Rewritten to be much cleaner.
(scm_i_cvref): New, doing the job of scm_cvref.
(scm_cvref): Use scm_i_cvref.
(scm_array_ref): Do not accept non-arrays when no indices are
given. Use scm_i_cvref to do the actual access.
("uniform-array-set1"): Do not register.
(scm_array_set_x, scm_uniform_array_read_x,
scm_uniform_array_write): Handle enclosed arrays explicitly.
(ra2l): Use scm_i_cvref instead of scm_uniform_vector_ref to also
handle enclosed arrays.
(scm_array_to_list): Handle enclosed arrays explicitly.
(rapr1): Removed.
(scm_i_print_array_dimension): Use scm_i_cvref to also handle
enclosed arrays.
(scm_i_print_enclosed_array): New.
(tag_proto_table, tag_creator_table): Renamed former to latter.
Added "a" and "b" for strings and bitvectors, resp.
(scm_i_tag_to_prototype, scm_i_tag_to_creator): Renamed former to
latter. Tag "a" is in the table now, no need to handle it as a
legacy tag.
(scm_raprin1): Just call scm_iprin1.
(scm_array_creator, scm_array_prototype): Handle enclosed arrays
explicitly.
(scm_init_unif): Initialize scm_tc16_enclosed_array smob.
Use scm_i_print_array as printer for scm_tc16_array.
Diffstat (limited to 'libguile/unif.h')
-rw-r--r-- | libguile/unif.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libguile/unif.h b/libguile/unif.h index 5b86604d5..4ab93f44e 100644 --- a/libguile/unif.h +++ b/libguile/unif.h @@ -57,10 +57,12 @@ typedef struct scm_t_array_dim } scm_t_array_dim; SCM_API scm_t_bits scm_tc16_array; +SCM_API scm_t_bits scm_tc16_enclosed_array; #define SCM_ARRAY_FLAG_CONTIGUOUS (1 << 16) #define SCM_ARRAYP(a) SCM_TYP16_PREDICATE (scm_tc16_array, a) +#define SCM_ENCLOSED_ARRAYP(a) SCM_TYP16_PREDICATE (scm_tc16_enclosed_array, a) #define SCM_ARRAY_NDIM(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 17)) #define SCM_ARRAY_CONTP(x) (SCM_CELL_WORD_0 (x) & SCM_ARRAY_FLAG_CONTIGUOUS) #define SCM_SET_ARRAY_CONTIGUOUS_FLAG(x) \ @@ -79,9 +81,6 @@ SCM_API SCM scm_array_dimensions (SCM ra); SCM_API SCM scm_shared_array_root (SCM ra); SCM_API SCM scm_shared_array_offset (SCM ra); SCM_API SCM scm_shared_array_increments (SCM ra); -SCM_API long scm_aind (SCM ra, SCM args, const char *what); -SCM_API SCM scm_shap2ra (SCM args, const char *what); -SCM_API SCM scm_dimensions_to_uniform_array (SCM dims, SCM prot, SCM fill); SCM_API SCM scm_make_shared_array (SCM oldra, SCM mapfunc, SCM dims); SCM_API SCM scm_transpose_array (SCM ra, SCM args); SCM_API SCM scm_enclose_array (SCM ra, SCM axes); @@ -89,11 +88,11 @@ SCM_API SCM scm_array_in_bounds_p (SCM v, SCM args); SCM_API SCM scm_array_ref (SCM v, SCM args); SCM_API SCM scm_array_set_x (SCM v, SCM obj, SCM args); SCM_API SCM scm_array_contents (SCM ra, SCM strict); -SCM_API SCM scm_ra2contig (SCM ra, int copy); -SCM_API SCM scm_uniform_array_read_x (SCM ra, SCM port_or_fd, SCM start, SCM end); -SCM_API SCM scm_uniform_array_write (SCM v, SCM port_or_fd, SCM start, SCM end); +SCM_API SCM scm_uniform_array_read_x (SCM ra, SCM port_or_fd, + SCM start, SCM end); +SCM_API SCM scm_uniform_array_write (SCM v, SCM port_or_fd, + SCM start, SCM end); SCM_API SCM scm_array_to_list (SCM v); -SCM_API SCM scm_list_to_uniform_array (SCM ndim, SCM prot, SCM lst); SCM_API SCM scm_array_creator (SCM ra); SCM_API SCM scm_i_read_array (SCM port, int c); @@ -135,6 +134,11 @@ SCM_API SCM scm_cvref (SCM v, unsigned long pos, SCM last); SCM_API SCM scm_istr2bve (SCM str); SCM_API int scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate); SCM_API SCM scm_array_prototype (SCM ra); +SCM_API SCM scm_list_to_uniform_array (SCM ndim, SCM prot, SCM lst); +SCM_API long scm_aind (SCM ra, SCM args, const char *what); +SCM_API SCM scm_shap2ra (SCM args, const char *what); +SCM_API SCM scm_dimensions_to_uniform_array (SCM dims, SCM prot, SCM fill); +SCM_API SCM scm_ra2contig (SCM ra, int copy); SCM_API SCM scm_i_proc_make_vector; SCM_API SCM scm_i_proc_make_string; |