[uim-commit] r2582 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Wed Dec 14 12:27:16 PST 2005
Author: yamaken
Date: 2005-12-14 12:27:12 -0800 (Wed, 14 Dec 2005)
New Revision: 2582
Modified:
branches/r5rs/sigscheme/sigscheme.h
branches/r5rs/sigscheme/sigschemeinternal.h
branches/r5rs/sigscheme/sigschemetype-compact.h
branches/r5rs/sigscheme/sigschemetype.h
Log:
* sigscheme/sigschemetype.h
- (SCM_MAKE_BOOL, SCM_MAKE_INT, SCM_MAKE_CONS, SCM_MAKE_SYMBOL,
SCM_MAKE_CHAR, SCM_MAKE_STRING, SCM_MAKE_STRING_COPYING,
SCM_MAKE_IMMUTABLE_STRING, SCM_MAKE_IMMUTABLE_STRING_COPYING,
SCM_MAKE_FUNC, SCM_MAKE_CLOSURE, SCM_MAKE_VECTOR, SCM_MAKE_PORT,
SCM_MAKE_CONTINUATION, SCM_MAKE_C_POINTER,
SCM_MAKE_C_FUNCPOINTER): New macro
* sigscheme/sigschemetype-compact.h
- (SCM_MAKE_BOOL, SCM_MAKE_INT, SCM_MAKE_CONS, SCM_MAKE_SYMBOL,
SCM_MAKE_CHAR, SCM_MAKE_STRING, SCM_MAKE_STRING_COPYING,
SCM_MAKE_IMMUTABLE_STRING, SCM_MAKE_IMMUTABLE_STRING_COPYING,
SCM_MAKE_FUNC, SCM_MAKE_CLOSURE, SCM_MAKE_VECTOR, SCM_MAKE_PORT,
SCM_MAKE_CONTINUATION, SCM_MAKE_C_POINTER,
SCM_MAKE_C_FUNCPOINTER): New macro
- (SCM_MAKE_VALUEPACKET): Simplify
* sigscheme/sigschemeinternal.h
- (MAKE_BOOL, MAKE_INT, MAKE_CONS, MAKE_SYMBOL, MAKE_CHAR,
MAKE_STRING, MAKE_STRING_COPYING, MAKE_IMMUTABLE_STRING,
MAKE_IMMUTABLE_STRING_COPYING, MAKE_FUNC, MAKE_CLOSURE,
MAKE_VECTOR, MAKE_PORT, MAKE_CONTINUATION, MAKE_C_POINTER,
MAKE_C_FUNCPOINTER, MAKE_VALUEPACKET): New macro
* sigscheme/sigscheme.h
- Add comments for Scm_New*()
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-12-14 19:40:28 UTC (rev 2581)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-12-14 20:27:12 UTC (rev 2582)
@@ -396,6 +396,9 @@
void *scm_realloc(void *ptr, size_t size);
/* storage.c */
+/* Don't use these functions directly. Use SCM_MAKE_*() or MAKE_*() instead to
+ * allow flexible object allocation. */
+/* FIXME: rename to scm_make_*() */
ScmObj Scm_NewCons(ScmObj a, ScmObj b);
ScmObj Scm_NewInt(int val);
ScmObj Scm_NewSymbol(char *name, ScmObj v_cell);
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2005-12-14 19:40:28 UTC (rev 2581)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2005-12-14 20:27:12 UTC (rev 2582)
@@ -149,6 +149,26 @@
#define EVAL SCM_EVAL
+#define MAKE_BOOL SCM_MAKE_BOOL
+#define MAKE_INT SCM_MAKE_INT
+#define MAKE_CONS SCM_MAKE_CONS
+#define MAKE_SYMBOL SCM_MAKE_SYMBOL
+#define MAKE_CHAR SCM_MAKE_CHAR
+#define MAKE_STRING SCM_MAKE_STRING
+#define MAKE_STRING_COPYING SCM_MAKE_STRING_COPYING
+#define MAKE_IMMUTABLE_STRING SCM_MAKE_IMMUTABLE_STRING
+#define MAKE_IMMUTABLE_STRING_COPYING SCM_MAKE_IMMUTABLE_STRING_COPYING
+#define MAKE_FUNC SCM_MAKE_FUNC
+#define MAKE_CLOSURE SCM_MAKE_CLOSURE
+#define MAKE_VECTOR SCM_MAKE_VECTOR
+#define MAKE_PORT SCM_MAKE_PORT
+#define MAKE_CONTINUATION SCM_MAKE_CONTINUATION
+#if SCM_USE_NONSTD_FEATURES
+#define MAKE_C_POINTER SCM_MAKE_C_POINTER
+#define MAKE_C_FUNCPOINTER SCM_MAKE_C_FUNCPOINTER
+#endif /* SCM_USE_NONSTD_FEATURES */
+#define MAKE_VALUEPACKET SCM_MAKE_VALUEPACKET
+
#define INTP SCM_INTP
#define CONSP SCM_CONSP
#define SYMBOLP SCM_SYMBOLP
Modified: branches/r5rs/sigscheme/sigschemetype-compact.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype-compact.h 2005-12-14 19:40:28 UTC (rev 2581)
+++ branches/r5rs/sigscheme/sigschemetype-compact.h 2005-12-14 20:27:12 UTC (rev 2582)
@@ -231,6 +231,29 @@
SCM_STR_MUTABLE = 1
};
+/*============================================================================
+ Object Creators
+============================================================================*/
+#define SCM_MAKE_BOOL(x) ((x) ? SCM_TRUE : SCM_FALSE)
+#define SCM_MAKE_INT Scm_NewInt
+#define SCM_MAKE_CONS Scm_NewCons
+#define SCM_MAKE_SYMBOL Scm_NewSymbol
+#define SCM_MAKE_CHAR Scm_NewChar
+#define SCM_MAKE_STRING Scm_NewMutableString
+#define SCM_MAKE_STRING_COPYING Scm_NewMutableStringCopying
+#define SCM_MAKE_IMMUTABLE_STRING Scm_NewImmutableString
+#define SCM_MAKE_IMMUTABLE_STRING_COPYING Scm_NewImmutableStringCopying
+#define SCM_MAKE_FUNC Scm_NewFunc
+#define SCM_MAKE_CLOSURE Scm_NewClosure
+#define SCM_MAKE_VECTOR Scm_NewVector
+#define SCM_MAKE_PORT Scm_NewPort
+#define SCM_MAKE_CONTINUATION Scm_NewContinuation
+#if SCM_USE_NONSTD_FEATURES
+#define SCM_MAKE_C_POINTER Scm_NewCPointer
+#define SCM_MAKE_C_FUNCPOINTER Scm_NewCFuncPointer
+#endif /* SCM_USE_NONSTD_FEATURES */
+#define SCM_MAKE_VALUEPACKET Scm_NewValuePacket
+
/*=======================================
Masks Offsets, and Tags
=======================================*/
@@ -566,7 +589,6 @@
/*============================================================================
Real Accessors : ValuePacket
============================================================================*/
-#define SCM_MAKE_VALUEPACKET(vals) (Scm_NewValuePacket(vals))
#define SCM_VALUEPACKET_VALUES(a) (SCM_CAR_GET_VALUE_AS_OBJ(SCM_AS_VALUEPACKET(a)))
#define SCM_VALUEPACKET_SET_VALUES(a, v) (SCM_CAR_SET_VALUE_AS_OBJ(SCM_AS_VALUEPACKET(a), (v)))
Modified: branches/r5rs/sigscheme/sigschemetype.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype.h 2005-12-14 19:40:28 UTC (rev 2581)
+++ branches/r5rs/sigscheme/sigschemetype.h 2005-12-14 20:27:12 UTC (rev 2582)
@@ -231,6 +231,34 @@
};
/*=======================================
+ Object Creators
+=======================================*/
+#define SCM_MAKE_BOOL(x) ((x) ? SCM_TRUE : SCM_FALSE)
+#define SCM_MAKE_INT Scm_NewInt
+#define SCM_MAKE_CONS Scm_NewCons
+#define SCM_MAKE_SYMBOL Scm_NewSymbol
+#define SCM_MAKE_CHAR Scm_NewChar
+#define SCM_MAKE_STRING Scm_NewMutableString
+#define SCM_MAKE_STRING_COPYING Scm_NewMutableStringCopying
+#define SCM_MAKE_IMMUTABLE_STRING Scm_NewImmutableString
+#define SCM_MAKE_IMMUTABLE_STRING_COPYING Scm_NewImmutableStringCopying
+#define SCM_MAKE_FUNC Scm_NewFunc
+#define SCM_MAKE_CLOSURE Scm_NewClosure
+#define SCM_MAKE_VECTOR Scm_NewVector
+#define SCM_MAKE_PORT Scm_NewPort
+#define SCM_MAKE_CONTINUATION Scm_NewContinuation
+#if SCM_USE_NONSTD_FEATURES
+#define SCM_MAKE_C_POINTER Scm_NewCPointer
+#define SCM_MAKE_C_FUNCPOINTER Scm_NewCFuncPointer
+#endif /* SCM_USE_NONSTD_FEATURES */
+#if SCM_USE_VALUECONS
+#define SCM_MAKE_VALUEPACKET(vals) (NULLP(vals) ? SigScm_null_values : \
+ (SCM_ENTYPE_VALUEPACKET(vals), (vals)))
+#else /* SCM_USE_VALUECONS */
+#define SCM_MAKE_VALUEPACKET(vals) (Scm_NewValuePacket(vals))
+#endif /* SCM_USE_VALUECONS */
+
+/*=======================================
Accessors For Scheme Objects
=======================================*/
/* ScmObj Global Attribute */
@@ -364,8 +392,6 @@
#define SCM_VALUEPACKETP(a) (SCM_TYPE(a) == ScmValuePacket)
#define SCM_NULLVALUESP(a) (EQ((a), SigScm_null_values))
#define SCM_ENTYPE_VALUEPACKET(a) (SCM_ENTYPE((a), ScmValuePacket))
-#define SCM_MAKE_VALUEPACKET(vals) (NULLP(vals) ? SigScm_null_values : \
- (SCM_ENTYPE_VALUEPACKET(vals), (vals)))
#define SCM_VALUEPACKET_VALUES(a) ((SCM_NULLVALUESP(a)) ? SCM_NULL : \
(SCM_ENTYPE_CONS(a), (a)))
#define SCM_VALUECONS_CAR(a) (SCM_AS_VALUEPACKET(a)->obj.cons.car)
@@ -373,7 +399,6 @@
#else /* SCM_USE_VALUECONS */
#define SCM_VALUEPACKETP(a) (SCM_TYPE(a) == ScmValuePacket)
#define SCM_ENTYPE_VALUEPACKET(a) (SCM_ENTYPE((a), ScmValuePacket))
-#define SCM_MAKE_VALUEPACKET(vals) (Scm_NewValuePacket(vals))
#define SCM_VALUEPACKET_VALUES(a) (SCM_AS_VALUEPACKET(a)->obj.value_pack.values)
#define SCM_VALUEPACKET_SET_VALUES(a, v) (SCM_VALUEPACKET_VALUES(a) = (v))
#endif /* SCM_USE_VALUECONS */
More information about the uim-commit
mailing list