diff options
author | Mark Galassi <mark+savannah@galassi.org> | 1997-10-13 07:25:31 +0000 |
---|---|---|
committer | Mark Galassi <mark+savannah@galassi.org> | 1997-10-13 07:25:31 +0000 |
commit | e5eece747e920b3510aa661f3e4483ec440b3b96 (patch) | |
tree | 14e89911c131d7ab94530a786d51c78c3abedbaa /libguile/gh.h | |
parent | da7f71d7d59969c10b80bd501dbea024318f6d90 (diff) | |
download | guile-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.h')
-rw-r--r-- | libguile/gh.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libguile/gh.h b/libguile/gh.h index c62ad50c9..f3c4ea968 100644 --- a/libguile/gh.h +++ b/libguile/gh.h @@ -76,6 +76,7 @@ SCM gh_eval_str_with_standard_handler(char *scheme_code); SCM gh_eval_str_with_stack_saving_handler(char *scheme_code); SCM gh_eval_file(char *fname); +#define gh_load(fname) gh_eval_file(fname) SCM gh_eval_file_with_catch(char *scheme_code, scm_catch_handler_t handler); SCM gh_eval_file_with_standard_handler(char *scheme_code); @@ -143,10 +144,20 @@ int gh_equal_p(SCM x, SCM y); SCM gh_define(char *name, SCM val); -SCM gh_vector(SCM length, SCM val); +/* vector manipulation routines */ +/* note that gh_vector() does not behave quite like the Scheme (vector + obj1 obj2 ...), because the interpreter engine does not pass the + data element by element, but rather as a list. thus, gh_vector() + ends up being identical to gh_list_to_vector() */ +#define gh_vector(ls) scm_vector(ls) +SCM gh_make_vector(SCM length, SCM val); SCM gh_vset(SCM vec, SCM pos, SCM val); SCM gh_vref(SCM vec, SCM pos); +SCM gh_vector_set(SCM vec, SCM pos, SCM val); +SCM gh_vector_ref(SCM vec, SCM pos); unsigned long gh_vector_length(SCM v); +#define gh_list_to_vector(ls) scm_vector(ls) +#define gh_vector_to_list(v) scm_vector_to_list(ls) SCM gh_lookup (char *sname); SCM gh_module_lookup (SCM vector, char *sname); |