1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 01:00:20 +02:00

* list.h (scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5,

scm_list_n): New functions.
	(SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5,
	SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify): Deprecated.
	(lots of files): Use the new functions.

	* goops.c (CALL_GF1, CALL_GF2, CALL_GF3, CALL_GF4): Use scm_call_N.

	* strings.c: #include "libguile/deprecation.h".
This commit is contained in:
Keisuke Nishida 2001-06-28 01:11:59 +00:00
parent 02d9f38817
commit 1afff62054
38 changed files with 368 additions and 300 deletions

View file

@ -60,8 +60,54 @@
/* creating lists */
#define SCM_I_CONS(cell,x,y) \
do { \
SCM_NEWCELL (cell); \
SCM_SET_CELL_OBJECT_0 (cell, x); \
SCM_SET_CELL_OBJECT_1 (cell, y); \
} while (0)
SCM
scm_listify (SCM elt, ...)
scm_list_1 (SCM e1)
{
SCM c1;
SCM_I_CONS (c1, e1, SCM_EOL);
return c1;
}
SCM
scm_list_2 (SCM e1, SCM e2)
{
SCM c1, c2;
SCM_I_CONS (c2, e2, SCM_EOL);
SCM_I_CONS (c1, e1, c2);
return c1;
}
SCM
scm_list_3 (SCM e1, SCM e2, SCM e3)
{
SCM c1, c2, c3;
SCM_I_CONS (c3, e3, SCM_EOL);
SCM_I_CONS (c2, e2, c3);
SCM_I_CONS (c1, e1, c2);
return c1;
}
SCM
scm_list_4 (SCM e1, SCM e2, SCM e3, SCM e4)
{
return scm_cons2 (e1, e2, scm_list_2 (e3, e4));
}
SCM
scm_list_5 (SCM e1, SCM e2, SCM e3, SCM e4, SCM e5)
{
return scm_cons2 (e1, e2, scm_list_3 (e3, e4, e5));
}
SCM
scm_list_n (SCM elt, ...)
{
va_list foo;
SCM answer = SCM_EOL;
@ -286,7 +332,7 @@ SCM_DEFINE (scm_last_pair, "last-pair", 1, 0, 0,
tortoise = SCM_CDR(tortoise);
}
while (! SCM_EQ_P (hare, tortoise));
SCM_MISC_ERROR ("Circular structure in position 1: ~S", SCM_LIST1 (lst));
SCM_MISC_ERROR ("Circular structure in position 1: ~S", scm_list_1 (lst));
}
#undef FUNC_NAME
@ -315,7 +361,7 @@ SCM_DEFINE (scm_reverse, "reverse", 1, 0, 0,
tortoise = SCM_CDR (tortoise);
}
while (! SCM_EQ_P (hare, tortoise));
SCM_MISC_ERROR ("Circular structure in position 1: ~S", SCM_LIST1 (lst));
SCM_MISC_ERROR ("Circular structure in position 1: ~S", scm_list_1 (lst));
}
#undef FUNC_NAME