1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +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

@ -1,3 +1,15 @@
2001-06-28 Keisuke Nishida <kxn30@po.cwru.edu>
* 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".
2001-06-27 Martin Grabmueller <mgrabmue@cs.tu-berlin.de> 2001-06-27 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* read.c (scm_lreadr): When reading a hash token, check for a * read.c (scm_lreadr): When reading a hash token, check for a

View file

@ -232,7 +232,7 @@ continuation_apply (SCM cont, SCM args)
|| continuation->base != rootcont->base) || continuation->base != rootcont->base)
{ {
SCM_MISC_ERROR ("continuation from wrong top level: ~S", SCM_MISC_ERROR ("continuation from wrong top level: ~S",
SCM_LIST1 (cont)); scm_list_1 (cont));
} }
scm_dowinds (continuation->dynenv, scm_dowinds (continuation->dynenv,

View file

@ -66,7 +66,7 @@ scm_c_issue_deprecation_warning (const char *msg)
if (SCM_BOOLP (issued_msgs)) if (SCM_BOOLP (issued_msgs))
issued_msgs = SCM_BOOL_T; issued_msgs = SCM_BOOL_T;
else else
scm_issue_deprecation_warning (SCM_LIST1 (scm_makfrom0str (msg))); scm_issue_deprecation_warning (scm_list_1 (scm_makfrom0str (msg)));
} }
SCM_DEFINE(scm_issue_deprecation_warning, SCM_DEFINE(scm_issue_deprecation_warning,

View file

@ -254,7 +254,7 @@ sysdep_dynl_link (const char *fname, const char *subr)
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
fn = scm_makfrom0str (fname); fn = scm_makfrom0str (fname);
msg = scm_makfrom0str (lt_dlerror ()); msg = scm_makfrom0str (lt_dlerror ());
scm_misc_error (subr, "file: ~S, message: ~S", SCM_LIST2 (fn, msg)); scm_misc_error (subr, "file: ~S, message: ~S", scm_list_2 (fn, msg));
} }
return (void *) handle; return (void *) handle;
} }

View file

@ -816,7 +816,7 @@ update_catch_handler (void *ptr, SCM tag, SCM args)
SCM observer = data->observer; SCM observer = data->observer;
SCM message = scm_makfrom0str ("Observer `~A' signals `~A' error: ~S"); SCM message = scm_makfrom0str ("Observer `~A' signals `~A' error: ~S");
return scm_cons (message, SCM_LIST3 (observer, tag, args)); return scm_cons (message, scm_list_3 (observer, tag, args));
} }

View file

@ -81,10 +81,10 @@ scm_error (SCM key, const char *subr, const char *message, SCM args, SCM rest)
message ? message : "<empty message>"); message ? message : "<empty message>");
abort (); abort ();
} }
arg_list = SCM_LIST4 (subr ? scm_makfrom0str (subr) : SCM_BOOL_F, arg_list = scm_list_4 (subr ? scm_makfrom0str (subr) : SCM_BOOL_F,
message ? scm_makfrom0str (message) : SCM_BOOL_F, message ? scm_makfrom0str (message) : SCM_BOOL_F,
args, args,
rest); rest);
scm_ithrow (key, arg_list, 1); scm_ithrow (key, arg_list, 1);
/* No return, but just in case: */ /* No return, but just in case: */
@ -202,7 +202,7 @@ scm_out_of_range (const char *subr, SCM bad_value)
scm_error (scm_out_of_range_key, scm_error (scm_out_of_range_key,
subr, subr,
"Argument out of range: ~S", "Argument out of range: ~S",
SCM_LIST1(bad_value), scm_list_1 (bad_value),
SCM_BOOL_F); SCM_BOOL_F);
} }
@ -212,7 +212,7 @@ scm_out_of_range_pos (const char *subr, SCM bad_value, SCM pos)
scm_error (scm_out_of_range_key, scm_error (scm_out_of_range_key,
subr, subr,
"Argument ~S out of range: ~S", "Argument ~S out of range: ~S",
SCM_LIST2(pos,bad_value), scm_list_2 (pos,bad_value),
SCM_BOOL_F); SCM_BOOL_F);
} }
@ -224,7 +224,7 @@ scm_wrong_num_args (SCM proc)
scm_error (scm_args_number_key, scm_error (scm_args_number_key,
NULL, NULL,
"Wrong number of arguments to ~A", "Wrong number of arguments to ~A",
SCM_LIST1(proc), scm_list_1 (proc),
SCM_BOOL_F); SCM_BOOL_F);
} }
@ -235,7 +235,7 @@ scm_error_num_args_subr (const char *subr)
scm_error (scm_args_number_key, scm_error (scm_args_number_key,
NULL, NULL,
"Wrong number of arguments to ~A", "Wrong number of arguments to ~A",
SCM_LIST1 (scm_makfrom0str (subr)), scm_list_1 (scm_makfrom0str (subr)),
SCM_BOOL_F); SCM_BOOL_F);
} }
@ -248,8 +248,8 @@ scm_wrong_type_arg (const char *subr, int pos, SCM bad_value)
subr, subr,
(pos == 0) ? "Wrong type argument: ~S" (pos == 0) ? "Wrong type argument: ~S"
: "Wrong type argument in position ~A: ~S", : "Wrong type argument in position ~A: ~S",
(pos == 0) ? SCM_LIST1(bad_value) (pos == 0) ? scm_list_1 (bad_value)
: SCM_LIST2(SCM_MAKINUM(pos), bad_value), : scm_list_2 (SCM_MAKINUM (pos), bad_value),
SCM_BOOL_F); SCM_BOOL_F);
} }
@ -260,13 +260,13 @@ scm_wrong_type_arg_msg (const char *subr, int pos, SCM bad_value, const char *sz
if (pos == 0) { if (pos == 0) {
scm_error (scm_arg_type_key, scm_error (scm_arg_type_key,
subr, "Wrong type argument (expecting ~A): ~S", subr, "Wrong type argument (expecting ~A): ~S",
SCM_LIST2(msg,bad_value), scm_list_2 (msg, bad_value),
SCM_BOOL_F); SCM_BOOL_F);
} else { } else {
scm_error (scm_arg_type_key, scm_error (scm_arg_type_key,
subr, subr,
"Wrong type argument in position ~A (expecting ~A): ~S", "Wrong type argument in position ~A (expecting ~A): ~S",
SCM_LIST3(SCM_MAKINUM(pos),msg,bad_value), scm_list_3 (SCM_MAKINUM (pos), msg, bad_value),
SCM_BOOL_F); SCM_BOOL_F);
} }
} }
@ -300,7 +300,7 @@ scm_wta (SCM arg, const char *pos, const char *s_subr)
if ((~0x1fL) & (long) pos) if ((~0x1fL) & (long) pos)
{ {
/* error string supplied. */ /* error string supplied. */
scm_misc_error (s_subr, pos, SCM_LIST1 (arg)); scm_misc_error (s_subr, pos, scm_list_1 (arg));
} }
else else
{ {

View file

@ -2523,7 +2523,7 @@ dispatch:
proc = x; proc = x;
badfun: badfun:
/* scm_everr (x, env,...) */ /* scm_everr (x, env,...) */
scm_misc_error (NULL, "Wrong type to apply: ~S", SCM_LIST1 (proc)); scm_misc_error (NULL, "Wrong type to apply: ~S", scm_list_1 (proc));
case scm_tc7_vector: case scm_tc7_vector:
case scm_tc7_wvect: case scm_tc7_wvect:
#ifdef HAVE_ARRAYS #ifdef HAVE_ARRAYS

View file

@ -63,8 +63,8 @@ scm_m_generalized_set_x (SCM xorig, SCM env SCM_UNUSED)
if (SCM_SYMBOLP (SCM_CAR (x))) if (SCM_SYMBOLP (SCM_CAR (x)))
return scm_cons (SCM_IM_SET_X, x); return scm_cons (SCM_IM_SET_X, x);
else if (SCM_CONSP (SCM_CAR (x))) else if (SCM_CONSP (SCM_CAR (x)))
return scm_cons (SCM_LIST2 (scm_sym_setter, SCM_CAAR (x)), return scm_cons (scm_list_2 (scm_sym_setter, SCM_CAAR (x)),
scm_append (SCM_LIST2 (SCM_CDAR (x), SCM_CDR (x)))); scm_append (scm_list_2 (SCM_CDAR (x), SCM_CDR (x))));
else else
scm_misc_error (scm_s_set_x, scm_s_variable, SCM_EOL); scm_misc_error (scm_s_set_x, scm_s_variable, SCM_EOL);
} }

View file

@ -574,7 +574,8 @@ SCM_DEFINE (scm_stat, "stat", 1, 0, 0,
int en = errno; int en = errno;
SCM_SYSERROR_MSG ("~A: ~S", SCM_SYSERROR_MSG ("~A: ~S",
SCM_LIST2 (scm_makfrom0str (strerror (errno)), object), scm_list_2 (scm_makfrom0str (strerror (errno)),
object),
en); en);
} }
return scm_stat2scm (&stat_temp); return scm_stat2scm (&stat_temp);
@ -753,7 +754,7 @@ SCM_DEFINE (scm_readdir, "readdir", 1, 0, 0,
SCM_VALIDATE_DIR (1, port); SCM_VALIDATE_DIR (1, port);
if (!SCM_DIR_OPEN_P (port)) if (!SCM_DIR_OPEN_P (port))
SCM_MISC_ERROR ("Directory ~S is not open.", SCM_LIST1 (port)); SCM_MISC_ERROR ("Directory ~S is not open.", scm_list_1 (port));
errno = 0; errno = 0;
SCM_SYSCALL (rdent = readdir ((DIR *) SCM_CELL_WORD_1 (port))); SCM_SYSCALL (rdent = readdir ((DIR *) SCM_CELL_WORD_1 (port)));
@ -774,7 +775,7 @@ SCM_DEFINE (scm_rewinddir, "rewinddir", 1, 0, 0,
{ {
SCM_VALIDATE_DIR (1, port); SCM_VALIDATE_DIR (1, port);
if (!SCM_DIR_OPEN_P (port)) if (!SCM_DIR_OPEN_P (port))
SCM_MISC_ERROR ("Directory ~S is not open.", SCM_LIST1 (port)); SCM_MISC_ERROR ("Directory ~S is not open.", scm_list_1 (port));
rewinddir ((DIR *) SCM_CELL_WORD_1 (port)); rewinddir ((DIR *) SCM_CELL_WORD_1 (port));
@ -1162,9 +1163,9 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0,
if (rv < 0) if (rv < 0)
SCM_SYSERROR; SCM_SYSERROR;
} }
return SCM_LIST3 (retrieve_select_type (&read_set, read_ports_ready, reads), return scm_list_3 (retrieve_select_type (&read_set, read_ports_ready, reads),
retrieve_select_type (&write_set, write_ports_ready, writes), retrieve_select_type (&write_set, write_ports_ready, writes),
retrieve_select_type (&except_set, SCM_EOL, excepts)); retrieve_select_type (&except_set, SCM_EOL, excepts));
} }
#undef FUNC_NAME #undef FUNC_NAME
#endif /* HAVE_SELECT */ #endif /* HAVE_SELECT */
@ -1325,7 +1326,7 @@ SCM_DEFINE (scm_lstat, "lstat", 1, 0, 0,
int en = errno; int en = errno;
SCM_SYSERROR_MSG ("~A: ~S", SCM_SYSERROR_MSG ("~A: ~S",
SCM_LIST2 (scm_makfrom0str (strerror (errno)), str), scm_list_2 (scm_makfrom0str (strerror (errno)), str),
en); en);
} }
return scm_stat2scm(&stat_temp); return scm_stat2scm(&stat_temp);

