[uim-commit] r2707 - in branches/r5rs: sigscheme uim
yamaken at freedesktop.org
yamaken at freedesktop.org
Thu Dec 29 07:30:20 PST 2005
Author: yamaken
Date: 2005-12-29 07:30:15 -0800 (Thu, 29 Dec 2005)
New Revision: 2707
Modified:
branches/r5rs/sigscheme/eval.c
branches/r5rs/sigscheme/io.c
branches/r5rs/sigscheme/operations-siod.c
branches/r5rs/sigscheme/operations-srfi1.c
branches/r5rs/sigscheme/operations-srfi34.c
branches/r5rs/sigscheme/operations-srfi6.c
branches/r5rs/sigscheme/operations-srfi60.c
branches/r5rs/sigscheme/operations.c
branches/r5rs/sigscheme/read.c
branches/r5rs/sigscheme/sigscheme.c
branches/r5rs/sigscheme/storage-continuation.c
branches/r5rs/sigscheme/storage-symbol.c
branches/r5rs/sigscheme/storage.c
branches/r5rs/uim/uim-compat-scm.c
branches/r5rs/uim/uim-scm.c
Log:
* sigscheme/storage.c
* sigscheme/storage-continuation.c
* sigscheme/storage-symbol.c
* sigscheme/io.c
* sigscheme/read.c
* sigscheme/eval.c
* sigscheme/operations.c
* sigscheme/operations-srfi1.c
* sigscheme/operations-srfi6.c
* sigscheme/operations-srfi34.c
* sigscheme/operations-srfi60.c
* sigscheme/operations-siod.c
* sigscheme/sigscheme.c
- Replace all scm_make_*() with MAKE_*()
ruby -i -pe 'gsub!(/^(.+)\bscm_make_(int|cons|symbol|char|string|string_copying|immutable_string|immutable_string_copying|func|closure|vector|port|continuation)\b/) { |m| $1 + if ($2 == "cons") then "CONS" else "MAKE_#{$2.upcase}" end}' sigscheme/*.c
* uim/uim-scm.c
* uim/uim-compat-scm.c
- Replace all scm_make_cons() with SCM_CONS()
ruby -i -pe 'gsub!(/^(.+)\bscm_make_(int|cons|symbol|char|string|string_copying|immutable_string|immutable_string_copying|func|closure|vector|port|continuation)\b/) { |m| "#{$1}SCM_" + if ($2 == "cons") then "CONS" else "MAKE_#{$2.upcase}" end}' uim/*.c
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/eval.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -820,7 +820,7 @@
change_index = t->u.vec.index;
record_change:
- SCM_QUEUE_ADD(t->u.vec.q, CONS(scm_make_int(change_index), obj));
+ SCM_QUEUE_ADD(t->u.vec.q, CONS(MAKE_INT(change_index), obj));
break;
case TR_MSG_EXTRACT:
@@ -859,7 +859,7 @@
else
change_index = SCM_INT_VALUE(CAAR(diff));
}
- return scm_make_vector(copy_buf, src_len + t->u.vec.growth);
+ return MAKE_VECTOR(copy_buf, src_len + t->u.vec.growth);
}
break;
}
@@ -891,7 +891,7 @@
if (!CONSP(body))
ERR_OBJ("at least one expression required", body);
- return scm_make_closure(CONS(formals, body), env);
+ return MAKE_CLOSURE(CONS(formals, body), env);
}
/*===========================================================================
@@ -1222,7 +1222,7 @@
/* named let */
if (SYMBOLP(named_let_sym)) {
- proc = scm_make_closure(CONS(vars, body), env);
+ proc = MAKE_CLOSURE(CONS(vars, body), env);
define_internal(named_let_sym, proc, env);
}
@@ -1455,7 +1455,7 @@
DECLARE_FUNCTION("delay", syntax_fixed_1);
/* (lambda () exp) */
- return scm_make_closure(SCM_LIST_2(SCM_NULL, expr), env);
+ return MAKE_CLOSURE(SCM_LIST_2(SCM_NULL, expr), env);
}
/*===========================================================================
@@ -1647,9 +1647,7 @@
ASSERT_SYMBOLP(procname);
- define_internal(procname,
- scm_make_closure(CONS(formals, body), env),
- env);
+ define_internal(procname, MAKE_CLOSURE(CONS(formals, body), env), env);
} else {
ERR_OBJ("syntax error", var);
}
Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/io.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -129,7 +129,7 @@
/* GC safe */
bport = ScmFilePort_new_shared(file, aux_info);
- return scm_make_port(scm_make_char_port(bport), flag);
+ return MAKE_PORT(scm_make_char_port(bport), flag);
}
int
@@ -367,7 +367,7 @@
if (!bport)
ERR_OBJ("cannot open file ", filepath);
- return scm_make_port(scm_make_char_port(bport), SCM_PORTFLAG_INPUT);
+ return MAKE_PORT(scm_make_char_port(bport), SCM_PORTFLAG_INPUT);
}
ScmObj
@@ -382,7 +382,7 @@
if (!bport)
ERR_OBJ("cannot open file ", filepath);
- return scm_make_port(scm_make_char_port(bport), SCM_PORTFLAG_OUTPUT);
+ return MAKE_PORT(scm_make_char_port(bport), SCM_PORTFLAG_OUTPUT);
}
ScmObj
@@ -453,7 +453,7 @@
if (ch == EOF)
return SCM_EOF;
- return scm_make_char(ch);
+ return MAKE_CHAR(ch);
}
ScmObj
@@ -469,7 +469,7 @@
if (ch == EOF)
return SCM_EOF;
- return scm_make_char(ch);
+ return MAKE_CHAR(ch);
}
ScmObj
Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/operations-siod.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -114,8 +114,8 @@
scm_gc_protect_with_init(&saved_error_port, SCM_FALSE);
scm_nullport_init();
- null_port = scm_make_port(scm_make_char_port(ScmNullPort_new()),
- SCM_PORTFLAG_INPUT | SCM_PORTFLAG_OUTPUT);
+ null_port = MAKE_PORT(scm_make_char_port(ScmNullPort_new()),
+ SCM_PORTFLAG_INPUT | SCM_PORTFLAG_OUTPUT);
scm_set_verbose_level(2);
}
@@ -208,7 +208,7 @@
scm_set_verbose_level(SCM_INT_VALUE(CAR(args)));
}
- return scm_make_int(sscm_verbose_level);
+ return MAKE_INT(sscm_verbose_level);
}
ScmObj
Modified: branches/r5rs/sigscheme/operations-srfi1.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi1.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/operations-srfi1.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -149,7 +149,7 @@
/* then create list */
for (i = n; 0 < i; i--) {
- num = scm_make_int(i - 1);
+ num = MAKE_INT(i - 1);
if (!NULLP(proc))
num = scm_call(proc, LIST_1(num));
@@ -235,7 +235,7 @@
start = NULLP(scm_start) ? 0 : SCM_INT_VALUE(scm_start);
step = NULLP(scm_step) ? 1 : SCM_INT_VALUE(scm_step);
for (i = count - 1; 0 <= i; i--) {
- head = CONS(scm_make_int(start + i*step), head);
+ head = CONS(MAKE_INT(start + i * step), head);
}
return head;
@@ -511,7 +511,7 @@
len -= SCM_INT_VALUE(scm_elem);
- return scm_p_srfi1_drop(lst, scm_make_int(len));
+ return scm_p_srfi1_drop(lst, MAKE_INT(len));
}
ScmObj
@@ -528,7 +528,7 @@
len -= SCM_INT_VALUE(scm_elem);
- return scm_p_srfi1_take(lst, scm_make_int(len));
+ return scm_p_srfi1_take(lst, MAKE_INT(len));
}
ScmObj
Modified: branches/r5rs/sigscheme/operations-srfi34.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi34.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/operations-srfi34.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -150,18 +150,16 @@
syn_apply = scm_symbol_value(scm_intern("apply"), SCM_INTERACTION_ENV);
proc_values = scm_symbol_value(scm_intern("values"), SCM_INTERACTION_ENV);
/* FIXME: make registration type-safe */
- syn_set_cur_handlers = scm_make_func(SCM_SYNTAX_FIXED | 1,
- &set_cur_handlers);
- proc_with_exception_handlers = scm_make_func(SCM_PROCEDURE_FIXED | 2,
- &with_exception_handlers);
- syn_guard_internal = scm_make_func(SCM_SYNTAX_FIXED | 1,
- &guard_internal);
- syn_guard_handler = scm_make_func(SCM_SYNTAX_FIXED_TAIL_REC | 1,
- &guard_handler);
- syn_guard_handler_body = scm_make_func(SCM_SYNTAX_FIXED | 1,
- &guard_handler_body);
- syn_guard_body = scm_make_func(SCM_SYNTAX_FIXED_TAIL_REC | 0,
- &guard_body);
+ syn_set_cur_handlers = MAKE_FUNC(SCM_SYNTAX_FIXED | 1, &set_cur_handlers);
+ proc_with_exception_handlers = MAKE_FUNC(SCM_PROCEDURE_FIXED | 2,
+ &with_exception_handlers);
+ syn_guard_internal = MAKE_FUNC(SCM_SYNTAX_FIXED | 1, &guard_internal);
+ syn_guard_handler = MAKE_FUNC(SCM_SYNTAX_FIXED_TAIL_REC | 1,
+ &guard_handler);
+ syn_guard_handler_body = MAKE_FUNC(SCM_SYNTAX_FIXED | 1,
+ &guard_handler_body);
+ syn_guard_body = MAKE_FUNC(SCM_SYNTAX_FIXED_TAIL_REC | 0,
+ &guard_body);
#if USE_WITH_SIGSCHEME_FATAL_ERROR
proc_fallback_handler
Modified: branches/r5rs/sigscheme/operations-srfi6.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi6.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/operations-srfi6.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -93,7 +93,7 @@
bport = ScmInputStrPort_new_const(SCM_STRING_STR(str), istrport_finalize);
hold_str = (ScmObj *)ScmInputStrPort_ref_opaque(bport);
scm_gc_protect_with_init(hold_str, str);
- return scm_make_port(scm_make_char_port(bport), SCM_PORTFLAG_INPUT);
+ return MAKE_PORT(scm_make_char_port(bport), SCM_PORTFLAG_INPUT);
}
ScmObj
@@ -103,7 +103,7 @@
DECLARE_FUNCTION("open-output-string", procedure_fixed_0);
bport = ScmOutputStrPort_new(NULL);
- return scm_make_port(scm_make_char_port(bport), SCM_PORTFLAG_OUTPUT);
+ return MAKE_PORT(scm_make_char_port(bport), SCM_PORTFLAG_OUTPUT);
}
ScmObj
Modified: branches/r5rs/sigscheme/operations-srfi60.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi60.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/operations-srfi60.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -66,7 +66,7 @@
default: \
ERR(opstr ": (internal error) unrecognized state specifier: %d", *state); \
} \
- return scm_make_int(result); \
+ return MAKE_INT(result); \
} while (/* CONSTCOND */ 0)
/*=======================================
@@ -122,7 +122,7 @@
ASSERT_INTP(n);
- return scm_make_int(~SCM_INT_VALUE(n));
+ return MAKE_INT(~SCM_INT_VALUE(n));
}
ScmObj
@@ -138,7 +138,7 @@
c_mask = SCM_INT_VALUE(mask);
result = (c_mask & SCM_INT_VALUE(n0)) | (~c_mask & SCM_INT_VALUE(n1));
- return scm_make_int(result);
+ return MAKE_INT(result);
}
ScmObj
Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/operations.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -230,7 +230,7 @@
ERR("(internal error) unrecognized state specifier: %d", *state);
}
- return scm_make_int(result);
+ return MAKE_INT(result);
}
ScmObj
@@ -254,7 +254,7 @@
ERR("(internal error) unrecognized state specifier: %d", *state);
}
- return scm_make_int(result);
+ return MAKE_INT(result);
}
ScmObj
@@ -278,7 +278,7 @@
default:
ERR("(internal error) unrecognized state specifier: %d", *state);
}
- return scm_make_int(result);
+ return MAKE_INT(result);
}
ScmObj
@@ -303,7 +303,7 @@
default:
ERR("(internal error) unrecognized state specifier: %d", *state);
}
- return scm_make_int(result);
+ return MAKE_INT(result);
}
ScmObj
@@ -442,7 +442,7 @@
num = SCM_INT_VALUE(scm_num);
- return (num < 0) ? scm_make_int(-num) : scm_num;
+ return (num < 0) ? MAKE_INT(-num) : scm_num;
}
ScmObj
@@ -461,7 +461,7 @@
if (n2 == 0)
ERR("division by zero");
- return scm_make_int((int)(n1 / n2));
+ return MAKE_INT((int)(n1 / n2));
}
ScmObj
@@ -488,7 +488,7 @@
rem += n2;
}
- return scm_make_int(rem);
+ return MAKE_INT(rem);
}
ScmObj
@@ -507,7 +507,7 @@
if (n2 == 0)
ERR("division by zero");
- return scm_make_int(n1 % n2);
+ return MAKE_INT(n1 % n2);
}
/*==============================================================================
@@ -592,7 +592,7 @@
if (*first_nondigit)
ERR("ill-formatted number: %s", SCM_STRING_STR(str));
- return scm_make_int(num);
+ return MAKE_INT(num);
}
/*===================================
@@ -801,7 +801,7 @@
if (len < 0)
ERR_OBJ("list required but got", obj);
- return scm_make_int(len);
+ return MAKE_INT(len);
}
ScmObj
@@ -1137,7 +1137,7 @@
ASSERT_CHARP(obj);
- return scm_make_int(SCM_CHAR_VALUE(obj));
+ return MAKE_INT(SCM_CHAR_VALUE(obj));
}
ScmObj
@@ -1152,7 +1152,7 @@
val = SCM_INT_VALUE(obj);
if (!SCM_CHARCODEC_INT2STR(scm_current_char_codec, buf, val, SCM_MB_STATELESS))
ERR_OBJ("invalid char value", obj);
- return scm_make_char(val);
+ return MAKE_CHAR(val);
}
ScmObj
@@ -1242,7 +1242,7 @@
{
DECLARE_FUNCTION("string-length", procedure_fixed_1);
ASSERT_STRINGP(str);
- return scm_make_int(scm_mb_bare_c_strlen(SCM_STRING_STR(str)));
+ return MAKE_INT(scm_mb_bare_c_strlen(SCM_STRING_STR(str)));
}
ScmObj
@@ -1271,7 +1271,7 @@
if (ch == EOF)
ERR("string-ref: invalid char sequence");
- return scm_make_char(ch);
+ return MAKE_CHAR(ch);
}
ScmObj
@@ -1458,7 +1458,7 @@
if (ch == EOF)
ERR("string->list: invalid char sequence");
- SCM_QUEUE_ADD(q, scm_make_char(ch));
+ SCM_QUEUE_ADD(q, MAKE_CHAR(ch));
SCM_MBS_SKIP_CHAR(mbs, mbc);
}
@@ -1571,7 +1571,7 @@
for (i = 0; i < len; i++)
vec[i] = filler;
- return scm_make_vector(vec, len);
+ return MAKE_VECTOR(vec, len);
}
ScmObj
@@ -1587,7 +1587,7 @@
for (i = 0; i < len; i++)
vec[i] = POP_ARG(args);
- return scm_make_vector(vec, len);
+ return MAKE_VECTOR(vec, len);
}
ScmObj
@@ -1596,7 +1596,7 @@
DECLARE_FUNCTION("vector-length", procedure_fixed_1);
ASSERT_VECTORP(vec);
- return scm_make_int(SCM_VECTOR_LEN(vec));
+ return MAKE_INT(SCM_VECTOR_LEN(vec));
}
ScmObj
@@ -1678,7 +1678,7 @@
lst = CDR(lst);
}
- return scm_make_vector(v, c_len);
+ return MAKE_VECTOR(v, c_len);
}
ScmObj
Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/read.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -490,7 +490,7 @@
c = scm_port_get_char(port);
next = scm_port_peek_char(port);
if (strchr(DELIMITER_CHARS, next) || next == EOF)
- return scm_make_char(c);
+ return MAKE_CHAR(c);
#if SCM_USE_SRFI75
else if (!isascii(c))
ERR("invalid character literal");
@@ -506,12 +506,12 @@
#if SCM_USE_SRFI75
unicode = parse_unicode_sequence(buf, len + 1);
if (0 <= unicode)
- return scm_make_char(unicode);
+ return MAKE_CHAR(unicode);
#endif
/* named chars */
for (info = scm_special_char_table; info->esc_seq; info++) {
if (strcmp(buf, info->lex_rep) == 0)
- return scm_make_char(info->code);
+ return MAKE_CHAR(info->code);
}
ERR("invalid character literal: #\\%s", buf);
}
@@ -695,7 +695,7 @@
if (*first_nondigit)
goto err;
- return scm_make_int(number);
+ return MAKE_INT(number);
err:
ERR("ill-formatted number: #%c%s", prefix, buf);
Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/sigscheme.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -285,7 +285,7 @@
ScmBytePort *bport;
bport = ScmInputStrPort_new_const(exp, NULL);
- str_port = scm_make_port(scm_make_char_port(bport), SCM_PORTFLAG_INPUT);
+ str_port = MAKE_PORT(scm_make_char_port(bport), SCM_PORTFLAG_INPUT);
ret = scm_read(str_port);
ret = EVAL(ret, SCM_INTERACTION_ENV);
@@ -378,7 +378,7 @@
scm_register_func(const char *name, ScmFuncType c_func, enum ScmFuncTypeCode type)
{
ScmObj sym = scm_intern(name);
- ScmObj func = scm_make_func(type, c_func);
+ ScmObj func = MAKE_FUNC(type, c_func);
/* TODO: reject bad TYPE */
SCM_SYMBOL_SET_VCELL(sym, func);
Modified: branches/r5rs/sigscheme/storage-continuation.c
===================================================================
--- branches/r5rs/sigscheme/storage-continuation.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/storage-continuation.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -274,7 +274,7 @@
#if SCM_DEBUG
cont_frame.trace_stack = trace_stack;
#endif
- cont = scm_make_continuation();
+ cont = MAKE_CONTINUATION();
CONTINUATION_SET_FRAME(cont, &cont_frame);
#if SCM_NESTED_CONTINUATION_ONLY
continuation_stack_push(cont);
Modified: branches/r5rs/sigscheme/storage-symbol.c
===================================================================
--- branches/r5rs/sigscheme/storage-symbol.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/storage-symbol.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -82,7 +82,7 @@
}
/* if not found, allocate new symbol object and prepend it into the list */
- sym = scm_make_symbol(strdup(name), SCM_UNBOUND);
+ sym = MAKE_SYMBOL(strdup(name), SCM_UNBOUND);
scm_symbol_hash[hash] = CONS(sym, lst);
return sym;
Modified: branches/r5rs/sigscheme/storage.c
===================================================================
--- branches/r5rs/sigscheme/storage.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/sigscheme/storage.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -97,7 +97,7 @@
scm_init_gc(heap_size, heap_alloc_threshold, n_heaps_max, n_heaps_init);
#if 0 && (SCM_COMPAT_SIOD_BUGS && !SCM_OBJ_COMPACT)
- scm_gc_protect_with_init(&scm_true, scm_make_int(1));
+ scm_gc_protect_with_init(&scm_true, MAKE_INT(1));
#endif
#if SCM_USE_VALUECONS
Modified: branches/r5rs/uim/uim-compat-scm.c
===================================================================
--- branches/r5rs/uim/uim-compat-scm.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/uim/uim-compat-scm.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -188,7 +188,7 @@
for (i = n_strs - 1; 0 <= i; i--) {
c_str = strs[i];
str = (uim_lisp)SCM_MAKE_STRING_COPYING(c_str);
- lst = (uim_lisp)scm_make_cons((ScmObj)str, (ScmObj)lst);
+ lst = (uim_lisp)SCM_CONS((ScmObj)str, (ScmObj)lst);
}
return (uim_lisp)lst;
Modified: branches/r5rs/uim/uim-scm.c
===================================================================
--- branches/r5rs/uim/uim-scm.c 2005-12-29 07:37:05 UTC (rev 2706)
+++ branches/r5rs/uim/uim-scm.c 2005-12-29 15:30:15 UTC (rev 2707)
@@ -430,7 +430,7 @@
uim_lisp
uim_scm_apply(uim_lisp proc, uim_lisp args)
{
- return (uim_lisp)scm_call((ScmObj)proc, scm_make_cons((ScmObj)args, SCM_NULL));
+ return (uim_lisp)scm_call((ScmObj)proc, SCM_CONS((ScmObj)args, SCM_NULL));
}
#endif /* UIM_SCM_EXTENDED_API */
@@ -498,7 +498,7 @@
uim_lisp
uim_scm_cons(uim_lisp car, uim_lisp cdr)
{
- return (uim_lisp)scm_make_cons((ScmObj)car, (ScmObj)cdr);
+ return (uim_lisp)SCM_CONS((ScmObj)car, (ScmObj)cdr);
}
uim_lisp
More information about the uim-commit
mailing list