[uim-commit] r2792 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Wed Jan 4 17:11:02 PST 2006
Author: yamaken
Date: 2006-01-04 17:10:59 -0800 (Wed, 04 Jan 2006)
New Revision: 2792
Modified:
branches/r5rs/sigscheme/TODO
branches/r5rs/sigscheme/sigscheme.h
branches/r5rs/sigscheme/sigschemeinternal.h
Log:
* sigscheme/sigscheme.h
* sigscheme/sigschemeinternal.h
- Cosmetic change
* sigscheme/TODO
- Update
Modified: branches/r5rs/sigscheme/TODO
===================================================================
--- branches/r5rs/sigscheme/TODO 2006-01-05 00:37:32 UTC (rev 2791)
+++ branches/r5rs/sigscheme/TODO 2006-01-05 01:10:59 UTC (rev 2792)
@@ -12,9 +12,8 @@
* Fix all destructive expression on macros
* Review and refactor all functions in syntax.c(listran, vectran,
- qquote_internal, scm_s_quasiquote, scm_s_do), sigschemeinternal.h and
- storage-fatty.h (other files had already been done except for the destructive
- exp on macros)
+ qquote_internal, scm_s_quasiquote, scm_s_do) and storage-fatty.h (other files
+ had already been done except for the destructive exp on macros)
* Investigate behavior of other Scheme implementations about constant vector
and list
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2006-01-05 00:37:32 UTC (rev 2791)
+++ branches/r5rs/sigscheme/sigscheme.h 2006-01-05 01:10:59 UTC (rev 2792)
@@ -131,15 +131,15 @@
#define SCM_CDAR(kons) (SCM_CDR(SCM_CAR(kons)))
#define SCM_CDDR(kons) (SCM_CDR(SCM_CDR(kons)))
-#define SCM_LIST_1(elm0) \
+#define SCM_LIST_1(elm0) \
(SCM_CONS((elm0), SCM_NULL))
-#define SCM_LIST_2(elm0, elm1) \
+#define SCM_LIST_2(elm0, elm1) \
(SCM_CONS((elm0), SCM_LIST_1(elm1)))
-#define SCM_LIST_3(elm0, elm1, elm2) \
+#define SCM_LIST_3(elm0, elm1, elm2) \
(SCM_CONS((elm0), SCM_LIST_2((elm1), (elm2))))
-#define SCM_LIST_4(elm0, elm1, elm2, elm3) \
+#define SCM_LIST_4(elm0, elm1, elm2, elm3) \
(SCM_CONS((elm0), SCM_LIST_3((elm1), (elm2), (elm3))))
-#define SCM_LIST_5(elm0, elm1, elm2, elm3, elm4) \
+#define SCM_LIST_5(elm0, elm1, elm2, elm3, elm4) \
(SCM_CONS((elm0), SCM_LIST_4((elm1), (elm2), (elm3), (elm4))))
#define SCM_LISTP(obj) (SCM_CONSP(obj) || SCM_NULLP(obj))
@@ -174,7 +174,7 @@
ret_type (*volatile fp)() = (ret_type (*)())&func; \
ScmObj *stack_start; \
\
- if (scm_false) exp_ret func args; /* compile-time type check */ \
+ if (0) exp_ret func args; /* compile-time type check */ \
stack_start = scm_gc_protect_stack(NULL); \
exp_ret (*fp)args; \
scm_gc_unprotect_stack(stack_start); \
@@ -275,27 +275,32 @@
*/
enum ScmFuncTypeCode {
SCM_FUNCTYPE_MAND_BITS = 4,
- SCM_FUNCTYPE_MAND_MASK = (1 << SCM_FUNCTYPE_MAND_BITS)-1,
+ SCM_FUNCTYPE_MAND_MASK = (1 << SCM_FUNCTYPE_MAND_BITS) - 1,
#define SCM_FUNCTYPE_MAND_MAX 5
/* SCM_FUNCTYPE_MAND_MAX = 5, */
SCM_FUNCTYPE_SYNTAX = 1 << SCM_FUNCTYPE_MAND_BITS,
- SCM_FUNCTYPE_FIXED = 0 << (SCM_FUNCTYPE_MAND_BITS+1),
- SCM_FUNCTYPE_VARIADIC = 1 << (SCM_FUNCTYPE_MAND_BITS+1),
- SCM_FUNCTYPE_TAIL_REC = 1 << (SCM_FUNCTYPE_MAND_BITS+2),
+ SCM_FUNCTYPE_FIXED = 0 << (SCM_FUNCTYPE_MAND_BITS + 1),
+ SCM_FUNCTYPE_VARIADIC = 1 << (SCM_FUNCTYPE_MAND_BITS + 1),
+ SCM_FUNCTYPE_TAIL_REC = 1 << (SCM_FUNCTYPE_MAND_BITS + 2),
- SCM_FUNCTYPE_ODDBALL = 1 << (SCM_FUNCTYPE_MAND_BITS+10),
+ SCM_FUNCTYPE_ODDBALL = 1 << (SCM_FUNCTYPE_MAND_BITS + 10),
/* Compound types. */
- SCM_PROCEDURE_FIXED = SCM_FUNCTYPE_FIXED,
- SCM_PROCEDURE_FIXED_TAIL_REC = SCM_FUNCTYPE_TAIL_REC,
- SCM_PROCEDURE_VARIADIC = SCM_FUNCTYPE_VARIADIC,
- SCM_PROCEDURE_VARIADIC_TAIL_REC = SCM_FUNCTYPE_VARIADIC | SCM_FUNCTYPE_TAIL_REC,
+ SCM_PROCEDURE_FIXED = SCM_FUNCTYPE_FIXED,
+ SCM_PROCEDURE_FIXED_TAIL_REC = SCM_FUNCTYPE_TAIL_REC,
+ SCM_PROCEDURE_VARIADIC = SCM_FUNCTYPE_VARIADIC,
+ SCM_PROCEDURE_VARIADIC_TAIL_REC = (SCM_FUNCTYPE_VARIADIC
+ | SCM_FUNCTYPE_TAIL_REC),
- SCM_SYNTAX_FIXED = SCM_PROCEDURE_FIXED | SCM_FUNCTYPE_SYNTAX,
- SCM_SYNTAX_FIXED_TAIL_REC = SCM_PROCEDURE_FIXED_TAIL_REC | SCM_FUNCTYPE_SYNTAX,
- SCM_SYNTAX_VARIADIC = SCM_PROCEDURE_VARIADIC | SCM_FUNCTYPE_SYNTAX,
- SCM_SYNTAX_VARIADIC_TAIL_REC = SCM_PROCEDURE_VARIADIC_TAIL_REC | SCM_FUNCTYPE_SYNTAX,
+ SCM_SYNTAX_FIXED = (SCM_FUNCTYPE_SYNTAX
+ | SCM_PROCEDURE_FIXED),
+ SCM_SYNTAX_FIXED_TAIL_REC = (SCM_FUNCTYPE_SYNTAX
+ | SCM_PROCEDURE_FIXED_TAIL_REC),
+ SCM_SYNTAX_VARIADIC = (SCM_FUNCTYPE_SYNTAX
+ | SCM_PROCEDURE_VARIADIC),
+ SCM_SYNTAX_VARIADIC_TAIL_REC = (SCM_FUNCTYPE_SYNTAX
+ | SCM_PROCEDURE_VARIADIC_TAIL_REC),
/* Special type. */
SCM_REDUCTION_OPERATOR = SCM_FUNCTYPE_ODDBALL
@@ -303,16 +308,16 @@
/* Where we are in a reduction process. */
enum ScmReductionState {
- SCM_REDUCE_0, /* No argument was given. */
- SCM_REDUCE_1, /* Only 1 argument was given. */
- SCM_REDUCE_PARTWAY, /* We have more arguments pending. */
- SCM_REDUCE_LAST, /* The callee must finalize. */
- SCM_REDUCE_STOP /* Callee wants to stop. */
+ SCM_REDUCE_0, /* No argument was given. */
+ SCM_REDUCE_1, /* Only 1 argument was given. */
+ SCM_REDUCE_PARTWAY, /* We have more arguments pending. */
+ SCM_REDUCE_LAST, /* The callee must finalize. */
+ SCM_REDUCE_STOP /* Callee wants to stop. */
};
enum ScmReturnType {
- SCM_RETTYPE_AS_IS = 0,
- SCM_RETTYPE_NEED_EVAL = 1
+ SCM_RETTYPE_AS_IS = 0,
+ SCM_RETTYPE_NEED_EVAL = 1
};
enum ScmPortFlag {
@@ -533,10 +538,10 @@
#define SCM_UNDEF SCM_SAL_UNDEF
#define SCM_EQ(a, b) (SCM_SAL_EQ((a), (b)))
-#define SCM_NULLP(a) (SCM_EQ((a), SCM_NULL))
-#define SCM_FALSEP(a) (SCM_EQ((a), SCM_FALSE))
-#define SCM_NFALSEP(a) (!SCM_EQ((a), SCM_FALSE))
-#define SCM_EOFP(a) (SCM_EQ((a), SCM_EOF))
+#define SCM_NULLP(o) (SCM_EQ((o), SCM_NULL))
+#define SCM_FALSEP(o) (SCM_EQ((o), SCM_FALSE))
+#define SCM_NFALSEP(o) (!SCM_EQ((o), SCM_FALSE))
+#define SCM_EOFP(o) (SCM_EQ((o), SCM_EOF))
/*============================================================================
Predefined Symbols
@@ -745,7 +750,8 @@
/* eval.c */
ScmObj scm_call(ScmObj proc, ScmObj args);
ScmObj scm_p_eval(ScmObj obj, ScmObj env);
-ScmObj scm_p_apply(ScmObj proc, ScmObj arg0, ScmObj rest, ScmEvalState *eval_state);
+ScmObj scm_p_apply(ScmObj proc, ScmObj arg0, ScmObj rest,
+ ScmEvalState *eval_state);
ScmObj scm_p_scheme_report_environment(ScmObj version);
ScmObj scm_p_null_environment(ScmObj version);
ScmObj scm_p_interaction_environment(void);
@@ -753,7 +759,8 @@
/* syntax.c */
ScmObj scm_s_quote(ScmObj datum, ScmObj env);
ScmObj scm_s_lambda(ScmObj formals, ScmObj body, ScmObj env);
-ScmObj scm_s_if(ScmObj test, ScmObj conseq, ScmObj rest, ScmEvalState *eval_state);
+ScmObj scm_s_if(ScmObj test, ScmObj conseq, ScmObj rest,
+ ScmEvalState *eval_state);
ScmObj scm_s_setd(ScmObj var, ScmObj val, ScmObj env);
ScmObj scm_s_cond(ScmObj args, ScmEvalState *eval_state);
ScmObj scm_s_case(ScmObj key, ScmObj args, ScmEvalState *eval_state);
@@ -763,7 +770,8 @@
ScmObj scm_s_letstar(ScmObj bindings, ScmObj body, ScmEvalState *eval_state);
ScmObj scm_s_letrec(ScmObj bindings, ScmObj body, ScmEvalState *eval_state);
ScmObj scm_s_begin(ScmObj args, ScmEvalState *eval_state);
-ScmObj scm_s_do(ScmObj bindings, ScmObj testframe, ScmObj commands, ScmEvalState *eval_state);
+ScmObj scm_s_do(ScmObj bindings, ScmObj testframe, ScmObj commands,
+ ScmEvalState *eval_state);
ScmObj scm_s_delay(ScmObj expr, ScmObj env);
ScmObj scm_s_quasiquote(ScmObj datum, ScmObj env);
ScmObj scm_s_unquote(ScmObj dummy, ScmObj env);
@@ -775,14 +783,17 @@
ScmObj scm_p_eqp(ScmObj obj1, ScmObj obj2);
ScmObj scm_p_equalp(ScmObj obj1, ScmObj obj2);
ScmObj scm_p_add(ScmObj left, ScmObj right, enum ScmReductionState *state);
-ScmObj scm_p_subtract(ScmObj left, ScmObj right, enum ScmReductionState *state);
-ScmObj scm_p_multiply(ScmObj left, ScmObj right, enum ScmReductionState *state);
+ScmObj scm_p_subtract(ScmObj left, ScmObj right,
+ enum ScmReductionState *state);
+ScmObj scm_p_multiply(ScmObj left, ScmObj right,
+ enum ScmReductionState *state);
ScmObj scm_p_divide(ScmObj left, ScmObj right, enum ScmReductionState *state);
ScmObj scm_p_equal(ScmObj left, ScmObj right, enum ScmReductionState *state);
ScmObj scm_p_less(ScmObj left, ScmObj right, enum ScmReductionState *state);
ScmObj scm_p_less_eq(ScmObj left, ScmObj right, enum ScmReductionState *state);
ScmObj scm_p_greater(ScmObj left, ScmObj right, enum ScmReductionState *state);
-ScmObj scm_p_greater_eq(ScmObj left, ScmObj right, enum ScmReductionState *state);
+ScmObj scm_p_greater_eq(ScmObj left, ScmObj right,
+ enum ScmReductionState *state);
ScmObj scm_p_numberp(ScmObj obj);
ScmObj scm_p_zerop(ScmObj n);
ScmObj scm_p_positivep(ScmObj n);
@@ -869,9 +880,11 @@
ScmObj scm_p_map(ScmObj proc, ScmObj args);
ScmObj scm_p_for_each(ScmObj proc, ScmObj args);
ScmObj scm_p_force(ScmObj closure);
-ScmObj scm_p_call_with_current_continuation(ScmObj proc, ScmEvalState *eval_state);
+ScmObj scm_p_call_with_current_continuation(ScmObj proc,
+ ScmEvalState *eval_state);
ScmObj scm_p_values(ScmObj args);
-ScmObj scm_p_call_with_values(ScmObj producer, ScmObj consumer, ScmEvalState *eval_state);
+ScmObj scm_p_call_with_values(ScmObj producer, ScmObj consumer,
+ ScmEvalState *eval_state);
ScmObj scm_p_dynamic_wind(ScmObj before, ScmObj thunk, ScmObj after);
/* operations-r5rs-deepcadrs.c */
@@ -916,7 +929,7 @@
/* io.c */
void scm_set_lib_path(const char *path);
ScmObj scm_make_shared_file_port(FILE *file, const char *aux_info,
- enum ScmPortFlag flag);
+ enum ScmPortFlag flag);
int scm_port_close(ScmObj port);
ScmCharCodec *scm_port_codec(ScmObj port);
char *scm_port_inspect(ScmObj port);
@@ -968,7 +981,8 @@
void scm_debug(const char *msg, ...);
scm_bool scm_die(const char *msg, const char *filename, int line);
void scm_error(const char *msg, ...) SCM_NORETURN;
-void scm_error_obj(const char *funcname, const char *msg, ScmObj obj) SCM_NORETURN;
+void scm_error_obj(const char *funcname, const char *msg,
+ ScmObj obj) SCM_NORETURN;
void scm_show_backtrace(ScmObj trace_stack);
ScmObj scm_make_error_obj(ScmObj reason, ScmObj objs);
void scm_raise_error(ScmObj err_obj) SCM_NORETURN;
@@ -1034,7 +1048,8 @@
#if SCM_USE_SRFI2
/* operations-srfi2.c */
void scm_initialize_srfi2(void);
-ScmObj scm_s_srfi2_and_letstar(ScmObj claws, ScmObj body, ScmEvalState *eval_state);
+ScmObj scm_s_srfi2_and_letstar(ScmObj claws, ScmObj body,
+ ScmEvalState *eval_state);
#endif
#if SCM_USE_SRFI6
/* operations-srfi6.c */
@@ -1046,7 +1061,8 @@
#if SCM_USE_SRFI8
/* operations-srfi8.c */
void scm_initialize_srfi8(void);
-ScmObj scm_s_srfi8_receive(ScmObj formals, ScmObj expr, ScmObj body, ScmEvalState *eval_state);
+ScmObj scm_s_srfi8_receive(ScmObj formals, ScmObj expr, ScmObj body,
+ ScmEvalState *eval_state);
#endif
#if SCM_USE_SRFI23
/* operations-srfi23.c */
@@ -1058,7 +1074,7 @@
void scm_initialize_srfi34(void);
ScmObj scm_p_srfi34_with_exception_handler(ScmObj handler, ScmObj thunk);
ScmObj scm_s_srfi34_guard(ScmObj cond_catch, ScmObj body,
- ScmEvalState *eval_state);
+ ScmEvalState *eval_state);
ScmObj scm_p_srfi34_raise(ScmObj obj);
#endif
#if SCM_USE_SRFI38
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2006-01-05 00:37:32 UTC (rev 2791)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2006-01-05 01:10:59 UTC (rev 2792)
@@ -112,8 +112,8 @@
SCM_SAL_VALUEPACKET_SET_VALUES((o), (vals))
#endif /* SCM_USE_VALUECONS */
-#define SCM_ENTYPE_FREECELL(o) SCM_SAL_ENTYPE_FREECELL(o)
-#define SCM_AS_FREECELL(o) SCM_SAL_AS_FREECELL(o)
+#define SCM_ENTYPE_FREECELL(o) SCM_SAL_ENTYPE_FREECELL(o)
+#define SCM_AS_FREECELL(o) SCM_SAL_AS_FREECELL(o)
#define SCM_FREECELLP(o) SCM_SAL_FREECELLP(o)
#define SCM_FREECELL_NEXT(o) SCM_SAL_FREECELL_NEXT(o)
@@ -246,10 +246,10 @@
* is ignored, but we may use it in the future to implement a stub
* generator. This macro can be invoked only at the beginning of a
* function body, right after local variable declarations. */
-#define DECLARE_FUNCTION(func_name, type) \
- const char *SCM_MANGLE(name); \
- ScmObj SCM_MANGLE(tmp); \
- SCM_MANGLE(name) = func_name; \
+#define DECLARE_FUNCTION(func_name, type) \
+ const char *SCM_MANGLE(name); \
+ ScmObj SCM_MANGLE(tmp); \
+ SCM_MANGLE(name) = func_name; \
SCM_MANGLE(tmp) = SCM_INVALID /* No semicolon here. */
/* DECLARE_FUNCTION without the functype.
@@ -291,16 +291,16 @@
/* Destructively retreives the first element of an argument list. If
* ARGS doesn't contain enough arguments, return SCM_INVALID. */
-#define POP_ARG(args) \
- (CONSP(args) \
- ? (SCM_MANGLE(tmp) = CAR(args), (args) = CDR(args), SCM_MANGLE(tmp)) \
+#define POP_ARG(args) \
+ (CONSP(args) \
+ ? (SCM_MANGLE(tmp) = CAR(args), (args) = CDR(args), SCM_MANGLE(tmp)) \
: SCM_INVALID)
/* Like POP_ARG(), but signals an error if no argument is
available. */
-#define MUST_POP_ARG(args) \
- (CONSP(args) \
- ? (SCM_MANGLE(tmp) = CAR(args), (args) = CDR(args), SCM_MANGLE(tmp)) \
+#define MUST_POP_ARG(args) \
+ (CONSP(args) \
+ ? (SCM_MANGLE(tmp) = CAR(args), (args) = CDR(args), SCM_MANGLE(tmp)) \
: (ERR("missing argument(s)"), NULL))
#define ENSURE_TYPE(pred, typename, obj) \
@@ -361,13 +361,13 @@
#define SCM_QUEUE_INVALIDATE(_q) ((_q) = NULL)
#define SCM_QUEUE_VALIDP(_q) (_q)
#define SCM_QUEUE_POINT_TO(_q, _out) ((_q) = SCM_REF_OFF_HEAP(_out))
-#define SCM_QUEUE_ADD(_q, _dat) (SET((_q), LIST_1(_dat)), \
+#define SCM_QUEUE_ADD(_q, _dat) (SET((_q), LIST_1(_dat)), \
(_q) = REF_CDR(DEREF(_q)))
-#define SCM_QUEUE_APPEND(_q, _lst) \
- do { \
- SET((_q), (_lst)); \
- while (CONSP(DEREF(_q))) \
- (_q) = REF_CDR(DEREF(_q)); \
+#define SCM_QUEUE_APPEND(_q, _lst) \
+ do { \
+ SET((_q), (_lst)); \
+ while (CONSP(DEREF(_q))) \
+ (_q) = REF_CDR(DEREF(_q)); \
} while (/* CONSTCOND */ 0)
#define SCM_QUEUE_TERMINATOR(_q) (DEREF(_q))
#define SCM_QUEUE_SLOPPY_APPEND(_q, _lst) (SET((_q), (_lst)))
@@ -450,29 +450,30 @@
=======================================*/
/* storage.c */
void scm_init_storage(size_t heap_size, size_t heap_alloc_threshold,
- int n_heaps_max, int n_heaps_init);
+ int n_heaps_max, int n_heaps_init);
void scm_finalize_storage(void);
/* storage-gc.c */
-void scm_init_gc(size_t heap_size, size_t heap_alloc_threshold,
- int n_heaps_max, int n_heaps_init);
-void scm_finalize_gc(void);
+void scm_init_gc(size_t heap_size, size_t heap_alloc_threshold,
+ int n_heaps_max, int n_heaps_init);
+void scm_finalize_gc(void);
ScmObj scm_alloc_cell(void);
/* storage-continuation.c */
-void scm_init_continuation(void);
-void scm_finalize_continuation(void);
-void scm_destruct_continuation(ScmObj cont);
-ScmObj scm_call_with_current_continuation(ScmObj proc, ScmEvalState *eval_state);
-void scm_call_continuation(ScmObj cont, ScmObj ret);
+void scm_init_continuation(void);
+void scm_finalize_continuation(void);
+void scm_destruct_continuation(ScmObj cont);
+ScmObj scm_call_with_current_continuation(ScmObj proc,
+ ScmEvalState *eval_state);
+void scm_call_continuation(ScmObj cont, ScmObj ret);
ScmObj scm_dynamic_wind(ScmObj before, ScmObj thunk, ScmObj after);
void scm_push_trace_frame(ScmObj obj, ScmObj env);
void scm_pop_trace_frame(void);
ScmObj scm_trace_stack(void);
/* storage-symbol.c */
-void scm_init_symbol(void);
-void scm_finalize_symbol(void);
+void scm_init_symbol(void);
+void scm_finalize_symbol(void);
/* env.c */
ScmObj scm_extend_environment(ScmObj vars, ScmObj vals, ScmObj env);
@@ -485,13 +486,15 @@
ScmObj scm_eval(ScmObj obj, ScmObj env);
/* syntax.c */
-ScmObj scm_s_cond_internal(ScmObj args, ScmObj case_key, ScmEvalState *eval_state);
+ScmObj scm_s_cond_internal(ScmObj args, ScmObj case_key,
+ ScmEvalState *eval_state);
/* error.c */
void scm_init_error(void);
void scm_throw_exception(ScmObj errorobj) SCM_NORETURN;
void scm_show_error_header(void);
-void scm_error_obj(const char *func_name, const char *msg, ScmObj obj) SCM_NORETURN;
+void scm_error_obj(const char *func_name, const char *msg,
+ ScmObj obj) SCM_NORETURN;
/* operations.c */
int scm_length(ScmObj lst);
More information about the uim-commit
mailing list