summaryrefslogtreecommitdiff
path: root/libguile/gh_data.c
diff options
context:
space:
mode:
authorMark Galassi <mark+savannah@galassi.org>1997-10-13 07:25:31 +0000
committerMark Galassi <mark+savannah@galassi.org>1997-10-13 07:25:31 +0000
commite5eece747e920b3510aa661f3e4483ec440b3b96 (patch)
tree14e89911c131d7ab94530a786d51c78c3abedbaa /libguile/gh_data.c
parentda7f71d7d59969c10b80bd501dbea024318f6d90 (diff)
downloadguile-e5eece747e920b3510aa661f3e4483ec440b3b96.tar.gz
* gh_test_repl.c (c_vector_test): same as gh_test_c.c
* gh_test_c.c (c_vector_test): some improvements on the vector routines test. * gh.h (gh_vector): this used to exist but do the wrong thing. Now it (almost) does the right thing, though it takes a list instead of the individual arguments. I need to see how it could be done right. (gh_list_to_vector): added this function as a macro. Corresponds to Scheme's (list->vector ...). (gh_vector_to_list): added this function as a macro. Corresponds to Scheme's (vector->list ...). * gh_data.c (gh_vector_ref): renamed from gh_vref to gh_vector_ref, so that it resembles the Scheme routines more. (gh_vector_set): renamed from gh_vset to gh_vector_set, so that it resembles the Scheme routines more. (gh_make_vector): this used to be (stupidly) called gh_vector(). This is the right name, since it does the same thing as the Scheme (make-vector ...) procedure.
Diffstat (limited to 'libguile/gh_data.c')
-rw-r--r--libguile/gh_data.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libguile/gh_data.c b/libguile/gh_data.c
index 9373cadda..15d9afe5b 100644
--- a/libguile/gh_data.c
+++ b/libguile/gh_data.c
@@ -265,22 +265,25 @@ gh_symbol2newstr (SCM sym, int *lenp)
/* create a new vector of the given length, all initialized to the
given value */
-SCM
-gh_vector (SCM length, SCM val)
+SCM
+gh_make_vector (SCM len, SCM fill)
{
- return scm_make_vector (length, val, SCM_UNDEFINED);
+ /* scm_make_vector() takes a third boolean argument which should be
+ set to SCM_BOOL_T when you are dealing with multi-dimensional
+ arrays; gh_make_vector() does not do multi-dimensional arrays */
+ return scm_make_vector(len, fill, SCM_BOOL_F);
}
/* set the given element of the given vector to the given value */
SCM
-gh_vset (SCM vec, SCM pos, SCM val)
+gh_vector_set (SCM vec, SCM pos, SCM val)
{
return scm_vector_set_x (vec, pos, val);
}
/* retrieve the given element of the given vector */
SCM
-gh_vref (SCM vec, SCM pos)
+gh_vector_ref (SCM vec, SCM pos)
{
return scm_vector_ref (vec, pos);
}