diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1997-09-15 21:20:48 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1997-09-15 21:20:48 +0000 |
commit | 92396c0aa11dfff27e62fbb8bbc1c20f57c2c766 (patch) | |
tree | a9e9fe12d9937757c4db61ea9aa7cb316d224bb6 /libguile/list.h | |
parent | e69807f074a9889e8a7243a20b40722a8710b008 (diff) | |
download | guile-92396c0aa11dfff27e62fbb8bbc1c20f57c2c766.tar.gz |
* list.h (SCM_LISTn): New macros. Make list creation in C code
prettier. The idea comes from STk.
* sequences.h, sequences.c, append.h, append.c: Removed. These
files implemented non-R4RS operations which would encourage
non-portable programming style and less easy-to-read code.
* Makefile.am (sequences.h, sequences.c, append.h, append.c):
Removed.
* libguile.h, eval.c, init.c, stime.c, unif.c: Removed #include
sequences.h, #include append.h.
* gh.h, gh_list.c: Renamed gh_list_length --> gh_length.
* list.h, list.c: Renamed scm_list_length --> scm_length, scm
Diffstat (limited to 'libguile/list.h')
-rw-r--r-- | libguile/list.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/libguile/list.h b/libguile/list.h index f6dbf187a..7e5dcb2b1 100644 --- a/libguile/list.h +++ b/libguile/list.h @@ -47,17 +47,36 @@ #include "libguile/__scm.h" + +#define SCM_LIST0 SCM_EOL +#define SCM_LIST1(e0) scm_cons ((e0), SCM_EOL) +#define SCM_LIST2(e0, e1) scm_cons2 ((e0), (e1), SCM_EOL) +#define SCM_LIST3(e0, e1, e2) scm_cons ((e0), SCM_LIST2 ((e1), (e2))) +#define SCM_LIST4(e0, e1, e2, e3)\ + scm_cons2 ((e0), (e1), SCM_LIST2 ((e2), (e3))) +#define SCM_LIST5(e0, e1, e2, e3, e4)\ + scm_cons ((e0), SCM_LIST4 ((e1), (e2), (e3), (e4))) +#define SCM_LIST6(e0, e1, e2, e3, e4, e5)\ + scm_cons2 ((e0), (e1), SCM_LIST4 ((e2), (e3), (e4), (e5))) +#define SCM_LIST7(e0, e1, e2, e3, e4, e5, e6)\ + scm_cons ((e0), SCM_LIST6 ((e1), (e2), (e3), (e4), (e5), (e6))) +#define SCM_LIST8(e0, e1, e2, e3, e4, e5, e6, e7)\ + scm_cons2 ((e0), (e1), SCM_LIST6 ((e2), (e3), (e4), (e5), (e6), (e7))) +#define SCM_LIST9(e0, e1, e2, e3, e4, e5, e6, e7, e8)\ + scm_cons ((e0),\ + SCM_LIST8 ((e1), (e2), (e3), (e4), (e5), (e6), (e7), (e8))) + extern SCM scm_list_head SCM_P ((SCM lst, SCM k)); extern SCM scm_listify SCM_P ((SCM elt, ...)); extern SCM scm_list SCM_P ((SCM objs)); extern SCM scm_null_p SCM_P ((SCM x)); extern SCM scm_list_p SCM_P ((SCM x)); extern long scm_ilength SCM_P ((SCM sx)); -extern SCM scm_list_length SCM_P ((SCM x)); -extern SCM scm_list_append SCM_P ((SCM args)); -extern SCM scm_list_append_x SCM_P ((SCM args)); -extern SCM scm_list_reverse SCM_P ((SCM lst)); -extern SCM scm_list_reverse_x SCM_P ((SCM lst, SCM newtail)); +extern SCM scm_length SCM_P ((SCM x)); +extern SCM scm_append SCM_P ((SCM args)); +extern SCM scm_append_x SCM_P ((SCM args)); +extern SCM scm_reverse SCM_P ((SCM lst)); +extern SCM scm_reverse_x SCM_P ((SCM lst, SCM newtail)); extern SCM scm_list_ref SCM_P ((SCM lst, SCM k)); extern SCM scm_list_set_x SCM_P ((SCM lst, SCM k, SCM val)); extern SCM scm_list_cdr_set_x SCM_P ((SCM lst, SCM k, SCM val)); |