View file

@ -253,7 +253,7 @@ SCM
scm_c_with_fluid (SCM fluid, SCM value, SCM (*cproc) (), void *cdata) scm_c_with_fluid (SCM fluid, SCM value, SCM (*cproc) (), void *cdata)
#define FUNC_NAME "scm_c_with_fluid" #define FUNC_NAME "scm_c_with_fluid"
{ {
return scm_c_with_fluids (SCM_LIST1 (fluid), SCM_LIST1 (value), return scm_c_with_fluids (scm_list_1 (fluid), SCM_LIST1 (value),
cproc, cdata); cproc, cdata);
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -841,18 +841,18 @@ SCM_DEFINE (scm_gc_stats, "gc-stats", 0, 0, 0,
local_scm_gc_cells_swept = scm_gc_cells_swept_acc; local_scm_gc_cells_swept = scm_gc_cells_swept_acc;
local_scm_gc_cells_marked = scm_gc_cells_marked_acc; local_scm_gc_cells_marked = scm_gc_cells_marked_acc;
answer = scm_listify (scm_cons (sym_gc_time_taken, scm_ulong2num (local_scm_gc_time_taken)), answer = scm_list_n (scm_cons (sym_gc_time_taken, scm_ulong2num (local_scm_gc_time_taken)),
scm_cons (sym_cells_allocated, scm_ulong2num (local_scm_cells_allocated)), scm_cons (sym_cells_allocated, scm_ulong2num (local_scm_cells_allocated)),
scm_cons (sym_heap_size, scm_ulong2num (local_scm_heap_size)), scm_cons (sym_heap_size, scm_ulong2num (local_scm_heap_size)),
scm_cons (sym_mallocated, scm_ulong2num (local_scm_mallocated)), scm_cons (sym_mallocated, scm_ulong2num (local_scm_mallocated)),
scm_cons (sym_mtrigger, scm_ulong2num (local_scm_mtrigger)), scm_cons (sym_mtrigger, scm_ulong2num (local_scm_mtrigger)),
scm_cons (sym_times, scm_ulong2num (local_scm_gc_times)), scm_cons (sym_times, scm_ulong2num (local_scm_gc_times)),
scm_cons (sym_gc_mark_time_taken, scm_ulong2num (local_scm_gc_mark_time_taken)), scm_cons (sym_gc_mark_time_taken, scm_ulong2num (local_scm_gc_mark_time_taken)),
scm_cons (sym_gc_sweep_time_taken, scm_ulong2num (local_scm_gc_sweep_time_taken)), scm_cons (sym_gc_sweep_time_taken, scm_ulong2num (local_scm_gc_sweep_time_taken)),
scm_cons (sym_cells_marked, scm_i_dbl2big (local_scm_gc_cells_marked)), scm_cons (sym_cells_marked, scm_i_dbl2big (local_scm_gc_cells_marked)),
scm_cons (sym_cells_swept, scm_i_dbl2big (local_scm_gc_cells_swept)), scm_cons (sym_cells_swept, scm_i_dbl2big (local_scm_gc_cells_swept)),
scm_cons (sym_heap_segments, heap_segs), scm_cons (sym_heap_segments, heap_segs),
SCM_UNDEFINED); SCM_UNDEFINED);
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
return answer; return answer;
} }

View file

@ -188,7 +188,7 @@ SCM gh_lookup (const char *sname);
SCM gh_module_lookup (SCM module, const char *sname); SCM gh_module_lookup (SCM module, const char *sname);
SCM gh_cons(SCM x, SCM y); SCM gh_cons(SCM x, SCM y);
#define gh_list scm_listify #define gh_list scm_list_n
unsigned long gh_length(SCM l); unsigned long gh_length(SCM l);
SCM gh_append(SCM args); SCM gh_append(SCM args);
SCM gh_append2(SCM l1, SCM l2); SCM gh_append2(SCM l1, SCM l2);

View file

@ -59,27 +59,27 @@ gh_length (SCM l)
them all together into a single list, which is returned. This is them all together into a single list, which is returned. This is
equivalent to the Scheme procedure (append list1 list2 ...) */ equivalent to the Scheme procedure (append list1 list2 ...) */
SCM SCM
gh_append(SCM args) gh_append (SCM args)
{ {
return scm_append(args); return scm_append (args);
} }
SCM SCM
gh_append2(SCM l1, SCM l2) gh_append2 (SCM l1, SCM l2)
{ {
return scm_append(scm_listify(l1, l2, SCM_UNDEFINED)); return scm_append (scm_list_2 (l1, l2));
} }
SCM SCM
gh_append3(SCM l1, SCM l2, SCM l3) gh_append3(SCM l1, SCM l2, SCM l3)
{ {
return scm_append(scm_listify(l1, l2, l3, SCM_UNDEFINED)); return scm_append (scm_list_3 (l1, l2, l3));
} }
SCM SCM
gh_append4(SCM l1, SCM l2, SCM l3, SCM l4) gh_append4 (SCM l1, SCM l2, SCM l3, SCM l4)
{ {
return scm_append(scm_listify(l1, l2, l3, l4, SCM_UNDEFINED)); return scm_append (scm_list_4 (l1, l2, l3, l4));
} }
/* gh_reverse() is defined as a macro in gh.h */ /* gh_reverse() is defined as a macro in gh.h */

View file

@ -76,22 +76,22 @@
#define SPEC_OF(x) SCM_SLOT (x, scm_si_specializers) #define SPEC_OF(x) SCM_SLOT (x, scm_si_specializers)
#define DEFVAR(v,val) \ #define DEFVAR(v,val) \
{ scm_eval (SCM_LIST3 (scm_sym_define_public, (v), (val)), \ { scm_eval (scm_list_3 (scm_sym_define_public, (v), (val)), \
scm_module_goops); } scm_module_goops); }
/* Temporary hack until we get the new module system */ /* Temporary hack until we get the new module system */
/*fixme* Should optimize by keeping track of the variable object itself */ /*fixme* Should optimize by keeping track of the variable object itself */
#define GETVAR(v) (SCM_VARIABLE_REF (scm_call_2 (scm_goops_lookup_closure, \ #define GETVAR(v) (SCM_VARIABLE_REF (scm_call_2 (scm_goops_lookup_closure, \
(v), SCM_BOOL_F))) (v), SCM_BOOL_F)))
/* Fixme: Should use already interned symbols */ /* Fixme: Should use already interned symbols */
#define CALL_GF1(name,a) (scm_apply (GETVAR (scm_str2symbol (name)), \ #define CALL_GF1(name,a) (scm_call_1 (GETVAR (scm_str2symbol (name)), \
SCM_LIST1 (a), SCM_EOL)) a))
#define CALL_GF2(name,a,b) (scm_apply (GETVAR (scm_str2symbol (name)), \ #define CALL_GF2(name,a,b) (scm_call_2 (GETVAR (scm_str2symbol (name)), \
SCM_LIST2 (a, b), SCM_EOL)) a, b))
#define CALL_GF3(name,a,b,c) (scm_apply (GETVAR (scm_str2symbol (name)), \ #define CALL_GF3(name,a,b,c) (scm_call_3 (GETVAR (scm_str2symbol (name)), \
SCM_LIST3 (a, b, c), SCM_EOL)) a, b, c))
#define CALL_GF4(name,a,b,c,d) (scm_apply (GETVAR (scm_str2symbol (name)), \ #define CALL_GF4(name,a,b,c,d) (scm_call_4 (GETVAR (scm_str2symbol (name)), \
SCM_LIST4 (a, b, c, d), SCM_EOL)) a, b, c, d))
/* Class redefinition protocol: /* Class redefinition protocol:
@ -245,7 +245,7 @@ remove_duplicate_slots (SCM l, SCM res, SCM slots_already_seen)
tmp = SCM_CAAR (l); tmp = SCM_CAAR (l);
if (!SCM_SYMBOLP (tmp)) if (!SCM_SYMBOLP (tmp))
scm_misc_error ("%compute-slots", "bad slot name ~S", SCM_LIST1 (tmp)); scm_misc_error ("%compute-slots", "bad slot name ~S", scm_list_1 (tmp));
if (SCM_FALSEP (scm_c_memq (tmp, slots_already_seen))) { if (SCM_FALSEP (scm_c_memq (tmp, slots_already_seen))) {
res = scm_cons (SCM_CAR (l), res); res = scm_cons (SCM_CAR (l), res);
@ -261,8 +261,9 @@ build_slots_list (SCM dslots, SCM cpl)
register SCM res = dslots; register SCM res = dslots;
for (cpl = SCM_CDR(cpl); SCM_NNULLP(cpl); cpl = SCM_CDR(cpl)) for (cpl = SCM_CDR(cpl); SCM_NNULLP(cpl); cpl = SCM_CDR(cpl))
res = scm_append (SCM_LIST2 (SCM_SLOT (SCM_CAR (cpl), scm_si_direct_slots), res = scm_append (scm_list_2 (SCM_SLOT (SCM_CAR (cpl),
res)); scm_si_direct_slots),
res));
/* res contains a list of slots. Remove slots which appears more than once */ /* res contains a list of slots. Remove slots which appears more than once */
return remove_duplicate_slots (scm_reverse (res), SCM_EOL, SCM_EOL); return remove_duplicate_slots (scm_reverse (res), SCM_EOL, SCM_EOL);
@ -323,7 +324,7 @@ compute_getters_n_setters (SCM slots)
{ {
init = scm_get_keyword (k_init_value, options, 0); init = scm_get_keyword (k_init_value, options, 0);
if (init) if (init)
init = scm_closure (SCM_LIST2 (SCM_EOL, init), SCM_EOL); init = scm_closure (scm_list_2 (SCM_EOL, init), SCM_EOL);
else else
init = scm_get_keyword (k_init_thunk, options, SCM_BOOL_F); init = scm_get_keyword (k_init_thunk, options, SCM_BOOL_F);
} }
@ -353,7 +354,7 @@ scm_i_get_keyword (SCM key, SCM l, long len, SCM default_value, const char *subr
SCM obj = SCM_CAR (l); SCM obj = SCM_CAR (l);
if (!SCM_KEYWORDP (obj)) if (!SCM_KEYWORDP (obj))
scm_misc_error (subr, "bad keyword: ~S", SCM_LIST1 (obj)); scm_misc_error (subr, "bad keyword: ~S", scm_list_1 (obj));
else if (SCM_EQ_P (obj, key)) else if (SCM_EQ_P (obj, key))
return SCM_CADR (l); return SCM_CADR (l);
else else
@ -379,7 +380,7 @@ SCM_DEFINE (scm_get_keyword, "get-keyword", 3, 0, 0,
SCM_ASSERT (SCM_KEYWORDP (key), key, SCM_ARG1, FUNC_NAME); SCM_ASSERT (SCM_KEYWORDP (key), key, SCM_ARG1, FUNC_NAME);
len = scm_ilength (l); len = scm_ilength (l);
if (len < 0 || len % 2 == 1) if (len < 0 || len % 2 == 1)
scm_misc_error (FUNC_NAME, "Bad keyword-value list: ~S", SCM_LIST1 (l)); scm_misc_error (FUNC_NAME, "Bad keyword-value list: ~S", scm_list_1 (l));
return scm_i_get_keyword (key, l, len, default_value, FUNC_NAME); return scm_i_get_keyword (key, l, len, default_value, FUNC_NAME);
} }
@ -422,7 +423,7 @@ SCM_DEFINE (scm_sys_initialize_object, "%initialize-object", 2, 0, 0,
long n = scm_ilength (SCM_CDR (slot_name)); long n = scm_ilength (SCM_CDR (slot_name));
if (n & 1) /* odd or -1 */ if (n & 1) /* odd or -1 */
SCM_MISC_ERROR ("class contains bogus slot definition: ~S", SCM_MISC_ERROR ("class contains bogus slot definition: ~S",
SCM_LIST1 (slot_name)); scm_list_1 (slot_name));
tmp = scm_i_get_keyword (k_init_keyword, tmp = scm_i_get_keyword (k_init_keyword,
SCM_CDR (slot_name), SCM_CDR (slot_name),
n, n,
@ -434,7 +435,7 @@ SCM_DEFINE (scm_sys_initialize_object, "%initialize-object", 2, 0, 0,
/* an initarg was provided for this slot */ /* an initarg was provided for this slot */
if (!SCM_KEYWORDP (tmp)) if (!SCM_KEYWORDP (tmp))
SCM_MISC_ERROR ("initarg must be a keyword. It was ~S", SCM_MISC_ERROR ("initarg must be a keyword. It was ~S",
SCM_LIST1 (tmp)); scm_list_1 (tmp));
slot_value = scm_i_get_keyword (tmp, slot_value = scm_i_get_keyword (tmp,
initargs, initargs,
n_initargs, n_initargs,
@ -487,12 +488,12 @@ SCM_DEFINE (scm_sys_prep_layout_x, "%prep-layout!", 1, 0, 0,
nfields = SCM_SLOT (class, scm_si_nfields); nfields = SCM_SLOT (class, scm_si_nfields);
if (!SCM_INUMP (nfields) || SCM_INUM (nfields) < 0) if (!SCM_INUMP (nfields) || SCM_INUM (nfields) < 0)
SCM_MISC_ERROR ("bad value in nfields slot: ~S", SCM_MISC_ERROR ("bad value in nfields slot: ~S",
SCM_LIST1 (nfields)); scm_list_1 (nfields));
n = 2 * SCM_INUM (nfields); n = 2 * SCM_INUM (nfields);
if (n < sizeof (SCM_CLASS_CLASS_LAYOUT) - 1 if (n < sizeof (SCM_CLASS_CLASS_LAYOUT) - 1
&& SCM_SUBCLASSP (class, scm_class_class)) && SCM_SUBCLASSP (class, scm_class_class))
SCM_MISC_ERROR ("class object doesn't have enough fields: ~S", SCM_MISC_ERROR ("class object doesn't have enough fields: ~S",
SCM_LIST1 (nfields)); scm_list_1 (nfields));
s = n > 0 ? scm_must_malloc (n, FUNC_NAME) : 0; s = n > 0 ? scm_must_malloc (n, FUNC_NAME) : 0;
for (i = 0; i < n; i += 2) for (i = 0; i < n; i += 2)
@ -606,7 +607,7 @@ scm_basic_basic_make_class (SCM class, SCM name, SCM dsupers, SCM dslots)
/* Initialize its slots */ /* Initialize its slots */
#if 0 #if 0
cpl = compute_cpl (dsupers, SCM_LIST1(z)); cpl = compute_cpl (dsupers, scm_list_1 (z));
#endif #endif
SCM_SET_SLOT (z, scm_si_direct_supers, dsupers); SCM_SET_SLOT (z, scm_si_direct_supers, dsupers);
cpl = compute_cpl (z); cpl = compute_cpl (z);
@ -661,47 +662,47 @@ static SCM
build_class_class_slots () build_class_class_slots ()
{ {
return maplist ( return maplist (
scm_cons (SCM_LIST3 (scm_str2symbol ("layout"), scm_cons (scm_list_3 (scm_str2symbol ("layout"),
k_class, k_class,
scm_class_protected_read_only), scm_class_protected_read_only),
scm_cons (SCM_LIST3 (scm_str2symbol ("vcell"), scm_cons (scm_list_3 (scm_str2symbol ("vcell"),
k_class, k_class,
scm_class_opaque), scm_class_opaque),
scm_cons (SCM_LIST3 (scm_str2symbol ("vtable"), scm_cons (scm_list_3 (scm_str2symbol ("vtable"),
k_class, k_class,
scm_class_self), scm_class_self),
scm_cons (scm_str2symbol ("print"), scm_cons (scm_str2symbol ("print"),
scm_cons (SCM_LIST3 (scm_str2symbol ("procedure"), scm_cons (scm_list_3 (scm_str2symbol ("procedure"),
k_class, k_class,
scm_class_protected_opaque), scm_class_protected_opaque),
scm_cons (SCM_LIST3 (scm_str2symbol ("setter"), scm_cons (scm_list_3 (scm_str2symbol ("setter"),
k_class, k_class,
scm_class_protected_opaque), scm_class_protected_opaque),
scm_cons (scm_str2symbol ("redefined"), scm_cons (scm_str2symbol ("redefined"),
scm_cons (SCM_LIST3 (scm_str2symbol ("h0"), scm_cons (scm_list_3 (scm_str2symbol ("h0"),
k_class, k_class,
scm_class_int), scm_class_int),
scm_cons (SCM_LIST3 (scm_str2symbol ("h1"), scm_cons (scm_list_3 (scm_str2symbol ("h1"),
k_class, k_class,
scm_class_int), scm_class_int),
scm_cons (SCM_LIST3 (scm_str2symbol ("h2"), scm_cons (scm_list_3 (scm_str2symbol ("h2"),
k_class, k_class,
scm_class_int), scm_class_int),
scm_cons (SCM_LIST3 (scm_str2symbol ("h3"), scm_cons (scm_list_3 (scm_str2symbol ("h3"),
k_class, k_class,
scm_class_int), scm_class_int),
scm_cons (SCM_LIST3 (scm_str2symbol ("h4"), scm_cons (scm_list_3 (scm_str2symbol ("h4"),
k_class, k_class,
scm_class_int), scm_class_int),
scm_cons (SCM_LIST3 (scm_str2symbol ("h5"), scm_cons (scm_list_3 (scm_str2symbol ("h5"),
k_class, k_class,
scm_class_int), scm_class_int),
scm_cons (SCM_LIST3 (scm_str2symbol ("h6"), scm_cons (scm_list_3 (scm_str2symbol ("h6"),
k_class, k_class,
scm_class_int), scm_class_int),
scm_cons (SCM_LIST3 (scm_str2symbol ("h7"), scm_cons (scm_list_3 (scm_str2symbol ("h7"),
k_class, k_class,
scm_class_int), scm_class_int),
scm_cons (scm_str2symbol ("name"), scm_cons (scm_str2symbol ("name"),
scm_cons (scm_str2symbol ("direct-supers"), scm_cons (scm_str2symbol ("direct-supers"),
scm_cons (scm_str2symbol ("direct-slots"), scm_cons (scm_str2symbol ("direct-slots"),
@ -763,16 +764,16 @@ create_basic_classes (void)
name = scm_str2symbol ("<object>"); name = scm_str2symbol ("<object>");
scm_class_object = scm_permanent_object (scm_basic_make_class (scm_class_class, scm_class_object = scm_permanent_object (scm_basic_make_class (scm_class_class,
name, name,
SCM_LIST1 (scm_class_top), scm_list_1 (scm_class_top),
SCM_EOL)); SCM_EOL));
DEFVAR (name, scm_class_object); DEFVAR (name, scm_class_object);
/* <top> <object> and <class> were partially initialized. Correct them here */ /* <top> <object> and <class> were partially initialized. Correct them here */
SCM_SET_SLOT (scm_class_object, scm_si_direct_subclasses, SCM_LIST1 (scm_class_class)); SCM_SET_SLOT (scm_class_object, scm_si_direct_subclasses, scm_list_1 (scm_class_class));
SCM_SET_SLOT (scm_class_class, scm_si_direct_supers, SCM_LIST1 (scm_class_object)); SCM_SET_SLOT (scm_class_class, scm_si_direct_supers, scm_list_1 (scm_class_object));
SCM_SET_SLOT (scm_class_class, scm_si_cpl, SCM_LIST3 (scm_class_class, scm_class_object, scm_class_top)); SCM_SET_SLOT (scm_class_class, scm_si_cpl, scm_list_3 (scm_class_class, scm_class_object, scm_class_top));
} }
/******************************************************************************/ /******************************************************************************/
@ -1065,7 +1066,7 @@ get_slot_value (SCM class SCM_UNUSED, SCM obj, SCM slotdef)
if (!SCM_CLOSUREP (code)) if (!SCM_CLOSUREP (code))
return SCM_SUBRF (code) (obj); return SCM_SUBRF (code) (obj);
env = SCM_EXTEND_ENV (SCM_CLOSURE_FORMALS (code), env = SCM_EXTEND_ENV (SCM_CLOSURE_FORMALS (code),
SCM_LIST1 (obj), scm_list_1 (obj),
SCM_ENV (code)); SCM_ENV (code));
/* Evaluate the closure body */ /* Evaluate the closure body */
return scm_eval_body (SCM_CDR (SCM_CODE (code)), env); return scm_eval_body (SCM_CDR (SCM_CODE (code)), env);
@ -1104,7 +1105,7 @@ set_slot_value (SCM class SCM_UNUSED, SCM obj, SCM slotdef, SCM value)
else else
{ {
env = SCM_EXTEND_ENV (SCM_CLOSURE_FORMALS (code), env = SCM_EXTEND_ENV (SCM_CLOSURE_FORMALS (code),
SCM_LIST2 (obj, value), scm_list_2 (obj, value),
SCM_ENV (code)); SCM_ENV (code));
/* Evaluate the closure body */ /* Evaluate the closure body */
scm_eval_body (SCM_CDR (SCM_CODE (code)), env); scm_eval_body (SCM_CDR (SCM_CODE (code)), env);
@ -1521,7 +1522,7 @@ scm_change_object_class (SCM obj, SCM old_class SCM_UNUSED, SCM new_class)
{ {
if (!burnin (obj)) if (!burnin (obj))
scm_internal_dynamic_wind (go_to_hell, purgatory, go_to_heaven, scm_internal_dynamic_wind (go_to_hell, purgatory, go_to_heaven,
(void *) SCM_LIST2 (obj, new_class), (void *) scm_list_2 (obj, new_class),
(void *) obj); (void *) obj);
} }
@ -1552,10 +1553,12 @@ SCM_SYMBOL (scm_sym_args, "args");
SCM SCM
scm_make_method_cache (SCM gf) scm_make_method_cache (SCM gf)
{ {
return SCM_LIST5 (SCM_IM_DISPATCH, scm_sym_args, SCM_MAKINUM (1), return scm_list_5 (SCM_IM_DISPATCH,
scm_c_make_vector (SCM_INITIAL_MCACHE_SIZE, scm_sym_args,
list_of_no_method), SCM_MAKINUM (1),
gf); scm_c_make_vector (SCM_INITIAL_MCACHE_SIZE,
list_of_no_method),
gf);
} }
static void static void
@ -1616,9 +1619,9 @@ SCM_DEFINE (scm_enable_primitive_generic_x, "enable-primitive-generic!", 0, 0, 1
SCM_ASSERT (scm_subr_p (subr) && SCM_SUBR_GENERIC (subr), SCM_ASSERT (scm_subr_p (subr) && SCM_SUBR_GENERIC (subr),
subr, SCM_ARGn, FUNC_NAME); subr, SCM_ARGn, FUNC_NAME);
*SCM_SUBR_GENERIC (subr) *SCM_SUBR_GENERIC (subr)
= scm_make (SCM_LIST3 (scm_class_generic, = scm_make (scm_list_3 (scm_class_generic,
k_name, k_name,
SCM_SNAME (subr))); SCM_SNAME (subr)));
subrs = SCM_CDR (subrs); subrs = SCM_CDR (subrs);
} }
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
@ -1915,7 +1918,7 @@ scm_m_atdispatch (SCM xorig, SCM env)
x = SCM_CDR (x); x = SCM_CDR (x);
gf = SCM_XEVALCAR (x, env); gf = SCM_XEVALCAR (x, env);
SCM_VALIDATE_PUREGENERIC (SCM_ARG4, gf); SCM_VALIDATE_PUREGENERIC (SCM_ARG4, gf);
return SCM_LIST5 (SCM_IM_DISPATCH, args, n, v, gf); return scm_list_5 (SCM_IM_DISPATCH, args, n, v, gf);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -2003,13 +2006,13 @@ SCM_DEFINE (scm_make, "make", 0, 0, 1,
{ {
#ifdef USE_THREADS #ifdef USE_THREADS
z = scm_make_struct (class, SCM_INUM0, z = scm_make_struct (class, SCM_INUM0,
SCM_LIST4 (SCM_EOL, scm_list_4 (SCM_EOL,
SCM_INUM0, SCM_INUM0,
SCM_BOOL_F, SCM_BOOL_F,
scm_make_mutex ())); scm_make_mutex ()));
#else #else
z = scm_make_struct (class, SCM_INUM0, z = scm_make_struct (class, SCM_INUM0,
SCM_LIST3 (SCM_EOL, SCM_INUM0, SCM_BOOL_F)); scm_list_3 (SCM_EOL, SCM_INUM0, SCM_BOOL_F));
#endif #endif
scm_set_procedure_property_x (z, scm_sym_name, scm_set_procedure_property_x (z, scm_sym_name,
scm_get_keyword (k_name, scm_get_keyword (k_name,
@ -2092,7 +2095,7 @@ SCM_DEFINE (scm_find_method, "find-method", 0, 0, 1,
gf = SCM_CAR(l); l = SCM_CDR(l); gf = SCM_CAR(l); l = SCM_CDR(l);
SCM_VALIDATE_GENERIC (1, gf); SCM_VALIDATE_GENERIC (1, gf);
if (SCM_NULLP (SCM_SLOT (gf, scm_si_methods))) if (SCM_NULLP (SCM_SLOT (gf, scm_si_methods)))
SCM_MISC_ERROR ("no methods for generic ~S", SCM_LIST1 (gf)); SCM_MISC_ERROR ("no methods for generic ~S", scm_list_1 (gf));
return scm_compute_applicable_methods (gf, l, len - 1, 1); return scm_compute_applicable_methods (gf, l, len - 1, 1);
} }
@ -2139,7 +2142,7 @@ make_stdcls (SCM *var, char *name, SCM meta, SCM super, SCM slots)
tmp, tmp,
SCM_CONSP (super) SCM_CONSP (super)
? super ? super
: SCM_LIST1 (super), : scm_list_1 (super),
slots)); slots));
DEFVAR(tmp, *var); DEFVAR(tmp, *var);
} }
@ -2151,30 +2154,30 @@ static void
create_standard_classes (void) create_standard_classes (void)
{ {
SCM slots; SCM slots;
SCM method_slots = SCM_LIST4 (scm_str2symbol ("generic-function"), SCM method_slots = scm_list_4 (scm_str2symbol ("generic-function"),
scm_str2symbol ("specializers"), scm_str2symbol ("specializers"),
scm_str2symbol ("procedure"), scm_str2symbol ("procedure"),
scm_str2symbol ("code-table")); scm_str2symbol ("code-table"));
SCM amethod_slots = SCM_LIST1 (SCM_LIST3 (scm_str2symbol ("slot-definition"), SCM amethod_slots = scm_list_1 (scm_list_3 (scm_str2symbol ("slot-definition"),
k_init_keyword, k_init_keyword,
k_slot_definition)); k_slot_definition));
#ifdef USE_THREADS #ifdef USE_THREADS
SCM mutex_slot = SCM_LIST1 (scm_str2symbol ("make-mutex")); SCM mutex_slot = scm_list_1 (scm_str2symbol ("make-mutex"));
#else #else
SCM mutex_slot = SCM_BOOL_F; SCM mutex_slot = SCM_BOOL_F;
#endif #endif
SCM gf_slots = SCM_LIST4 (scm_str2symbol ("methods"), SCM gf_slots = scm_list_4 (scm_str2symbol ("methods"),
SCM_LIST3 (scm_str2symbol ("n-specialized"), scm_list_3 (scm_str2symbol ("n-specialized"),
k_init_value, k_init_value,
SCM_INUM0), SCM_INUM0),
SCM_LIST3 (scm_str2symbol ("used-by"), scm_list_3 (scm_str2symbol ("used-by"),
k_init_value, k_init_value,
SCM_BOOL_F), SCM_BOOL_F),
SCM_LIST3 (scm_str2symbol ("cache-mutex"), scm_list_3 (scm_str2symbol ("cache-mutex"),
k_init_thunk, k_init_thunk,
scm_closure (SCM_LIST2 (SCM_EOL, scm_closure (scm_list_2 (SCM_EOL,
mutex_slot), mutex_slot),
SCM_EOL))); SCM_EOL)));
/* Foreign class slot classes */ /* Foreign class slot classes */
make_stdcls (&scm_class_foreign_slot, "<foreign-slot>", make_stdcls (&scm_class_foreign_slot, "<foreign-slot>",
@ -2187,15 +2190,15 @@ create_standard_classes (void)
scm_class_class, scm_class_foreign_slot, SCM_EOL); scm_class_class, scm_class_foreign_slot, SCM_EOL);
make_stdcls (&scm_class_self, "<self-slot>", make_stdcls (&scm_class_self, "<self-slot>",
scm_class_class, scm_class_class,
SCM_LIST2 (scm_class_foreign_slot, scm_class_read_only), scm_list_2 (scm_class_foreign_slot, scm_class_read_only),
SCM_EOL); SCM_EOL);
make_stdcls (&scm_class_protected_opaque, "<protected-opaque-slot>", make_stdcls (&scm_class_protected_opaque, "<protected-opaque-slot>",
scm_class_class, scm_class_class,
SCM_LIST2 (scm_class_protected, scm_class_opaque), scm_list_2 (scm_class_protected, scm_class_opaque),
SCM_EOL); SCM_EOL);
make_stdcls (&scm_class_protected_read_only, "<protected-read-only-slot>", make_stdcls (&scm_class_protected_read_only, "<protected-read-only-slot>",
scm_class_class, scm_class_class,
SCM_LIST2 (scm_class_protected, scm_class_read_only), scm_list_2 (scm_class_protected, scm_class_read_only),
SCM_EOL); SCM_EOL);
make_stdcls (&scm_class_scm, "<scm-slot>", make_stdcls (&scm_class_scm, "<scm-slot>",
scm_class_class, scm_class_protected, SCM_EOL); scm_class_class, scm_class_protected, SCM_EOL);
@ -2216,12 +2219,12 @@ create_standard_classes (void)
make_stdcls (&scm_class_foreign_class, "<foreign-class>", make_stdcls (&scm_class_foreign_class, "<foreign-class>",
scm_class_class, scm_class_class, scm_class_class, scm_class_class,
SCM_LIST2 (SCM_LIST3 (scm_str2symbol ("constructor"), scm_list_2 (scm_list_3 (scm_str2symbol ("constructor"),
k_class, k_class,
scm_class_opaque), scm_class_opaque),
SCM_LIST3 (scm_str2symbol ("destructor"), scm_list_3 (scm_str2symbol ("destructor"),
k_class, k_class,
scm_class_opaque))); scm_class_opaque)));
make_stdcls (&scm_class_foreign_object, "<foreign-object>", make_stdcls (&scm_class_foreign_object, "<foreign-object>",
scm_class_foreign_class, scm_class_object, SCM_EOL); scm_class_foreign_class, scm_class_object, SCM_EOL);
SCM_SET_CLASS_FLAGS (scm_class_foreign_object, SCM_CLASSF_FOREIGN); SCM_SET_CLASS_FLAGS (scm_class_foreign_object, SCM_CLASSF_FOREIGN);
@ -2253,16 +2256,16 @@ create_standard_classes (void)
SCM_SET_CLASS_FLAGS (scm_class_generic, SCM_CLASSF_PURE_GENERIC); SCM_SET_CLASS_FLAGS (scm_class_generic, SCM_CLASSF_PURE_GENERIC);
make_stdcls (&scm_class_generic_with_setter, "<generic-with-setter>", make_stdcls (&scm_class_generic_with_setter, "<generic-with-setter>",
scm_class_entity_class, scm_class_entity_class,
SCM_LIST2 (scm_class_generic, scm_class_entity_with_setter), scm_list_2 (scm_class_generic, scm_class_entity_with_setter),
SCM_EOL); SCM_EOL);
#if 0 #if 0
/* Patch cpl since compute_cpl doesn't support multiple inheritance. */ /* Patch cpl since compute_cpl doesn't support multiple inheritance. */
SCM_SET_SLOT (scm_class_generic_with_setter, scm_si_cpl, SCM_SET_SLOT (scm_class_generic_with_setter, scm_si_cpl,
scm_append (SCM_LIST3 (SCM_LIST2 (scm_class_generic_with_setter, scm_append (scm_list_3 (scm_list_2 (scm_class_generic_with_setter,
scm_class_generic), scm_class_generic),
SCM_SLOT (scm_class_entity_with_setter, SCM_SLOT (scm_class_entity_with_setter,
scm_si_cpl), scm_si_cpl),
SCM_EOL))); SCM_EOL)));
#endif #endif
SCM_SET_CLASS_FLAGS (scm_class_generic_with_setter, SCM_CLASSF_PURE_GENERIC); SCM_SET_CLASS_FLAGS (scm_class_generic_with_setter, SCM_CLASSF_PURE_GENERIC);
@ -2309,7 +2312,7 @@ create_standard_classes (void)
scm_class_class, scm_class_port, SCM_EOL); scm_class_class, scm_class_port, SCM_EOL);
make_stdcls (&scm_class_input_output_port, "<input-output-port>", make_stdcls (&scm_class_input_output_port, "<input-output-port>",
scm_class_class, scm_class_class,
SCM_LIST2 (scm_class_input_port, scm_class_output_port), scm_list_2 (scm_class_input_port, scm_class_output_port),
SCM_EOL); SCM_EOL);
} }
@ -2349,7 +2352,7 @@ scm_make_extended_class (char *type_name)
{ {
return make_class_from_template ("<%s>", return make_class_from_template ("<%s>",
type_name, type_name,
SCM_LIST1 (scm_class_top)); scm_list_1 (scm_class_top));
} }
static void static void
@ -2376,21 +2379,20 @@ scm_make_port_classes (long ptobnum, char *type_name)
{ {
SCM c, class = make_class_from_template ("<%s-port>", SCM c, class = make_class_from_template ("<%s-port>",
type_name, type_name,
SCM_LIST1 (scm_class_port)); scm_list_1 (scm_class_port));
scm_port_class[SCM_IN_PCLASS_INDEX + ptobnum] scm_port_class[SCM_IN_PCLASS_INDEX + ptobnum]
= make_class_from_template ("<%s-input-port>", = make_class_from_template ("<%s-input-port>",
type_name, type_name,
SCM_LIST2 (class, scm_class_input_port)); scm_list_2 (class, scm_class_input_port));
scm_port_class[SCM_OUT_PCLASS_INDEX + ptobnum] scm_port_class[SCM_OUT_PCLASS_INDEX + ptobnum]
= make_class_from_template ("<%s-output-port>", = make_class_from_template ("<%s-output-port>",
type_name, type_name,
SCM_LIST2 (class, scm_class_output_port)); scm_list_2 (class, scm_class_output_port));
scm_port_class[SCM_INOUT_PCLASS_INDEX + ptobnum] scm_port_class[SCM_INOUT_PCLASS_INDEX + ptobnum]
= c = c
= make_class_from_template ("<%s-input-output-port>", = make_class_from_template ("<%s-input-output-port>",
type_name, type_name,
SCM_LIST2 (class, scm_list_2 (class, scm_class_input_output_port));
scm_class_input_output_port));
/* Patch cpl (since this tree is too complex for the C level compute-cpl) */ /* Patch cpl (since this tree is too complex for the C level compute-cpl) */
SCM_SET_SLOT (c, scm_si_cpl, SCM_SET_SLOT (c, scm_si_cpl,
scm_cons2 (c, class, SCM_SLOT (scm_class_input_output_port, scm_si_cpl))); scm_cons2 (c, class, SCM_SLOT (scm_class_input_output_port, scm_si_cpl)));
@ -2447,7 +2449,7 @@ scm_make_foreign_object (SCM class, SCM initargs)
void * (*constructor) (SCM) void * (*constructor) (SCM)
= (void * (*) (SCM)) SCM_SLOT (class, scm_si_constructor); = (void * (*) (SCM)) SCM_SLOT (class, scm_si_constructor);
if (constructor == 0) if (constructor == 0)
SCM_MISC_ERROR ("Can't make instances of class ~S", SCM_LIST1 (class)); SCM_MISC_ERROR ("Can't make instances of class ~S", scm_list_1 (class));
return scm_wrap_object (class, constructor (initargs)); return scm_wrap_object (class, constructor (initargs));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -2469,7 +2471,7 @@ scm_make_class (SCM meta, char *s_name, SCM supers, size_t size,
SCM name, class; SCM name, class;
name = scm_str2symbol (s_name); name = scm_str2symbol (s_name);
if (SCM_IMP (supers)) if (SCM_IMP (supers))
supers = SCM_LIST1 (scm_class_foreign_object); supers = scm_list_1 (scm_class_foreign_object);
class = scm_basic_basic_make_class (meta, name, supers, SCM_EOL); class = scm_basic_basic_make_class (meta, name, supers, SCM_EOL);
scm_sys_inherit_magic_x (class, supers); scm_sys_inherit_magic_x (class, supers);
@ -2513,40 +2515,42 @@ scm_add_slot (SCM class, char *slot_name, SCM slot_class,
SCM get = scm_c_make_subr ("goops:get", scm_tc7_subr_1, getter); SCM get = scm_c_make_subr ("goops:get", scm_tc7_subr_1, getter);
SCM set = scm_c_make_subr ("goops:set", scm_tc7_subr_2, SCM set = scm_c_make_subr ("goops:set", scm_tc7_subr_2,
setter ? setter : default_setter); setter ? setter : default_setter);
SCM getm = scm_closure (SCM_LIST2 (SCM_LIST1 (sym_o), SCM getm = scm_closure (scm_list_2 (scm_list_1 (sym_o),
SCM_LIST2 (get, sym_o)), scm_list_2 (get, sym_o)),
SCM_EOL); SCM_EOL);
SCM setm = scm_closure (SCM_LIST2 (SCM_LIST2 (sym_o, sym_x), SCM setm = scm_closure (scm_list_2 (scm_list_2 (sym_o, sym_x),
SCM_LIST3 (set, sym_o, sym_x)), scm_list_3 (set, sym_o, sym_x)),
SCM_EOL); SCM_EOL);
{ {
SCM name = scm_str2symbol (slot_name); SCM name = scm_str2symbol (slot_name);
SCM aname = scm_str2symbol (accessor_name); SCM aname = scm_str2symbol (accessor_name);
SCM gf = scm_ensure_accessor (aname); SCM gf = scm_ensure_accessor (aname);
SCM slot = SCM_LIST5 (name, SCM slot = scm_list_5 (name,
k_class, slot_class, k_class,
setter ? k_accessor : k_getter, slot_class,
gf); setter ? k_accessor : k_getter,
SCM gns = SCM_LIST4 (name, SCM_BOOL_F, get, set); gf);
SCM gns = scm_list_4 (name, SCM_BOOL_F, get, set);
scm_add_method (gf, scm_make (SCM_LIST5 (scm_class_accessor, scm_add_method (gf, scm_make (scm_list_5 (scm_class_accessor,
k_specializers, k_specializers,
SCM_LIST1 (class), scm_list_1 (class),
k_procedure, getm))); k_procedure,
getm)));
scm_add_method (scm_setter (gf), scm_add_method (scm_setter (gf),
scm_make (SCM_LIST5 (scm_class_accessor, scm_make (scm_list_5 (scm_class_accessor,
k_specializers, k_specializers,
SCM_LIST2 (class, scm_list_2 (class, scm_class_top),
scm_class_top), k_procedure,
k_procedure, setm))); setm)));
DEFVAR (aname, gf); DEFVAR (aname, gf);
SCM_SET_SLOT (class, scm_si_slots, SCM_SET_SLOT (class, scm_si_slots,
scm_append_x (SCM_LIST2 (SCM_SLOT (class, scm_si_slots), scm_append_x (scm_list_2 (SCM_SLOT (class, scm_si_slots),
SCM_LIST1 (slot)))); scm_list_1 (slot))));
SCM_SET_SLOT (class, scm_si_getters_n_setters, SCM_SET_SLOT (class, scm_si_getters_n_setters,
scm_append_x (SCM_LIST2 (SCM_SLOT (class, scm_si_getters_n_setters), scm_append_x (scm_list_2 (SCM_SLOT (class, scm_si_getters_n_setters),
SCM_LIST1 (gns)))); scm_list_1 (gns))));
} }
} }
{ {
@ -2589,10 +2593,9 @@ scm_ensure_accessor (SCM name)
SCM gf = scm_call_2 (SCM_TOP_LEVEL_LOOKUP_CLOSURE, name, SCM_BOOL_F); SCM gf = scm_call_2 (SCM_TOP_LEVEL_LOOKUP_CLOSURE, name, SCM_BOOL_F);
if (!SCM_IS_A_P (gf, scm_class_generic_with_setter)) if (!SCM_IS_A_P (gf, scm_class_generic_with_setter))
{ {
gf = scm_make (SCM_LIST3 (scm_class_generic, k_name, name)); gf = scm_make (scm_list_3 (scm_class_generic, k_name, name));
gf = scm_make (SCM_LIST5 (scm_class_generic_with_setter, gf = scm_make (scm_list_5 (scm_class_generic_with_setter,
k_name, name, k_name, name, k_setter, gf));
k_setter, gf));
} }
return gf; return gf;
} }
@ -2602,7 +2605,7 @@ SCM_SYMBOL (sym_internal_add_method_x, "internal-add-method!");
void void
scm_add_method (SCM gf, SCM m) scm_add_method (SCM gf, SCM m)
{ {
scm_eval (SCM_LIST3 (sym_internal_add_method_x, gf, m), scm_module_goops); scm_eval (scm_list_3 (sym_internal_add_method_x, gf, m), scm_module_goops);
} }
#ifdef GUILE_DEBUG #ifdef GUILE_DEBUG
@ -2661,7 +2664,7 @@ scm_init_goops_builtins (void)
#include "libguile/goops.x" #include "libguile/goops.x"
#endif #endif
list_of_no_method = scm_permanent_object (SCM_LIST1 (sym_no_method)); list_of_no_method = scm_permanent_object (scm_list_1 (sym_no_method));
hell = scm_must_malloc (hell_size, "hell"); hell = scm_must_malloc (hell_size, "hell");
#ifdef USE_THREADS #ifdef USE_THREADS
@ -2677,9 +2680,9 @@ scm_init_goops_builtins (void)
{ {
SCM name = scm_str2symbol ("no-applicable-method"); SCM name = scm_str2symbol ("no-applicable-method");
scm_no_applicable_method scm_no_applicable_method
= scm_permanent_object (scm_make (SCM_LIST3 (scm_class_generic, = scm_permanent_object (scm_make (scm_list_3 (scm_class_generic,
k_name, k_name,
name))); name)));
DEFVAR (name, scm_no_applicable_method); DEFVAR (name, scm_no_applicable_method);
} }

View file

@ -220,7 +220,7 @@ scm_gsubr_apply (SCM args)
if (n > SCM_GSUBR_MAX) if (n > SCM_GSUBR_MAX)
scm_misc_error (FUNC_NAME, scm_misc_error (FUNC_NAME,
"Function ~S has illegal arity ~S.", "Function ~S has illegal arity ~S.",
SCM_LIST2 (self, SCM_MAKINUM (n))); scm_list_2 (self, SCM_MAKINUM (n)));
#endif #endif
args = SCM_CDR (args); args = SCM_CDR (args);
for (i = 0; i < SCM_GSUBR_REQ (typ); i++) { for (i = 0; i < SCM_GSUBR_REQ (typ); i++) {

View file

@ -230,7 +230,7 @@ guardian_apply (SCM guardian, SCM obj, SCM throw_p)
{ {
if (DESTROYED_P (GUARDIAN (guardian))) if (DESTROYED_P (GUARDIAN (guardian)))
scm_misc_error ("guard", "attempted use of destroyed guardian: ~A", scm_misc_error ("guard", "attempted use of destroyed guardian: ~A",
SCM_LIST1 (guardian)); scm_list_1 (guardian));
if (!SCM_UNBNDP (obj)) if (!SCM_UNBNDP (obj))
return scm_guard (guardian, obj, return scm_guard (guardian, obj,
@ -266,7 +266,7 @@ scm_guard (SCM guardian, SCM obj, int throw_p)
if (throw_p) if (throw_p)
scm_misc_error ("guard", scm_misc_error ("guard",
"object is already greedily guarded: ~A", "object is already greedily guarded: ~A",
SCM_LIST1 (obj)); scm_list_1 (obj));
else else
return SCM_BOOL_F; return SCM_BOOL_F;
} }
@ -401,7 +401,8 @@ SCM_DEFINE (scm_destroy_guardian_x, "destroy-guardian!", 1, 0, 0,
if (DESTROYED_P (g)) if (DESTROYED_P (g))
{ {
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
SCM_MISC_ERROR ("guardian is already destroyed: ~A", SCM_LIST1 (guardian)); SCM_MISC_ERROR ("guardian is already destroyed: ~A",
scm_list_1 (guardian));
} }
if (GREEDY_P (g)) if (GREEDY_P (g))

View file

@ -252,7 +252,7 @@ SCM_DEFINE (scm_add_hook_x, "add-hook!", 2, 1, 0,
rest = scm_delq_x (proc, SCM_HOOK_PROCEDURES (hook)); rest = scm_delq_x (proc, SCM_HOOK_PROCEDURES (hook));
SCM_SET_HOOK_PROCEDURES (hook, SCM_SET_HOOK_PROCEDURES (hook,
(!SCM_UNBNDP (append_p) && !SCM_FALSEP (append_p) (!SCM_UNBNDP (append_p) && !SCM_FALSEP (append_p)
? scm_append_x (SCM_LIST2 (rest, SCM_LIST1 (proc))) ? scm_append_x (scm_list_2 (rest, scm_list_1 (proc)))
: scm_cons (proc, rest))); : scm_cons (proc, rest)));
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
@ -294,7 +294,7 @@ SCM_DEFINE (scm_run_hook, "run-hook", 1, 0, 1,
SCM_VALIDATE_HOOK (1,hook); SCM_VALIDATE_HOOK (1,hook);
if (scm_ilength (args) != SCM_HOOK_ARITY (hook)) if (scm_ilength (args) != SCM_HOOK_ARITY (hook))
SCM_MISC_ERROR ("Hook ~S requires ~A arguments", SCM_MISC_ERROR ("Hook ~S requires ~A arguments",
SCM_LIST2 (hook,SCM_MAKINUM (SCM_HOOK_ARITY (hook)))); scm_list_2 (hook, SCM_MAKINUM (SCM_HOOK_ARITY (hook))));
scm_c_run_hook (hook, args); scm_c_run_hook (hook, args);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }

View file

@ -60,8 +60,54 @@
/* creating lists */ /* 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
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; va_list foo;
SCM answer = SCM_EOL; SCM answer = SCM_EOL;
@ -286,7 +332,7 @@ SCM_DEFINE (scm_last_pair, "last-pair", 1, 0, 0,
tortoise = SCM_CDR(tortoise); tortoise = SCM_CDR(tortoise);
} }
while (! SCM_EQ_P (hare, 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 #undef FUNC_NAME
@ -315,7 +361,7 @@ SCM_DEFINE (scm_reverse, "reverse", 1, 0, 0,
tortoise = SCM_CDR (tortoise); tortoise = SCM_CDR (tortoise);
} }
while (! SCM_EQ_P (hare, 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 #undef FUNC_NAME

View file

@ -48,26 +48,13 @@
#define SCM_LIST0 SCM_EOL extern SCM scm_list_1 (SCM e1);
#define SCM_LIST1(e0) scm_cons ((e0), SCM_EOL) extern SCM scm_list_2 (SCM e1, SCM e2);
#define SCM_LIST2(e0, e1) scm_cons2 ((e0), (e1), SCM_EOL) extern SCM scm_list_3 (SCM e1, SCM e2, SCM e3);
#define SCM_LIST3(e0, e1, e2) scm_cons ((e0), SCM_LIST2 ((e1), (e2))) extern SCM scm_list_4 (SCM e1, SCM e2, SCM e3, SCM e4);
#define SCM_LIST4(e0, e1, e2, e3)\ extern SCM scm_list_5 (SCM e1, SCM e2, SCM e3, SCM e4, SCM e5);
scm_cons2 ((e0), (e1), SCM_LIST2 ((e2), (e3))) extern SCM scm_list_n (SCM elt, ...);
#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 lst, SCM k); extern SCM scm_list_head (SCM lst, SCM k);
extern SCM scm_listify (SCM elt, ...);
extern SCM scm_list (SCM objs); extern SCM scm_list (SCM objs);
extern SCM scm_cons_star (SCM arg, SCM objs); extern SCM scm_cons_star (SCM arg, SCM objs);
extern SCM scm_null_p (SCM x); extern SCM scm_null_p (SCM x);
@ -103,6 +90,26 @@ extern void scm_init_list (void);
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
#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)))
#define scm_listify scm_list_n
extern SCM scm_sloppy_memq (SCM x, SCM lst); extern SCM scm_sloppy_memq (SCM x, SCM lst);
extern SCM scm_sloppy_memv (SCM x, SCM lst); extern SCM scm_sloppy_memv (SCM x, SCM lst);
extern SCM scm_sloppy_member (SCM x, SCM lst); extern SCM scm_sloppy_member (SCM x, SCM lst);

View file

@ -243,9 +243,9 @@ scm_init_load_path ()
SCM path = SCM_EOL; SCM path = SCM_EOL;
#ifdef SCM_LIBRARY_DIR #ifdef SCM_LIBRARY_DIR
path = SCM_LIST3 (scm_makfrom0str (SCM_SITE_DIR), path = scm_list_3 (scm_makfrom0str (SCM_SITE_DIR),
scm_makfrom0str (SCM_LIBRARY_DIR), scm_makfrom0str (SCM_LIBRARY_DIR),
scm_makfrom0str (SCM_PKGDATA_DIR)); scm_makfrom0str (SCM_PKGDATA_DIR));
#endif /* SCM_LIBRARY_DIR */ #endif /* SCM_LIBRARY_DIR */
path = scm_internal_parse_path (getenv ("GUILE_LOAD_PATH"), path); path = scm_internal_parse_path (getenv ("GUILE_LOAD_PATH"), path);
@ -453,7 +453,7 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 1, 0, 0,
SCM_MISC_ERROR ((absolute SCM_MISC_ERROR ((absolute
? "Unable to load file ~S" ? "Unable to load file ~S"
: "Unable to find file ~S in load path"), : "Unable to find file ~S in load path"),
SCM_LIST1 (filename)); scm_list_1 (filename));
} }
return scm_primitive_load (full_filename); return scm_primitive_load (full_filename);
@ -507,12 +507,12 @@ init_build_info ()
void void
scm_init_load () scm_init_load ()
{ {
scm_listofnullstr = scm_permanent_object (SCM_LIST1 (scm_nullstr)); scm_listofnullstr = scm_permanent_object (scm_list_1 (scm_nullstr));
scm_loc_load_path = SCM_VARIABLE_LOC (scm_c_define ("%load-path", SCM_EOL)); scm_loc_load_path = SCM_VARIABLE_LOC (scm_c_define ("%load-path", SCM_EOL));
scm_loc_load_extensions scm_loc_load_extensions
= SCM_VARIABLE_LOC (scm_c_define ("%load-extensions", = SCM_VARIABLE_LOC (scm_c_define ("%load-extensions",
SCM_LIST2 (scm_makfrom0str (".scm"), scm_list_2 (scm_makfrom0str (".scm"),
scm_nullstr))); scm_nullstr)));
scm_loc_load_hook = SCM_VARIABLE_LOC (scm_c_define ("%load-hook", SCM_BOOL_F)); scm_loc_load_hook = SCM_VARIABLE_LOC (scm_c_define ("%load-hook", SCM_BOOL_F));
init_build_info (); init_build_info ();

View file

@ -170,7 +170,7 @@ scm_c_define_module (const char *name,
void (*init)(void *), void *data) void (*init)(void *), void *data)
{ {
SCM module = scm_call_1 (SCM_VARIABLE_REF (process_define_module_var), SCM module = scm_call_1 (SCM_VARIABLE_REF (process_define_module_var),
SCM_LIST1 (convert_module_name (name))); scm_list_1 (convert_module_name (name)));
if (init) if (init)
scm_c_call_with_current_module (module, (SCM (*)(void*))init, data); scm_c_call_with_current_module (module, (SCM (*)(void*))init, data);
return module; return module;
@ -180,7 +180,7 @@ void
scm_c_use_module (const char *name) scm_c_use_module (const char *name)
{ {
scm_call_1 (SCM_VARIABLE_REF (process_use_modules_var), scm_call_1 (SCM_VARIABLE_REF (process_use_modules_var),
SCM_LIST1 (convert_module_name (name))); scm_list_1 (convert_module_name (name)));
} }
static SCM module_export_x_var; static SCM module_export_x_var;
@ -440,7 +440,7 @@ scm_sym2var (SCM sym, SCM proc, SCM definep)
} }
if (var != SCM_BOOL_F && !SCM_VARIABLEP (var)) if (var != SCM_BOOL_F && !SCM_VARIABLEP (var))
SCM_MISC_ERROR ("~S is not bound to a variable", SCM_LIST1 (sym)); SCM_MISC_ERROR ("~S is not bound to a variable", scm_list_1 (sym));
return var; return var;
} }
@ -461,7 +461,7 @@ scm_module_lookup (SCM module, SCM sym)
var = scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F); var = scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
if (SCM_FALSEP (var)) if (SCM_FALSEP (var))
SCM_MISC_ERROR ("unbound variable: ~S", SCM_LIST1 (sym)); SCM_MISC_ERROR ("unbound variable: ~S", scm_list_1 (sym));
return var; return var;
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -478,7 +478,7 @@ scm_lookup (SCM sym)
SCM var = SCM var =
scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_F); scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_F);
if (SCM_FALSEP (var)) if (SCM_FALSEP (var))
scm_misc_error ("scm_lookup", "unbound variable: ~S", SCM_LIST1 (sym)); scm_misc_error ("scm_lookup", "unbound variable: ~S", scm_list_1 (sym));
return var; return var;
} }
@ -639,7 +639,7 @@ scm_post_boot_init_modules ()
#if SCM_DEBUG_DEPRECATED == 0 #if SCM_DEBUG_DEPRECATED == 0
module_prefix = PERM (SCM_LIST2 (scm_sym_app, scm_sym_modules)); module_prefix = PERM (scm_list_2 (scm_sym_app, scm_sym_modules));
make_modules_in_var = PERM (scm_c_lookup ("make-modules-in")); make_modules_in_var = PERM (scm_c_lookup ("make-modules-in"));
root_module_lookup_closure = root_module_lookup_closure =
PERM (scm_module_lookup_closure (SCM_VARIABLE_REF (the_root_module_var))); PERM (scm_module_lookup_closure (SCM_VARIABLE_REF (the_root_module_var)));
@ -669,7 +669,7 @@ scm_module_full_name (SCM name)
if (SCM_EQ_P (SCM_CAR (name), scm_sym_app)) if (SCM_EQ_P (SCM_CAR (name), scm_sym_app))
return name; return name;
else else
return scm_append (SCM_LIST2 (module_prefix, name)); return scm_append (scm_list_2 (module_prefix, name));
} }
SCM SCM

View file

@ -260,7 +260,7 @@ SCM_DEFINE (scm_getnet, "getnet", 0, 1, 0,
entry = getnetbyaddr (netnum, AF_INET); entry = getnetbyaddr (netnum, AF_INET);
} }
if (!entry) if (!entry)
SCM_SYSERROR_MSG ("no such network ~A", SCM_LIST1 (net), errno); SCM_SYSERROR_MSG ("no such network ~A", scm_list_1 (net), errno);
ve[0] = scm_mem2string (entry->n_name, strlen (entry->n_name)); ve[0] = scm_mem2string (entry->n_name, strlen (entry->n_name));
ve[1] = scm_makfromstrs (-1, entry->n_aliases); ve[1] = scm_makfromstrs (-1, entry->n_aliases);
ve[2] = SCM_MAKINUM (entry->n_addrtype + 0L); ve[2] = SCM_MAKINUM (entry->n_addrtype + 0L);
@ -310,7 +310,7 @@ SCM_DEFINE (scm_getproto, "getproto", 0, 1, 0,
entry = getprotobynumber (protonum); entry = getprotobynumber (protonum);
} }
if (!entry) if (!entry)
SCM_SYSERROR_MSG ("no such protocol ~A", SCM_LIST1 (protocol), errno); SCM_SYSERROR_MSG ("no such protocol ~A", scm_list_1 (protocol), errno);
ve[0] = scm_mem2string (entry->p_name, strlen (entry->p_name)); ve[0] = scm_mem2string (entry->p_name, strlen (entry->p_name));
ve[1] = scm_makfromstrs (-1, entry->p_aliases); ve[1] = scm_makfromstrs (-1, entry->p_aliases);
ve[2] = SCM_MAKINUM (entry->p_proto + 0L); ve[2] = SCM_MAKINUM (entry->p_proto + 0L);
@ -374,7 +374,7 @@ SCM_DEFINE (scm_getserv, "getserv", 0, 2, 0,
entry = getservbyport (htons (SCM_INUM (name)), SCM_STRING_CHARS (protocol)); entry = getservbyport (htons (SCM_INUM (name)), SCM_STRING_CHARS (protocol));
} }
if (!entry) if (!entry)
SCM_SYSERROR_MSG("no such service ~A", SCM_LIST1 (name), errno); SCM_SYSERROR_MSG("no such service ~A", scm_list_1 (name), errno);
return scm_return_entry (entry); return scm_return_entry (entry);
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -344,19 +344,19 @@ scm_call_generic_0 (SCM gf)
SCM SCM
scm_call_generic_1 (SCM gf, SCM a1) scm_call_generic_1 (SCM gf, SCM a1)
{ {
return scm_apply_generic (gf, SCM_LIST1 (a1)); return scm_apply_generic (gf, scm_list_1 (a1));
} }
SCM SCM
scm_call_generic_2 (SCM gf, SCM a1, SCM a2) scm_call_generic_2 (SCM gf, SCM a1, SCM a2)
{ {
return scm_apply_generic (gf, SCM_LIST2 (a1, a2)); return scm_apply_generic (gf, scm_list_2 (a1, a2));
} }
SCM SCM
scm_call_generic_3 (SCM gf, SCM a1, SCM a2, SCM a3) scm_call_generic_3 (SCM gf, SCM a1, SCM a2, SCM a3)
{ {
return scm_apply_generic (gf, SCM_LIST3 (a1, a2, a3)); return scm_apply_generic (gf, scm_list_3 (a1, a2, a3));
} }
SCM_DEFINE (scm_entity_p, "entity?", 1, 0, 0, SCM_DEFINE (scm_entity_p, "entity?", 1, 0, 0,
@ -460,7 +460,7 @@ scm_i_make_class_object (SCM meta,
SCM layout = scm_make_struct_layout (layout_string); SCM layout = scm_make_struct_layout (layout_string);
c = scm_make_struct (meta, c = scm_make_struct (meta,
SCM_INUM0, SCM_INUM0,
SCM_LIST4 (layout, SCM_BOOL_F, SCM_EOL, SCM_EOL)); scm_list_4 (layout, SCM_BOOL_F, SCM_EOL, SCM_EOL));
SCM_SET_CLASS_FLAGS (c, flags); SCM_SET_CLASS_FLAGS (c, flags);
return c; return c;
} }
@ -493,7 +493,7 @@ SCM_DEFINE (scm_make_subclass_object, "make-subclass-object", 2, 0, 0,
/* Convert symbol->string */ /* Convert symbol->string */
pl = scm_mem2string (SCM_SYMBOL_CHARS (pl), SCM_SYMBOL_LENGTH (pl)); pl = scm_mem2string (SCM_SYMBOL_CHARS (pl), SCM_SYMBOL_LENGTH (pl));
return scm_i_make_class_object (SCM_STRUCT_VTABLE (class), return scm_i_make_class_object (SCM_STRUCT_VTABLE (class),
scm_string_append (SCM_LIST2 (pl, layout)), scm_string_append (scm_list_2 (pl, layout)),
SCM_CLASS_FLAGS (class)); SCM_CLASS_FLAGS (class));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -503,16 +503,16 @@ scm_init_objects ()
{ {
SCM ms = scm_makfrom0str (SCM_METACLASS_STANDARD_LAYOUT); SCM ms = scm_makfrom0str (SCM_METACLASS_STANDARD_LAYOUT);
SCM mt = scm_make_vtable_vtable (ms, SCM_INUM0, SCM mt = scm_make_vtable_vtable (ms, SCM_INUM0,
SCM_LIST3 (SCM_BOOL_F, SCM_EOL, SCM_EOL)); scm_list_3 (SCM_BOOL_F, SCM_EOL, SCM_EOL));
SCM os = scm_makfrom0str (SCM_METACLASS_OPERATOR_LAYOUT); SCM os = scm_makfrom0str (SCM_METACLASS_OPERATOR_LAYOUT);
SCM ot = scm_make_vtable_vtable (os, SCM_INUM0, SCM ot = scm_make_vtable_vtable (os, SCM_INUM0,
SCM_LIST3 (SCM_BOOL_F, SCM_EOL, SCM_EOL)); scm_list_3 (SCM_BOOL_F, SCM_EOL, SCM_EOL));
SCM es = scm_makfrom0str (SCM_ENTITY_LAYOUT); SCM es = scm_makfrom0str (SCM_ENTITY_LAYOUT);
SCM el = scm_make_struct_layout (es); SCM el = scm_make_struct_layout (es);
SCM et = scm_make_struct (mt, SCM_INUM0, SCM et = scm_make_struct (mt, SCM_INUM0,
SCM_LIST4 (el, SCM_BOOL_F, SCM_EOL, SCM_EOL)); scm_list_4 (el, SCM_BOOL_F, SCM_EOL, SCM_EOL));
scm_c_define ("<class>", mt); scm_c_define ("<class>", mt);
scm_metaclass_standard = mt; scm_metaclass_standard = mt;

View file

@ -190,7 +190,7 @@ scm_options (SCM arg, scm_t_option options[], int n, const char *s)
#ifndef SCM_RECKLESS #ifndef SCM_RECKLESS
scm_must_free ((char *) flags); scm_must_free ((char *) flags);
scm_misc_error (s, "Unknown mode flag: ~S", scm_misc_error (s, "Unknown mode flag: ~S",
SCM_LIST1 (SCM_CAR (new_mode))); scm_list_1 (SCM_CAR (new_mode)));
#endif #endif
cont: cont:
new_mode = SCM_CDR (new_mode); new_mode = SCM_CDR (new_mode);

View file

@ -68,7 +68,7 @@ void scm_error_pair_access (SCM non_pair)
{ {
running = 1; running = 1;
scm_simple_format (scm_current_error_port (), scm_simple_format (scm_current_error_port (),
message, SCM_LIST1 (non_pair)); message, scm_list_1 (non_pair));
abort (); abort ();
} }
} }

View file

@ -483,7 +483,7 @@ scm_remove_from_port_table (SCM port)
long i = p->entry; long i = p->entry;
if (i >= scm_t_portable_size) if (i >= scm_t_portable_size)
SCM_MISC_ERROR ("Port not in table: ~S", SCM_LIST1 (port)); SCM_MISC_ERROR ("Port not in table: ~S", scm_list_1 (port));
if (p->putback_buf) if (p->putback_buf)
scm_must_free (p->putback_buf); scm_must_free (p->putback_buf);
scm_must_free (p); scm_must_free (p);

View file

@ -973,16 +973,15 @@ SCM_DEFINE (scm_simple_format, "simple-format", 2, 0, 1,
start = p + 1; start = p + 1;
continue; continue;
default: default:
scm_misc_error (s_scm_simple_format, SCM_MISC_ERROR ("FORMAT: Unsupported format option ~~~A - use (ice-9 format) instead",
"FORMAT: Unsupported format option ~~~A - use (ice-9 format) instead", scm_list_1 (SCM_MAKE_CHAR (*p)));
SCM_LIST1 (SCM_MAKE_CHAR (*p)));
} }
if (!SCM_CONSP (args)) if (!SCM_CONSP (args))
scm_misc_error (s_scm_simple_format, "FORMAT: Missing argument for ~~~A", SCM_MISC_ERROR ("FORMAT: Missing argument for ~~~A",
SCM_LIST1 (SCM_MAKE_CHAR (*p))); scm_list_1 (SCM_MAKE_CHAR (*p)));
scm_lfwrite (start, p - start - 1, destination); scm_lfwrite (start, p - start - 1, destination);
scm_prin1 (SCM_CAR (args), destination, writingp); scm_prin1 (SCM_CAR (args), destination, writingp);
@ -992,8 +991,8 @@ SCM_DEFINE (scm_simple_format, "simple-format", 2, 0, 1,
scm_lfwrite (start, p - start, destination); scm_lfwrite (start, p - start, destination);
if (args != SCM_EOL) if (args != SCM_EOL)
scm_misc_error (s_scm_simple_format, SCM_MISC_ERROR ("FORMAT: ~A superfluous arguments",
"FORMAT: ~A superfluous arguments", SCM_LIST1 (scm_length (args))); scm_list_1 (scm_length (args)));
if (fReturnString) if (fReturnString)
answer = scm_strport_to_string (destination); answer = scm_strport_to_string (destination);
@ -1110,7 +1109,7 @@ scm_init_print ()
scm_init_opts (scm_print_options, scm_print_opts, SCM_N_PRINT_OPTIONS); scm_init_opts (scm_print_options, scm_print_opts, SCM_N_PRINT_OPTIONS);
vtable = scm_make_vtable_vtable (scm_nullstr, SCM_INUM0, SCM_EOL); vtable = scm_make_vtable_vtable (scm_nullstr, SCM_INUM0, SCM_EOL);
layout = scm_make_struct_layout (scm_makfrom0str (SCM_PRINT_STATE_LAYOUT)); layout = scm_make_struct_layout (scm_makfrom0str (SCM_PRINT_STATE_LAYOUT));
type = scm_make_struct (vtable, SCM_INUM0, SCM_LIST1 (layout)); type = scm_make_struct (vtable, SCM_INUM0, scm_list_1 (layout));
scm_set_struct_vtable_name_x (type, scm_str2symbol ("print-state")); scm_set_struct_vtable_name_x (type, scm_str2symbol ("print-state"));
print_state_pool = scm_permanent_object (scm_cons (type, SCM_EOL)); print_state_pool = scm_permanent_object (scm_cons (type, SCM_EOL));

View file

@ -155,9 +155,7 @@ scm_i_procedure_arity (SCM proc)
default: default:
return SCM_BOOL_F; return SCM_BOOL_F;
} }
return SCM_LIST3 (SCM_MAKINUM (a), return scm_list_3 (SCM_MAKINUM (a), SCM_MAKINUM (o), SCM_BOOL(r));
SCM_MAKINUM (o),
SCM_BOOL(r));
} }
static SCM static SCM
@ -167,7 +165,7 @@ scm_stand_in_scm_proc(SCM proc)
answer = scm_assoc (proc, scm_stand_in_procs); answer = scm_assoc (proc, scm_stand_in_procs);
if (SCM_FALSEP (answer)) if (SCM_FALSEP (answer))
{ {
answer = scm_closure (SCM_LIST2 (SCM_EOL, SCM_BOOL_F), SCM_EOL); answer = scm_closure (scm_list_2 (SCM_EOL, SCM_BOOL_F), SCM_EOL);
scm_stand_in_procs = scm_acons (proc, answer, scm_stand_in_procs); scm_stand_in_procs = scm_acons (proc, answer, scm_stand_in_procs);
} }
else else

View file

@ -153,7 +153,7 @@ scm_flush_ws (SCM port, const char *eoferr)
if (!SCM_FALSEP (SCM_FILENAME (port))) if (!SCM_FALSEP (SCM_FILENAME (port)))
scm_misc_error (eoferr, scm_misc_error (eoferr,
"end of file in ~A", "end of file in ~A",
SCM_LIST1 (SCM_FILENAME (port))); scm_list_1 (SCM_FILENAME (port)));
else else
scm_misc_error (eoferr, "end of file", SCM_EOL); scm_misc_error (eoferr, "end of file", SCM_EOL);
} }
@ -457,7 +457,7 @@ scm_lreadr (SCM *tok_buf,SCM port,SCM *copy)
} }
unkshrp: unkshrp:
scm_misc_error (s_scm_read, "Unknown # object: ~S", scm_misc_error (s_scm_read, "Unknown # object: ~S",
SCM_LIST1 (SCM_MAKE_CHAR (c))); scm_list_1 (SCM_MAKE_CHAR (c)));
} }
case '"': case '"':

View file

@ -565,11 +565,8 @@ scm_compile_shell_switches (int argc, char **argv)
if (scm_ilength (srfis) <= 0) if (scm_ilength (srfis) <= 0)
scm_shell_usage (1, "invalid SRFI specification"); scm_shell_usage (1, "invalid SRFI specification");
srfis = scm_reverse_x (srfis, SCM_UNDEFINED); srfis = scm_reverse_x (srfis, SCM_UNDEFINED);
tail = scm_cons (scm_listify tail = scm_cons (scm_list_2 (sym_use_srfis,
(sym_use_srfis, scm_list_2 (scm_sym_quote, srfis)),
scm_listify (scm_sym_quote,
srfis, SCM_UNDEFINED),
SCM_UNDEFINED),
tail); tail);
} }

View file

@ -200,7 +200,7 @@ scm_smob_apply_1_030 (SCM smob, SCM a1)
static SCM static SCM
scm_smob_apply_1_001 (SCM smob, SCM a1) scm_smob_apply_1_001 (SCM smob, SCM a1)
{ {
return SCM_SMOB_APPLY1 (smob, SCM_LIST1 (a1)); return SCM_SMOB_APPLY1 (smob, scm_list_1 (a1));
} }
static SCM static SCM
@ -230,13 +230,13 @@ scm_smob_apply_2_030 (SCM smob, SCM a1, SCM a2)
static SCM static SCM
scm_smob_apply_2_001 (SCM smob, SCM a1, SCM a2) scm_smob_apply_2_001 (SCM smob, SCM a1, SCM a2)
{ {
return SCM_SMOB_APPLY1 (smob, SCM_LIST2 (a1, a2)); return SCM_SMOB_APPLY1 (smob, scm_list_2 (a1, a2));
} }
static SCM static SCM
scm_smob_apply_2_011 (SCM smob, SCM a1, SCM a2) scm_smob_apply_2_011 (SCM smob, SCM a1, SCM a2)
{ {
return SCM_SMOB_APPLY2 (smob, a1, SCM_LIST1 (a2)); return SCM_SMOB_APPLY2 (smob, a1, scm_list_1 (a2));
} }
static SCM static SCM

View file

@ -970,7 +970,7 @@ scm_addr_vector (const struct sockaddr *address, const char *proc)
#endif #endif
default: default:
scm_misc_error (proc, "Unrecognised address family: ~A", scm_misc_error (proc, "Unrecognised address family: ~A",
SCM_LIST1 (SCM_MAKINUM (fam))); scm_list_1 (SCM_MAKINUM (fam)));
} }
return result; return result;
} }

View file

@ -50,7 +50,9 @@
#include "libguile/chars.h" #include "libguile/chars.h"
#include "libguile/root.h" #include "libguile/root.h"
#include "libguile/strings.h" #include "libguile/strings.h"
#include "libguile/deprecation.h"
#include "libguile/validate.h" #include "libguile/validate.h"
/* {Strings} /* {Strings}

View file

@ -90,7 +90,7 @@ SCM_DEFINE (scm_make_struct_layout, "make-struct-layout", 1, 0, 0,
len = SCM_STRING_LENGTH (fields); len = SCM_STRING_LENGTH (fields);
if (len % 2 == 1) if (len % 2 == 1)
SCM_MISC_ERROR ("odd length field specification: ~S", SCM_MISC_ERROR ("odd length field specification: ~S",
SCM_LIST1 (fields)); scm_list_1 (fields));
field_desc = SCM_STRING_CHARS (fields); field_desc = SCM_STRING_CHARS (fields);
@ -108,7 +108,7 @@ SCM_DEFINE (scm_make_struct_layout, "make-struct-layout", 1, 0, 0,
break; break;
default: default:
SCM_MISC_ERROR ("unrecognized field type: ~S", SCM_MISC_ERROR ("unrecognized field type: ~S",
SCM_LIST1 (SCM_MAKE_CHAR (field_desc[x]))); scm_list_1 (SCM_MAKE_CHAR (field_desc[x])));
} }
switch (field_desc[x + 1]) switch (field_desc[x + 1])
@ -131,14 +131,14 @@ SCM_DEFINE (scm_make_struct_layout, "make-struct-layout", 1, 0, 0,
break; break;
default: default:
SCM_MISC_ERROR ("unrecognized ref specification: ~S", SCM_MISC_ERROR ("unrecognized ref specification: ~S",
SCM_LIST1 (SCM_MAKE_CHAR (field_desc[x + 1]))); scm_list_1 (SCM_MAKE_CHAR (field_desc[x + 1])));
} }
#if 0 #if 0
if (field_desc[x] == 'd') if (field_desc[x] == 'd')
{ {
if (field_desc[x + 2] != '-') if (field_desc[x + 2] != '-')
SCM_MISC_ERROR ("missing dash field at position ~A", SCM_MISC_ERROR ("missing dash field at position ~A",
SCM_LIST1 (SCM_MAKINUM (x / 2))); scm_list_1 (SCM_MAKINUM (x / 2)));
x += 2; x += 2;
goto recheck_ref; goto recheck_ref;
} }
@ -539,7 +539,8 @@ SCM_DEFINE (scm_make_vtable_vtable, "make-vtable-vtable", 2, 0, 1,
SCM_VALIDATE_INUM (2, tail_array_size); SCM_VALIDATE_INUM (2, tail_array_size);
SCM_VALIDATE_REST_ARGUMENT (init); SCM_VALIDATE_REST_ARGUMENT (init);
fields = scm_string_append (SCM_LIST2 (required_vtable_fields, user_fields)); fields = scm_string_append (scm_list_2 (required_vtable_fields,
user_fields));
layout = scm_make_struct_layout (fields); layout = scm_make_struct_layout (fields);
basic_size = SCM_SYMBOL_LENGTH (layout) / 2; basic_size = SCM_SYMBOL_LENGTH (layout) / 2;
tail_elts = SCM_INUM (tail_array_size); tail_elts = SCM_INUM (tail_array_size);
@ -601,13 +602,13 @@ SCM_DEFINE (scm_struct_ref, "struct-ref", 2, 0, 0,
if ((ref == 'R') || (ref == 'W')) if ((ref == 'R') || (ref == 'W'))
field_type = 'u'; field_type = 'u';
else else
SCM_MISC_ERROR ("ref denied for field ~A", SCM_LIST1 (pos)); SCM_MISC_ERROR ("ref denied for field ~A", scm_list_1 (pos));
} }
} }
else if (fields_desc[SCM_SYMBOL_LENGTH (layout) - 1] != 'O') else if (fields_desc[SCM_SYMBOL_LENGTH (layout) - 1] != 'O')
field_type = fields_desc[SCM_SYMBOL_LENGTH (layout) - 2]; field_type = fields_desc[SCM_SYMBOL_LENGTH (layout) - 2];
else else
SCM_MISC_ERROR ("ref denied for field ~A", SCM_LIST1 (pos)); SCM_MISC_ERROR ("ref denied for field ~A", scm_list_1 (pos));
switch (field_type) switch (field_type)
{ {
@ -633,7 +634,7 @@ SCM_DEFINE (scm_struct_ref, "struct-ref", 2, 0, 0,
default: default:
SCM_MISC_ERROR ("unrecognized field type: ~S", SCM_MISC_ERROR ("unrecognized field type: ~S",
SCM_LIST1 (SCM_MAKE_CHAR (field_type))); scm_list_1 (SCM_MAKE_CHAR (field_type)));
} }
return answer; return answer;
@ -673,12 +674,12 @@ SCM_DEFINE (scm_struct_set_x, "struct-set!", 3, 0, 0,
field_type = fields_desc[p * 2]; field_type = fields_desc[p * 2];
set_x = fields_desc [p * 2 + 1]; set_x = fields_desc [p * 2 + 1];
if (set_x != 'w') if (set_x != 'w')
SCM_MISC_ERROR ("set! denied for field ~A", SCM_LIST1 (pos)); SCM_MISC_ERROR ("set! denied for field ~A", scm_list_1 (pos));
} }
else if (fields_desc[SCM_SYMBOL_LENGTH (layout) - 1] == 'W') else if (fields_desc[SCM_SYMBOL_LENGTH (layout) - 1] == 'W')
field_type = fields_desc[SCM_SYMBOL_LENGTH (layout) - 2]; field_type = fields_desc[SCM_SYMBOL_LENGTH (layout) - 2];
else else
SCM_MISC_ERROR ("set! denied for field ~A", SCM_LIST1 (pos)); SCM_MISC_ERROR ("set! denied for field ~A", scm_list_1 (pos));
switch (field_type) switch (field_type)
{ {
@ -705,7 +706,7 @@ SCM_DEFINE (scm_struct_set_x, "struct-set!", 3, 0, 0,
default: default:
SCM_MISC_ERROR ("unrecognized field type: ~S", SCM_MISC_ERROR ("unrecognized field type: ~S",
SCM_LIST1 (SCM_MAKE_CHAR (field_type))); scm_list_1 (SCM_MAKE_CHAR (field_type)));
} }
return val; return val;

View file

@ -112,7 +112,7 @@ scm_sym2ovcell (SCM sym, SCM obarray)
answer = scm_sym2ovcell_soft (sym, obarray); answer = scm_sym2ovcell_soft (sym, obarray);
if (!SCM_FALSEP (answer)) if (!SCM_FALSEP (answer))
return answer; return answer;
SCM_MISC_ERROR ("uninterned symbol: ~S", SCM_LIST1 (sym)); SCM_MISC_ERROR ("uninterned symbol: ~S", scm_list_1 (sym));
return SCM_UNSPECIFIED; /* not reached */ return SCM_UNSPECIFIED; /* not reached */
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -2222,7 +2222,8 @@ SCM_DEFINE (scm_list_to_uniform_array, "list->uniform-array", 3, 0, 0,
if (l2ra (lst, ra, SCM_ARRAY_BASE (ra), 0)) if (l2ra (lst, ra, SCM_ARRAY_BASE (ra), 0))
return ra; return ra;
else else
badlst:SCM_MISC_ERROR ("Bad scm_array contents list: ~S", SCM_LIST1 (lst)); badlst:SCM_MISC_ERROR ("Bad scm_array contents list: ~S",
scm_list_1 (lst));
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -130,7 +130,7 @@ SCM_DEFINE (scm_variable_ref, "variable-ref", 1, 0, 0,
SCM_VALIDATE_VARIABLE (1, var); SCM_VALIDATE_VARIABLE (1, var);
val = SCM_VARIABLE_REF (var); val = SCM_VARIABLE_REF (var);
if (val == SCM_UNDEFINED) if (val == SCM_UNDEFINED)
SCM_MISC_ERROR ("variable is unbound: ~S", SCM_LIST1 (var)); SCM_MISC_ERROR ("variable is unbound: ~S", scm_list_1 (var));
return val; return val;
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -244,10 +244,10 @@ scm_vector_set_x (SCM v, SCM k, SCM obj)
#define FUNC_NAME s_vector_set_x #define FUNC_NAME s_vector_set_x
{ {
SCM_GASSERTn (SCM_VECTORP (v), SCM_GASSERTn (SCM_VECTORP (v),
g_vector_set_x, SCM_LIST3 (v, k, obj), g_vector_set_x, scm_list_3 (v, k, obj),
SCM_ARG1, s_vector_set_x); SCM_ARG1, s_vector_set_x);
SCM_GASSERTn (SCM_INUMP (k), SCM_GASSERTn (SCM_INUMP (k),
g_vector_set_x, SCM_LIST3 (v, k, obj), g_vector_set_x, scm_list_3 (v, k, obj),
SCM_ARG2, s_vector_set_x); SCM_ARG2, s_vector_set_x);
SCM_ASSERT_RANGE (2, k, SCM_INUM (k) < SCM_VECTOR_LENGTH (v) && SCM_INUM (k) >= 0); SCM_ASSERT_RANGE (2, k, SCM_INUM (k) < SCM_VECTOR_LENGTH (v) && SCM_INUM (k) >= 0);
SCM_VELTS(v)[(long) SCM_INUM(k)] = obj; SCM_VELTS(v)[(long) SCM_INUM(k)] = obj;