[uim-commit] r2742 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Jan 2 22:09:53 PST 2006
Author: yamaken
Date: 2006-01-02 22:09:50 -0800 (Mon, 02 Jan 2006)
New Revision: 2742
Modified:
branches/r5rs/sigscheme/error.c
branches/r5rs/sigscheme/eval.c
branches/r5rs/sigscheme/io.c
branches/r5rs/sigscheme/operations-nonstd.c
branches/r5rs/sigscheme/operations-siod.c
branches/r5rs/sigscheme/operations-srfi1.c
branches/r5rs/sigscheme/operations-srfi23.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/print.c
branches/r5rs/sigscheme/read.c
branches/r5rs/sigscheme/sigscheme.c
branches/r5rs/sigscheme/sigschemeinternal.h
Log:
* sigscheme/sigschemeinternal.h
- (ASSERT_TYPE, ENSURE_TYPE): Rename ASSERT_TYPE() to ENSURE_TYPE()
- (ASSERT_INTP, ASSERT_CONSP, ASSERT_SYMBOLP, ASSERT_CHARP,
ASSERT_STRINGP, ASSERT_FUNCP, ASSERT_CLOSUREP, ASSERT_VECTORP,
ASSERT_PORTP, ASSERT_CONTINUATIONP, ASSERT_PROCEDUREP,
ASSERT_ENVP, ASSERT_ERROBJP, ASSERT_LISTP, ASSERT_MUTABLEP):
Rename to ENSURE_*()
- (ENSURE_INT, ENSURE_CONS, ENSURE_SYMBOL, ENSURE_CHAR,
ENSURE_STRING, ENSURE_FUNC, ENSURE_CLOSURE, ENSURE_VECTOR,
ENSURE_PORT, ENSURE_CONTINUATION, ENSURE_PROCEDURE, ENSURE_ENV,
ENSURE_ERROBJ, ENSURE_LIST, ENSURE_MUTABLE): Renamed from
ASSERT_*P()
* sigscheme/read.c
* sigscheme/error.c
* sigscheme/operations-srfi34.c
* sigscheme/operations-srfi6.c
* sigscheme/operations-srfi60.c
* sigscheme/io.c
* sigscheme/sigschemeinternal.h
* sigscheme/operations.c
* sigscheme/operations-nonstd.c
* sigscheme/operations-srfi1.c
* sigscheme/sigscheme.c
* sigscheme/operations-siod.c
* sigscheme/eval.c
* sigscheme/operations-srfi23.c
* sigscheme/print.c
- Follow the renamings by following script
perl -i -pe 's/\bASSERT_([A-Z]+)P\b/ENSURE_\1/g' sigscheme/*.[ch]
Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/error.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -175,10 +175,10 @@
{
DECLARE_INTERNAL_FUNCTION("scm_make_error_obj");
- ASSERT_LISTP(objs);
+ ENSURE_LIST(objs);
#if 0
/* should be string, but not forced. displayable is sufficient. */
- ASSERT_STRINGP(reason);
+ ENSURE_STRING(reason);
#endif
return LIST_4(err_obj_tag, reason, objs, scm_trace_stack());
@@ -189,7 +189,7 @@
{
DECLARE_INTERNAL_FUNCTION("scm_raise_error");
- ASSERT_ERROBJP(err_obj);
+ ENSURE_ERROBJ(err_obj);
#if SCM_USE_SRFI34
if (srfi34_providedp()) {
@@ -233,7 +233,7 @@
msg = "looped fatal error";
} else {
fatal_error_looped = TRUE;
- ASSERT_ERROBJP(err_obj);
+ ENSURE_ERROBJ(err_obj);
scm_p_inspect_error(err_obj);
msg = NULL;
}
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/eval.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -194,8 +194,8 @@
DECLARE_INTERNAL_FUNCTION("lookup_frame");
#if SCM_STRICT_ARGCHECK
- ASSERT_SYMBOLP(var);
- ASSERT_CONSP(frame);
+ ENSURE_SYMBOL(var);
+ ENSURE_CONS(frame);
#endif
for (vars = CAR(frame), vals = REF_CDR(frame);
@@ -210,7 +210,7 @@
*
* It can be removed once the typed environment object is implemented.
*/
- ASSERT_CONSP(DEREF(vals));
+ ENSURE_CONS(DEREF(vals));
#endif
if (EQ(var, CAR(vars)))
return REF_CAR(DEREF(vals));
@@ -473,7 +473,7 @@
{
DECLARE_FUNCTION("eval", procedure_fixed_2);
- ASSERT_ENVP(env);
+ ENSURE_ENV(env);
return scm_eval(obj, env);
}
@@ -537,7 +537,7 @@
last = arg;
}
- ASSERT_LISTP(last);
+ ENSURE_LIST(last);
/* The last argument inhibits argument re-evaluation. */
return call(proc, args, eval_state, SUPPRESS_EVAL_ARGS);
@@ -1382,7 +1382,7 @@
ERR("invalid bindings");
var = MUST_POP_ARG(binding);
- ASSERT_SYMBOLP(var);
+ ENSURE_SYMBOL(var);
val = MUST_POP_ARG(binding);
vars = CONS(var, vars);
@@ -1645,7 +1645,7 @@
ERR_OBJ("proper list is required as <body> but got", body);
#endif
- ASSERT_SYMBOLP(procname);
+ ENSURE_SYMBOL(procname);
define_internal(procname, MAKE_CLOSURE(CONS(formals, body), env), env);
} else {
@@ -1668,7 +1668,7 @@
DECLARE_FUNCTION("scheme-report-environment", procedure_fixed_1);
/* sanity check */
- ASSERT_INTP(version);
+ ENSURE_INT(version);
if (SCM_INT_VALUE(version) != 5)
ERR_OBJ("version must be 5 but got", version);
@@ -1688,7 +1688,7 @@
DECLARE_FUNCTION("null-environment", procedure_fixed_1);
/* sanity check */
- ASSERT_INTP(version);
+ ENSURE_INT(version);
if (SCM_INT_VALUE(version) != 5)
ERR_OBJ("version must be 5 but got", version);
Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/io.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -249,8 +249,8 @@
ScmObj port, ret;
DECLARE_FUNCTION("call-with-input-file", procedure_fixed_2);
- ASSERT_STRINGP(filepath);
- ASSERT_PROCEDUREP(proc);
+ ENSURE_STRING(filepath);
+ ENSURE_PROCEDURE(proc);
port = scm_p_open_input_file(filepath);
@@ -267,8 +267,8 @@
ScmObj port, ret;
DECLARE_FUNCTION("call-with-output-file", procedure_fixed_2);
- ASSERT_STRINGP(filepath);
- ASSERT_PROCEDUREP(proc);
+ ENSURE_STRING(filepath);
+ ENSURE_PROCEDURE(proc);
port = scm_p_open_output_file(filepath);
@@ -284,7 +284,7 @@
{
DECLARE_FUNCTION("input-port?", procedure_fixed_1);
- ASSERT_PORTP(port);
+ ENSURE_PORT(port);
return MAKE_BOOL(SCM_PORT_FLAG(port) & SCM_PORTFLAG_INPUT);
}
@@ -294,7 +294,7 @@
{
DECLARE_FUNCTION("output-port?", procedure_fixed_1);
- ASSERT_PORTP(port);
+ ENSURE_PORT(port);
return MAKE_BOOL(SCM_PORT_FLAG(port) & SCM_PORTFLAG_OUTPUT);
}
@@ -321,8 +321,8 @@
ScmObj saved_port, ret;
DECLARE_FUNCTION("with-input-from-file", procedure_fixed_2);
- ASSERT_STRINGP(filepath);
- ASSERT_PROCEDUREP(thunk);
+ ENSURE_STRING(filepath);
+ ENSURE_PROCEDURE(thunk);
saved_port = scm_in;
scm_in = scm_p_open_input_file(filepath);
@@ -341,8 +341,8 @@
ScmObj saved_port, ret;
DECLARE_FUNCTION("with-output-to-file", procedure_fixed_2);
- ASSERT_STRINGP(filepath);
- ASSERT_PROCEDUREP(thunk);
+ ENSURE_STRING(filepath);
+ ENSURE_PROCEDURE(thunk);
saved_port = scm_out;
scm_out = scm_p_open_output_file(filepath);
@@ -361,7 +361,7 @@
ScmBytePort *bport;
DECLARE_FUNCTION("open-input-file", procedure_fixed_1);
- ASSERT_STRINGP(filepath);
+ ENSURE_STRING(filepath);
bport = ScmFilePort_open_input_file(SCM_STRING_STR(filepath));
if (!bport)
@@ -376,7 +376,7 @@
ScmBytePort *bport;
DECLARE_FUNCTION("open-output-file", procedure_fixed_1);
- ASSERT_STRINGP(filepath);
+ ENSURE_STRING(filepath);
bport = ScmFilePort_open_output_file(SCM_STRING_STR(filepath));
if (!bport)
@@ -391,7 +391,7 @@
int flag;
DECLARE_FUNCTION("close-input-port", procedure_fixed_1);
- ASSERT_PORTP(port);
+ ENSURE_PORT(port);
flag = SCM_PORT_FLAG(port) & ~SCM_PORTFLAG_LIVE_INPUT;
SCM_PORT_SET_FLAG(port, flag);
@@ -407,7 +407,7 @@
int flag;
DECLARE_FUNCTION("close-output-port", procedure_fixed_1);
- ASSERT_PORTP(port);
+ ENSURE_PORT(port);
flag = SCM_PORT_FLAG(port) & ~SCM_PORTFLAG_LIVE_OUTPUT;
SCM_PORT_SET_FLAG(port, flag);
@@ -425,7 +425,7 @@
port = POP_ARG(args); \
if (!VALIDP(port)) \
port = default_port; \
- ASSERT_PORTP(port); \
+ ENSURE_PORT(port); \
ASSERT_NO_MORE_ARG(args); \
} while (/* CONSTCOND */ 0)
@@ -533,7 +533,7 @@
ScmObj port;
DECLARE_FUNCTION("write-char", procedure_variadic_1);
- ASSERT_CHARP(obj);
+ ENSURE_CHAR(obj);
PREPARE_PORT(port, args, scm_out);
scm_display_to_port(port, obj);
@@ -648,7 +648,7 @@
{
DECLARE_FUNCTION("load", procedure_fixed_1);
- ASSERT_STRINGP(filename);
+ ENSURE_STRING(filename);
scm_load_internal(SCM_STRING_STR(filename));
Modified: branches/r5rs/sigscheme/operations-nonstd.c
===================================================================
--- branches/r5rs/sigscheme/operations-nonstd.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/operations-nonstd.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -84,11 +84,11 @@
ScmObj env = SCM_INVALID;
DECLARE_FUNCTION("symbol-bound?", procedure_variadic_1);
- ASSERT_SYMBOLP(sym);
+ ENSURE_SYMBOL(sym);
env = POP_ARG(rest);
if (VALIDP(env))
- ASSERT_ENVP(env);
+ ENSURE_ENV(env);
else
env = SCM_INTERACTION_ENV;
@@ -114,7 +114,7 @@
#endif
DECLARE_FUNCTION("require", procedure_fixed_1);
- ASSERT_STRINGP(filename);
+ ENSURE_STRING(filename);
loaded_str = create_loaded_str(filename);
if (FALSEP(scm_p_providedp(loaded_str))) {
@@ -155,7 +155,7 @@
{
DECLARE_FUNCTION("provide", procedure_fixed_1);
- ASSERT_STRINGP(feature);
+ ENSURE_STRING(feature);
scm_provide(feature);
@@ -171,7 +171,7 @@
{
DECLARE_FUNCTION("provided?", procedure_fixed_1);
- ASSERT_STRINGP(feature);
+ ENSURE_STRING(feature);
return MAKE_BOOL(scm_providedp(feature));
}
@@ -186,7 +186,7 @@
FILE *f;
DECLARE_FUNCTION("file-exists?", procedure_fixed_1);
- ASSERT_STRINGP(filepath);
+ ENSURE_STRING(filepath);
f = fopen(SCM_STRING_STR(filepath), "r");
if (!f)
@@ -202,7 +202,7 @@
{
DECLARE_FUNCTION("delete-file", procedure_fixed_1);
- ASSERT_STRINGP(filepath);
+ ENSURE_STRING(filepath);
if (remove(SCM_STRING_STR(filepath)) == -1)
ERR_OBJ("delete failed. file = ", filepath);
Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/operations-siod.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -131,7 +131,7 @@
{
DECLARE_FUNCTION("symbol-value", procedure_fixed_1);
- ASSERT_SYMBOLP(var);
+ ENSURE_SYMBOL(var);
return scm_symbol_value(var, SCM_NULL);
}
@@ -148,7 +148,7 @@
{
DECLARE_FUNCTION("set-symbol-value!", procedure_fixed_2);
- ASSERT_SYMBOLP(var);
+ ENSURE_SYMBOL(var);
SCM_SYMBOL_SET_VCELL(var, val);
@@ -186,7 +186,7 @@
ScmObj exp, body;
DECLARE_FUNCTION("%%closure-code", procedure_fixed_1);
- ASSERT_CLOSUREP(closure);
+ ENSURE_CLOSURE(closure);
exp = SCM_CLOSURE_EXP(closure);
if (NULLP(CDDR(exp)))
@@ -203,7 +203,7 @@
DECLARE_FUNCTION("verbose", procedure_variadic_0);
if (!NULLP(args)) {
- ASSERT_INTP(CAR(args));
+ ENSURE_INT(CAR(args));
scm_set_verbose_level(SCM_INT_VALUE(CAR(args)));
}
@@ -224,7 +224,7 @@
ScmRef val;
DECLARE_FUNCTION("undefine", syntax_fixed_1);
- ASSERT_SYMBOLP(var);
+ ENSURE_SYMBOL(var);
val = scm_lookup_environment(var, env);
if (val != SCM_INVALID_REF)
Modified: branches/r5rs/sigscheme/operations-srfi1.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi1.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/operations-srfi1.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -110,7 +110,7 @@
int i = 0;
DECLARE_FUNCTION("make-list", procedure_variadic_1);
- ASSERT_INTP(length);
+ ENSURE_INT(length);
len = SCM_INT_VALUE(length);
@@ -138,7 +138,7 @@
int i = 0;
DECLARE_FUNCTION("list-tabulate", procedure_variadic_1);
- ASSERT_INTP(scm_n);
+ ENSURE_INT(scm_n);
/* get n */
n = SCM_INT_VALUE(scm_n);
@@ -224,11 +224,11 @@
scm_step = CAR(CDR(args));
/* param type check */
- ASSERT_INTP(scm_count);
+ ENSURE_INT(scm_count);
if (!NULLP(scm_start))
- ASSERT_INTP(scm_start);
+ ENSURE_INT(scm_start);
if (!NULLP(scm_step))
- ASSERT_INTP(scm_step);
+ ENSURE_INT(scm_step);
/* now create list */
count = SCM_INT_VALUE(scm_count);
@@ -455,7 +455,7 @@
int i;
DECLARE_FUNCTION("take", procedure_fixed_2);
- ASSERT_INTP(scm_idx);
+ ENSURE_INT(scm_idx);
idx = SCM_INT_VALUE(scm_idx);
for (i = 0; i < idx; i++) {
@@ -484,7 +484,7 @@
int i;
DECLARE_FUNCTION("drop", procedure_fixed_2);
- ASSERT_INTP(scm_idx);
+ ENSURE_INT(scm_idx);
idx = SCM_INT_VALUE(scm_idx);
for (i = 0; i < idx; i++) {
@@ -504,7 +504,7 @@
int len = 0;
DECLARE_FUNCTION("take-right", procedure_fixed_2);
- ASSERT_INTP(scm_elem);
+ ENSURE_INT(scm_elem);
for (; CONSP(tmp); tmp = CDR(tmp))
len++;
@@ -521,7 +521,7 @@
int len = 0;
DECLARE_FUNCTION("drop-right", procedure_fixed_2);
- ASSERT_INTP(scm_elem);
+ ENSURE_INT(scm_elem);
for (; CONSP(tmp); tmp = CDR(tmp))
len++;
@@ -539,7 +539,7 @@
int i;
DECLARE_FUNCTION("take!", procedure_fixed_2);
- ASSERT_INTP(scm_idx);
+ ENSURE_INT(scm_idx);
idx = SCM_INT_VALUE(scm_idx);
@@ -560,7 +560,7 @@
int i;
DECLARE_FUNCTION("drop-right!", procedure_fixed_2);
- ASSERT_INTP(scm_idx);
+ ENSURE_INT(scm_idx);
for (; CONSP(tmp); tmp = CDR(tmp))
len++;
Modified: branches/r5rs/sigscheme/operations-srfi23.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi23.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/operations-srfi23.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -95,7 +95,7 @@
* Although SRFI-23 specified that "The argument <reason> should be a
* string", we should not force it. Displayable is sufficient.
*/
- ASSERT_STRINGP(reason);
+ ENSURE_STRING(reason);
#endif
err_obj = scm_make_error_obj(reason, args);
Modified: branches/r5rs/sigscheme/operations-srfi34.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi34.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/operations-srfi34.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -225,8 +225,8 @@
ScmObj handlers;
DECLARE_FUNCTION("with-exception-handler", procedure_fixed_2);
- ASSERT_PROCEDUREP(handler);
- ASSERT_PROCEDUREP(thunk);
+ ENSURE_PROCEDURE(handler);
+ ENSURE_PROCEDURE(thunk);
handlers = CONS(handler, current_exception_handlers);
return with_exception_handlers(handlers, thunk);
@@ -268,8 +268,8 @@
ScmObj lex_env, proc_guard_int, ret;
DECLARE_FUNCTION("guard", syntax_variadic_tailrec_1);
- ASSERT_CONSP(cond_catch);
- ASSERT_CONSP(body);
+ ENSURE_CONS(cond_catch);
+ ENSURE_CONS(body);
lex_env = eval_state->env;
eval_state->env
@@ -354,7 +354,7 @@
/* eval cond-catch block */
sym_var = CAR(cond_catch);
clauses = CDR(cond_catch);
- ASSERT_SYMBOLP(sym_var);
+ ENSURE_SYMBOL(sym_var);
cond_env = scm_extend_environment(LIST_1(sym_var),
LIST_1(condition),
lex_env);
Modified: branches/r5rs/sigscheme/operations-srfi6.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi6.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/operations-srfi6.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -88,7 +88,7 @@
ScmBytePort *bport;
DECLARE_FUNCTION("open-input-string", procedure_fixed_1);
- ASSERT_STRINGP(str);
+ ENSURE_STRING(str);
bport = ScmInputStrPort_new_const(SCM_STRING_STR(str), istrport_finalize);
hold_str = (ScmObj *)ScmInputStrPort_ref_opaque(bport);
@@ -112,7 +112,7 @@
ScmBaseCharPort *cport;
DECLARE_FUNCTION("get-output-string", procedure_fixed_1);
- ASSERT_PORTP(port);
+ ENSURE_PORT(port);
SCM_ENSURE_LIVE_PORT(port);
cport = SCM_CHARPORT_DYNAMIC_CAST(ScmBaseCharPort, SCM_PORT_IMPL(port));
Modified: branches/r5rs/sigscheme/operations-srfi60.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi60.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/operations-srfi60.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -55,12 +55,12 @@
case SCM_REDUCE_0: \
break; \
case SCM_REDUCE_1: \
- ASSERT_INTP(left); \
+ ENSURE_INT(left); \
return right; \
case SCM_REDUCE_PARTWAY: \
case SCM_REDUCE_LAST: \
/* left is already ensured as int by previous loop */ \
- ASSERT_INTP(right); \
+ ENSURE_INT(right); \
result = (SCM_INT_VALUE(left) op SCM_INT_VALUE(right)); \
break; \
default: \
@@ -120,7 +120,7 @@
{
DECLARE_FUNCTION("lognot", procedure_fixed_1);
- ASSERT_INTP(n);
+ ENSURE_INT(n);
return MAKE_INT(~SCM_INT_VALUE(n));
}
@@ -131,9 +131,9 @@
int result, c_mask;
DECLARE_FUNCTION("bitwise-if", procedure_fixed_3);
- ASSERT_INTP(mask);
- ASSERT_INTP(n0);
- ASSERT_INTP(n1);
+ ENSURE_INT(mask);
+ ENSURE_INT(n0);
+ ENSURE_INT(n1);
c_mask = SCM_INT_VALUE(mask);
result = (c_mask & SCM_INT_VALUE(n0)) | (~c_mask & SCM_INT_VALUE(n1));
@@ -146,8 +146,8 @@
{
DECLARE_FUNCTION("logtest", procedure_fixed_2);
- ASSERT_INTP(j);
- ASSERT_INTP(k);
+ ENSURE_INT(j);
+ ENSURE_INT(k);
return MAKE_BOOL(SCM_INT_VALUE(j) & SCM_INT_VALUE(k));
}
Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/operations.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -217,11 +217,11 @@
switch (*state) {
case SCM_REDUCE_PARTWAY:
case SCM_REDUCE_LAST:
- ASSERT_INTP(left);
+ ENSURE_INT(left);
result = SCM_INT_VALUE(left);
/* Fall through. */
case SCM_REDUCE_1:
- ASSERT_INTP(right);
+ ENSURE_INT(right);
result += SCM_INT_VALUE(right);
/* Fall through. */
case SCM_REDUCE_0:
@@ -241,11 +241,11 @@
switch (*state) {
case SCM_REDUCE_PARTWAY:
case SCM_REDUCE_LAST:
- ASSERT_INTP(left);
+ ENSURE_INT(left);
result = SCM_INT_VALUE(left);
/* Fall through. */
case SCM_REDUCE_1:
- ASSERT_INTP(right);
+ ENSURE_INT(right);
result *= SCM_INT_VALUE(right);
/* Fall through. */
case SCM_REDUCE_0:
@@ -265,11 +265,11 @@
switch (*state) {
case SCM_REDUCE_PARTWAY:
case SCM_REDUCE_LAST:
- ASSERT_INTP(left);
+ ENSURE_INT(left);
result = SCM_INT_VALUE(left);
/* Fall through. */
case SCM_REDUCE_1:
- ASSERT_INTP(right);
+ ENSURE_INT(right);
result -= SCM_INT_VALUE(right);
break;
@@ -289,11 +289,11 @@
switch (*state) {
case SCM_REDUCE_PARTWAY:
case SCM_REDUCE_LAST:
- ASSERT_INTP(left);
+ ENSURE_INT(left);
result = SCM_INT_VALUE(left);
/* Fall through. */
case SCM_REDUCE_1:
- ASSERT_INTP(right);
+ ENSURE_INT(right);
if (SCM_INT_VALUE(right) == 0)
ERR("division by zero");
result /= SCM_INT_VALUE(right);
@@ -324,8 +324,8 @@
ERR("at least 2 arguments required"); \
case SCM_REDUCE_PARTWAY: \
case SCM_REDUCE_LAST: \
- ASSERT_INTP(left); \
- ASSERT_INTP(right); \
+ ENSURE_INT(left); \
+ ENSURE_INT(right); \
if (SCM_INT_VALUE(left) op SCM_INT_VALUE(right)) \
return *state == SCM_REDUCE_LAST ? SCM_TRUE : right; \
*state = SCM_REDUCE_STOP; \
@@ -371,7 +371,7 @@
scm_p_zerop(ScmObj scm_num)
{
DECLARE_FUNCTION("zero?", procedure_fixed_1);
- ASSERT_INTP(scm_num);
+ ENSURE_INT(scm_num);
return MAKE_BOOL(SCM_INT_VALUE(scm_num) == 0);
}
@@ -379,7 +379,7 @@
scm_p_positivep(ScmObj scm_num)
{
DECLARE_FUNCTION("positive?", procedure_fixed_1);
- ASSERT_INTP(scm_num);
+ ENSURE_INT(scm_num);
return MAKE_BOOL(SCM_INT_VALUE(scm_num) > 0);
}
@@ -387,7 +387,7 @@
scm_p_negativep(ScmObj scm_num)
{
DECLARE_FUNCTION("negative?", procedure_fixed_1);
- ASSERT_INTP(scm_num);
+ ENSURE_INT(scm_num);
return MAKE_BOOL(SCM_INT_VALUE(scm_num) < 0);
}
@@ -395,7 +395,7 @@
scm_p_oddp(ScmObj scm_num)
{
DECLARE_FUNCTION("odd?", procedure_fixed_1);
- ASSERT_INTP(scm_num);
+ ENSURE_INT(scm_num);
return MAKE_BOOL(SCM_INT_VALUE(scm_num) & 0x1);
}
@@ -403,7 +403,7 @@
scm_p_evenp(ScmObj scm_num)
{
DECLARE_FUNCTION("even?", procedure_fixed_1);
- ASSERT_INTP(scm_num);
+ ENSURE_INT(scm_num);
return MAKE_BOOL(!(SCM_INT_VALUE(scm_num) & 0x1));
}
@@ -413,8 +413,8 @@
DECLARE_FUNCTION("max", reduction_operator);
if (*state == SCM_REDUCE_0)
ERR("at least 1 argument required");
- ASSERT_INTP(left);
- ASSERT_INTP(right);
+ ENSURE_INT(left);
+ ENSURE_INT(right);
return SCM_INT_VALUE(left) > SCM_INT_VALUE(right) ? left : right;
}
@@ -425,8 +425,8 @@
DECLARE_FUNCTION("min", reduction_operator);
if (*state == SCM_REDUCE_0)
ERR("at least 1 argument required");
- ASSERT_INTP(left);
- ASSERT_INTP(right);
+ ENSURE_INT(left);
+ ENSURE_INT(right);
return SCM_INT_VALUE(left) < SCM_INT_VALUE(right) ? left : right;
}
@@ -438,7 +438,7 @@
int num = 0;
DECLARE_FUNCTION("abs", procedure_fixed_1);
- ASSERT_INTP(scm_num);
+ ENSURE_INT(scm_num);
num = SCM_INT_VALUE(scm_num);
@@ -452,8 +452,8 @@
int n2 = 0;
DECLARE_FUNCTION("quotient", procedure_fixed_2);
- ASSERT_INTP(scm_n1);
- ASSERT_INTP(scm_n2);
+ ENSURE_INT(scm_n1);
+ ENSURE_INT(scm_n2);
n1 = SCM_INT_VALUE(scm_n1);
n2 = SCM_INT_VALUE(scm_n2);
@@ -472,8 +472,8 @@
int rem = 0;
DECLARE_FUNCTION("modulo", procedure_fixed_2);
- ASSERT_INTP(scm_n1);
- ASSERT_INTP(scm_n2);
+ ENSURE_INT(scm_n1);
+ ENSURE_INT(scm_n2);
n1 = SCM_INT_VALUE(scm_n1);
n2 = SCM_INT_VALUE(scm_n2);
@@ -498,8 +498,8 @@
int n2 = 0;
DECLARE_FUNCTION("remainder", procedure_fixed_2);
- ASSERT_INTP(scm_n1);
- ASSERT_INTP(scm_n2);
+ ENSURE_INT(scm_n1);
+ ENSURE_INT(scm_n2);
n1 = SCM_INT_VALUE(scm_n1);
n2 = SCM_INT_VALUE(scm_n2);
@@ -522,7 +522,7 @@
ScmObj radix;
DECLARE_FUNCTION("number->string", procedure_variadic_1);
- ASSERT_INTP(num);
+ ENSURE_INT(num);
n = SCM_INT_VALUE(num);
/* r = radix */
@@ -532,7 +532,7 @@
radix = POP_ARG(args);
ASSERT_NO_MORE_ARG(args);
- ASSERT_INTP(radix);
+ ENSURE_INT(radix);
r = SCM_INT_VALUE(radix);
#if SCM_STRICT_R5RS
if (!(r == 2 || r == 8 || r == 10 || r == 16))
@@ -571,14 +571,14 @@
char *first_nondigit = NULL;
DECLARE_FUNCTION("string->number", procedure_variadic_1);
- ASSERT_STRINGP(str);
+ ENSURE_STRING(str);
/* r = radix */
if (!NO_MORE_ARG(args)) {
radix = POP_ARG(args);
ASSERT_NO_MORE_ARG(args);
- ASSERT_INTP(radix);
+ ENSURE_INT(radix);
r = SCM_INT_VALUE(radix);
#if SCM_STRICT_R5RS
if (!(r == 2 || r == 8 || r == 10 || r == 16))
@@ -627,7 +627,7 @@
return SCM_NULL;
#endif
- ASSERT_CONSP(obj);
+ ENSURE_CONS(obj);
return CAR(obj);
}
@@ -641,7 +641,7 @@
return SCM_NULL;
#endif
- ASSERT_CONSP(obj);
+ ENSURE_CONS(obj);
return CDR(obj);
}
@@ -664,7 +664,7 @@
scm_p_set_card(ScmObj pair, ScmObj car)
{
DECLARE_FUNCTION("set-car!", procedure_fixed_2);
- ASSERT_CONSP(pair);
+ ENSURE_CONS(pair);
SET_CAR(pair, car);
@@ -679,7 +679,7 @@
scm_p_set_cdrd(ScmObj pair, ScmObj cdr)
{
DECLARE_FUNCTION("set-cdr!", procedure_fixed_2);
- ASSERT_CONSP(pair);
+ ENSURE_CONS(pair);
SET_CDR(pair, cdr);
@@ -862,7 +862,7 @@
ScmObj ret;
DECLARE_FUNCTION("list-tail", procedure_fixed_2);
- ASSERT_INTP(scm_k);
+ ENSURE_INT(scm_k);
ret = scm_p_listtail_internal(lst, SCM_INT_VALUE(scm_k));
if (EQ(ret, SCM_INVALID))
@@ -877,7 +877,7 @@
ScmObj tail = SCM_NULL;
DECLARE_FUNCTION("list-ref", procedure_fixed_2);
- ASSERT_INTP(scm_k);
+ ENSURE_INT(scm_k);
tail = scm_p_listtail_internal(lst, SCM_INT_VALUE(scm_k));
if (EQ(tail, SCM_INVALID) || NULLP(tail))
@@ -957,7 +957,7 @@
tmpobj = CAR(tmp_lst);
car = CAR(tmpobj);
#if SCM_STRICT_R5RS
- ASSERT_CONSP(tmpobj);
+ ENSURE_CONS(tmpobj);
if (EQ(CAR(tmpobj), obj))
return tmpobj;
#else
@@ -981,7 +981,7 @@
tmpobj = CAR(tmp_lst);
car = CAR(tmpobj);
#if SCM_STRICT_R5RS
- ASSERT_CONSP(tmpobj);
+ ENSURE_CONS(tmpobj);
if (NFALSEP(scm_p_eqvp(car, obj)))
return tmpobj;
#else
@@ -1005,7 +1005,7 @@
tmpobj = CAR(tmp_lst);
car = CAR(tmpobj);
#if SCM_STRICT_R5RS
- ASSERT_CONSP(tmpobj);
+ ENSURE_CONS(tmpobj);
if (NFALSEP(scm_p_equalp(car, obj)))
return tmpobj;
#else
@@ -1032,7 +1032,7 @@
scm_p_symbol2string(ScmObj obj)
{
DECLARE_FUNCTION("symbol->string", procedure_fixed_1);
- ASSERT_SYMBOLP(obj);
+ ENSURE_SYMBOL(obj);
return MAKE_IMMUTABLE_STRING_COPYING(SCM_SYMBOL_NAME(obj));
}
@@ -1040,7 +1040,7 @@
scm_p_string2symbol(ScmObj str)
{
DECLARE_FUNCTION("string->symbol", procedure_fixed_1);
- ASSERT_STRINGP(str);
+ ENSURE_STRING(str);
return scm_intern(SCM_STRING_STR(str));
}
@@ -1059,8 +1059,8 @@
{
DECLARE_FUNCTION("char=?", procedure_fixed_2);
- ASSERT_CHARP(ch1);
- ASSERT_CHARP(ch2);
+ ENSURE_CHAR(ch1);
+ ENSURE_CHAR(ch2);
return MAKE_BOOL(SCM_CHAR_VALUE(ch1) == SCM_CHAR_VALUE(ch2));
}
@@ -1071,7 +1071,7 @@
int ch;
DECLARE_FUNCTION("char-alphabetic?", procedure_fixed_1);
- ASSERT_CHARP(obj);
+ ENSURE_CHAR(obj);
ch = SCM_CHAR_VALUE(obj);
@@ -1084,7 +1084,7 @@
int ch;
DECLARE_FUNCTION("char-numeric?", procedure_fixed_1);
- ASSERT_CHARP(obj);
+ ENSURE_CHAR(obj);
ch = SCM_CHAR_VALUE(obj);
@@ -1097,7 +1097,7 @@
int ch;
DECLARE_FUNCTION("char-whitespace?", procedure_fixed_1);
- ASSERT_CHARP(obj);
+ ENSURE_CHAR(obj);
ch = SCM_CHAR_VALUE(obj);
@@ -1110,7 +1110,7 @@
int ch;
DECLARE_FUNCTION("char-upper-case?", procedure_fixed_1);
- ASSERT_CHARP(obj);
+ ENSURE_CHAR(obj);
ch = SCM_CHAR_VALUE(obj);
@@ -1123,7 +1123,7 @@
int ch;
DECLARE_FUNCTION("char-lower-case?", procedure_fixed_1);
- ASSERT_CHARP(obj);
+ ENSURE_CHAR(obj);
ch = SCM_CHAR_VALUE(obj);
@@ -1135,7 +1135,7 @@
{
DECLARE_FUNCTION("char->integer", procedure_fixed_1);
- ASSERT_CHARP(obj);
+ ENSURE_CHAR(obj);
return MAKE_INT(SCM_CHAR_VALUE(obj));
}
@@ -1146,7 +1146,7 @@
int val;
DECLARE_FUNCTION("integer->char", procedure_fixed_1);
- ASSERT_INTP(obj);
+ ENSURE_INT(obj);
val = SCM_INT_VALUE(obj);
if (!SCM_CHARCODEC_CHAR_LEN(scm_current_char_codec, val))
@@ -1160,7 +1160,7 @@
int ch;
DECLARE_FUNCTION("char-upcase", procedure_fixed_1);
- ASSERT_CHARP(obj);
+ ENSURE_CHAR(obj);
ch = SCM_CHAR_VALUE(obj);
if (isascii(ch))
@@ -1175,7 +1175,7 @@
int ch;
DECLARE_FUNCTION("char-downcase", procedure_fixed_1);
- ASSERT_CHARP(obj);
+ ENSURE_CHAR(obj);
ch = SCM_CHAR_VALUE(obj);
if (isascii(ch))
@@ -1202,7 +1202,7 @@
ScmObj sport = SCM_FALSE;
DECLARE_FUNCTION("make-string", procedure_variadic_1);
- ASSERT_INTP(length);
+ ENSURE_INT(length);
len = SCM_INT_VALUE(length);
if (len == 0)
return MAKE_STRING_COPYING("");
@@ -1215,7 +1215,7 @@
} else {
filler = POP_ARG(args);
ASSERT_NO_MORE_ARG(args);
- ASSERT_CHARP(filler);
+ ENSURE_CHAR(filler);
filler_val = SCM_CHAR_VALUE(filler);
}
@@ -1240,7 +1240,7 @@
scm_p_string_length(ScmObj str)
{
DECLARE_FUNCTION("string-length", procedure_fixed_1);
- ASSERT_STRINGP(str);
+ ENSURE_STRING(str);
return MAKE_INT(scm_mb_bare_c_strlen(SCM_STRING_STR(str)));
}
@@ -1252,8 +1252,8 @@
ScmMultibyteString mbs;
DECLARE_FUNCTION("string-ref", procedure_fixed_2);
- ASSERT_STRINGP(str);
- ASSERT_INTP(k);
+ ENSURE_STRING(str);
+ ENSURE_INT(k);
c_index = SCM_INT_VALUE(k);
if (c_index < 0 || SCM_STRING_LEN(str) <= c_index)
@@ -1288,10 +1288,10 @@
DECLARE_FUNCTION("string-set!", procedure_fixed_3);
ENSURE_STATELESS_CODEC(scm_current_char_codec);
- ASSERT_STRINGP(str);
- ASSERT_MUTABLEP(str);
- ASSERT_INTP(k);
- ASSERT_CHARP(ch);
+ ENSURE_STRING(str);
+ ENSURE_MUTABLE(str);
+ ENSURE_INT(k);
+ ENSURE_CHAR(ch);
ch_val = SCM_CHAR_VALUE(ch);
c_start_index = SCM_INT_VALUE(k);
@@ -1339,8 +1339,8 @@
{
DECLARE_FUNCTION("string=?", procedure_fixed_2);
- ASSERT_STRINGP(str1);
- ASSERT_STRINGP(str2);
+ ENSURE_STRING(str1);
+ ENSURE_STRING(str2);
if (strcmp(SCM_STRING_STR(str1), SCM_STRING_STR(str2)) == 0)
return SCM_TRUE;
@@ -1358,9 +1358,9 @@
const char *string_str = NULL;
DECLARE_FUNCTION("substring", procedure_fixed_3);
- ASSERT_STRINGP(str);
- ASSERT_INTP(start);
- ASSERT_INTP(end);
+ ENSURE_STRING(str);
+ ENSURE_INT(start);
+ ENSURE_INT(end);
/* get start_ptr and end_ptr */
c_start_index = SCM_INT_VALUE(start);
@@ -1407,7 +1407,7 @@
/* count total size of the new string */
for (strlst = args; !NULLP(strlst); strlst = CDR(strlst)) {
obj = CAR(strlst);
- ASSERT_STRINGP(obj);
+ ENSURE_STRING(obj);
total_size += strlen(SCM_STRING_STR(obj));
total_len += SCM_STRING_LEN(obj);
@@ -1438,7 +1438,7 @@
ScmMultibyteState state;
DECLARE_FUNCTION("string->list", procedure_fixed_1);
- ASSERT_STRINGP(str);
+ ENSURE_STRING(str);
SCM_MBS_INIT(mbs);
SCM_MBS_SET_STR(mbs, SCM_STRING_STR(str));
@@ -1471,7 +1471,7 @@
ScmObj rest, ch, sport;
DECLARE_FUNCTION("list->string", procedure_fixed_1);
- ASSERT_LISTP(lst);
+ ENSURE_LIST(lst);
if (NULLP(lst))
return MAKE_STRING_COPYING("");
@@ -1480,7 +1480,7 @@
sport = scm_p_srfi6_open_output_string();
for (rest = lst; CONSP(rest); rest = CDR(rest)) {
ch = CAR(rest);
- ASSERT_CHARP(ch);
+ ENSURE_CHAR(ch);
scm_port_put_char(sport, SCM_CHAR_VALUE(ch));
}
if (!NULLP(rest))
@@ -1493,7 +1493,7 @@
scm_p_string_copy(ScmObj str)
{
DECLARE_FUNCTION("string-copy", procedure_fixed_1);
- ASSERT_STRINGP(str);
+ ENSURE_STRING(str);
return MAKE_STRING_COPYING(SCM_STRING_STR(str));
}
@@ -1509,9 +1509,9 @@
DECLARE_FUNCTION("string-fill!", procedure_fixed_2);
ENSURE_STATELESS_CODEC(scm_current_char_codec);
- ASSERT_STRINGP(str);
- ASSERT_MUTABLEP(str);
- ASSERT_CHARP(ch);
+ ENSURE_STRING(str);
+ ENSURE_MUTABLE(str);
+ ENSURE_CHAR(ch);
str_len = SCM_STRING_LEN(str);
if (str_len == 0)
@@ -1553,7 +1553,7 @@
int i = 0;
DECLARE_FUNCTION("make-vector", procedure_variadic_1);
- ASSERT_INTP(vector_len);
+ ENSURE_INT(vector_len);
/* sanity check */
if (SCM_INT_VALUE(vector_len) < 0)
@@ -1595,7 +1595,7 @@
{
DECLARE_FUNCTION("vector-length", procedure_fixed_1);
- ASSERT_VECTORP(vec);
+ ENSURE_VECTOR(vec);
return MAKE_INT(SCM_VECTOR_LEN(vec));
}
@@ -1605,8 +1605,8 @@
int k;
DECLARE_FUNCTION("vector-ref", procedure_fixed_2);
- ASSERT_VECTORP(vec);
- ASSERT_INTP(scm_k);
+ ENSURE_VECTOR(vec);
+ ENSURE_INT(scm_k);
k = SCM_INT_VALUE(scm_k);
@@ -1622,8 +1622,8 @@
int k;
DECLARE_FUNCTION("vector-set!", procedure_fixed_3);
- ASSERT_VECTORP(vec);
- ASSERT_INTP(scm_k);
+ ENSURE_VECTOR(vec);
+ ENSURE_INT(scm_k);
k = SCM_INT_VALUE(scm_k);
@@ -1644,7 +1644,7 @@
int len, i;
DECLARE_FUNCTION("vector->list", procedure_fixed_1);
- ASSERT_VECTORP(vec);
+ ENSURE_VECTOR(vec);
v = SCM_VECTOR_VEC(vec);
len = SCM_VECTOR_LEN(vec);
@@ -1688,7 +1688,7 @@
int i = 0;
DECLARE_FUNCTION("vector-fill!", procedure_fixed_2);
- ASSERT_VECTORP(vec);
+ ENSURE_VECTOR(vec);
c_len = SCM_VECTOR_LEN(vec);
for (i = 0; i < c_len; i++) {
@@ -1786,7 +1786,7 @@
{
DECLARE_FUNCTION("force", procedure_fixed_1);
- ASSERT_CLOSUREP(closure);
+ ENSURE_CLOSURE(closure);
return scm_call(closure, SCM_NULL);
}
@@ -1796,7 +1796,7 @@
{
DECLARE_FUNCTION("call-with-current-continuation", procedure_fixed_tailrec_1);
- ASSERT_PROCEDUREP(proc);
+ ENSURE_PROCEDURE(proc);
return scm_call_with_current_continuation(proc, eval_state);
}
@@ -1820,8 +1820,8 @@
ScmObj vals;
DECLARE_FUNCTION("call-with-values", procedure_fixed_tailrec_2);
- ASSERT_PROCEDUREP(producer);
- ASSERT_PROCEDUREP(consumer);
+ ENSURE_PROCEDURE(producer);
+ ENSURE_PROCEDURE(consumer);
vals = scm_call(producer, SCM_NULL);
@@ -1841,9 +1841,9 @@
{
DECLARE_FUNCTION("dynamic-wind", procedure_fixed_3);
- ASSERT_PROCEDUREP(before);
- ASSERT_PROCEDUREP(thunk);
- ASSERT_PROCEDUREP(after);
+ ENSURE_PROCEDURE(before);
+ ENSURE_PROCEDURE(thunk);
+ ENSURE_PROCEDURE(after);
return scm_dynamic_wind(before, thunk, after);
}
Modified: branches/r5rs/sigscheme/print.c
===================================================================
--- branches/r5rs/sigscheme/print.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/print.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -137,7 +137,7 @@
{
DECLARE_INTERNAL_FUNCTION("scm_write_to_port");
- ASSERT_PORTP(port);
+ ENSURE_PORT(port);
SCM_ENSURE_LIVE_PORT(port);
if (!(SCM_PORT_FLAG(port) & SCM_PORTFLAG_OUTPUT))
ERR("output port is required");
@@ -154,7 +154,7 @@
{
DECLARE_INTERNAL_FUNCTION("scm_display_to_port");
- ASSERT_PORTP(port);
+ ENSURE_PORT(port);
SCM_ENSURE_LIVE_PORT(port);
if (!(SCM_PORT_FLAG(port) & SCM_PORTFLAG_OUTPUT))
ERR("output port is required");
Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/read.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -142,7 +142,7 @@
ScmObj sexp = SCM_FALSE;
DECLARE_INTERNAL_FUNCTION("scm_read");
- ASSERT_PORTP(port);
+ ENSURE_PORT(port);
sexp = read_sexpression(port);
#if SCM_DEBUG
@@ -160,7 +160,7 @@
{
DECLARE_INTERNAL_FUNCTION("scm_read_char");
- ASSERT_PORTP(port);
+ ENSURE_PORT(port);
return read_char(port);
}
Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/sigscheme.c 2006-01-03 06:09:50 UTC (rev 2742)
@@ -246,7 +246,7 @@
ScmObj feature_str;
DECLARE_FUNCTION("use", syntax_fixed_1);
- ASSERT_SYMBOLP(feature);
+ ENSURE_SYMBOL(feature);
for (mod = module_info_table; mod->name; mod++) {
if (EQ(feature, scm_intern(mod->name))) {
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2006-01-03 05:54:54 UTC (rev 2741)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2006-01-03 06:09:50 UTC (rev 2742)
@@ -330,28 +330,25 @@
? (SCM_MANGLE(tmp) = CAR(args), (args) = CDR(args), SCM_MANGLE(tmp)) \
: (ERR("missing argument(s)"), NULL))
-/* FIXME: Rename to ENSURE_TYPE() */
-#define ASSERT_TYPE(pred, typename, obj) \
+#define ENSURE_TYPE(pred, typename, obj) \
(pred(obj) || (ERR_OBJ(typename " required but got", (obj)), 1))
-/* FIXME: Rename to ENSURE_INT() and so on */
-#define ASSERT_INTP(obj) ASSERT_TYPE(INTP, "integer", (obj))
-#define ASSERT_CONSP(obj) ASSERT_TYPE(CONSP, "pair", (obj))
-#define ASSERT_SYMBOLP(obj) ASSERT_TYPE(SYMBOLP, "symbol", (obj))
-#define ASSERT_CHARP(obj) ASSERT_TYPE(CHARP, "character", (obj))
-#define ASSERT_STRINGP(obj) ASSERT_TYPE(STRINGP, "string", (obj))
-#define ASSERT_FUNCP(obj) ASSERT_TYPE(FUNCP, "function", (obj))
-#define ASSERT_CLOSUREP(obj) ASSERT_TYPE(CLOSUREP, "closure", (obj))
-#define ASSERT_VECTORP(obj) ASSERT_TYPE(VECTORP, "vector", (obj))
-#define ASSERT_PORTP(obj) ASSERT_TYPE(PORTP, "port", (obj))
-#define ASSERT_CONTINUATIONP(obj) ASSERT_TYPE(CONTINUATIONP, "continuation", (obj))
-#define ASSERT_PROCEDUREP(obj) ASSERT_TYPE(PROCEDUREP, "procedure", (obj))
-#define ASSERT_ENVP(obj) ASSERT_TYPE(ENVP, "environment specifier", (obj))
-#define ASSERT_ERROBJP(obj) ASSERT_TYPE(ERROBJP, "error object", (obj))
-#define ASSERT_LISTP(obj) ASSERT_TYPE(LISTP, "list", (obj))
+#define ENSURE_INT(obj) ENSURE_TYPE(INTP, "integer", (obj))
+#define ENSURE_CONS(obj) ENSURE_TYPE(CONSP, "pair", (obj))
+#define ENSURE_SYMBOL(obj) ENSURE_TYPE(SYMBOLP, "symbol", (obj))
+#define ENSURE_CHAR(obj) ENSURE_TYPE(CHARP, "character", (obj))
+#define ENSURE_STRING(obj) ENSURE_TYPE(STRINGP, "string", (obj))
+#define ENSURE_FUNC(obj) ENSURE_TYPE(FUNCP, "function", (obj))
+#define ENSURE_CLOSURE(obj) ENSURE_TYPE(CLOSUREP, "closure", (obj))
+#define ENSURE_VECTOR(obj) ENSURE_TYPE(VECTORP, "vector", (obj))
+#define ENSURE_PORT(obj) ENSURE_TYPE(PORTP, "port", (obj))
+#define ENSURE_CONTINUATION(obj) ENSURE_TYPE(CONTINUATIONP, "continuation", (obj))
+#define ENSURE_PROCEDURE(obj) ENSURE_TYPE(PROCEDUREP, "procedure", (obj))
+#define ENSURE_ENV(obj) ENSURE_TYPE(ENVP, "environment specifier", (obj))
+#define ENSURE_ERROBJ(obj) ENSURE_TYPE(ERROBJP, "error object", (obj))
+#define ENSURE_LIST(obj) ENSURE_TYPE(LISTP, "list", (obj))
-/* FIXME: Rename to ENSURE_MUTABLE() */
-#define ASSERT_MUTABLEP(str) \
+#define ENSURE_MUTABLE(str) \
(SCM_STRING_MUTABLEP(str) \
|| (ERR_OBJ("attempted to modify immutable string", str), 1))
More information about the uim-commit
mailing list