[uim-commit] r1334 - branches/r5rs/sigscheme

kzk at freedesktop.org kzk at freedesktop.org
Fri Aug 26 05:11:16 PDT 2005


Author: kzk
Date: 2005-08-26 05:11:13 -0700 (Fri, 26 Aug 2005)
New Revision: 1334

Modified:
   branches/r5rs/sigscheme/sigschemetype.h
Log:
* Renaming of type macros

* sigscheme/sigschemetype.h
  - (SCM_AS_INT): rename from SCM_INT
  - (SCM_AS_CONS): rename from SCM_CONS
  - (SCM_AS_SYMBOL): rename from SCM_SYMBOL
  - (SCM_AS_CHAR): rename from SCM_CHAR
  - (SCM_AS_STRING): rename from SCM_STRING
  - (SCM_AS_FUNC): rename from SCM_FUNC
  - (SCM_AS_CLOSURE): rename from SCM_CLOSURE
  - (SCM_AS_VECTOR): rename from SCM_VECTOR
  - (SCM_AS_PORT): rename from SCM_PORT
  - (SCM_AS_CONTINUATION): rename from SCM_CONTINUATION
  - (SCM_AS_VALUEPACKET): rename from SCM_VALUEPACKET
  - (SCM_AS_ETC): rename from SCM_ETC
  - (SCM_AS_C_POINTER): rename from SCM_C_POINTER
  - (SCM_AS_C_FUNC_POINTER): rename from SCM_C_FUNC_POINTER



Modified: branches/r5rs/sigscheme/sigschemetype.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype.h	2005-08-26 11:56:08 UTC (rev 1333)
+++ branches/r5rs/sigscheme/sigschemetype.h	2005-08-26 12:11:13 UTC (rev 1334)
@@ -245,17 +245,17 @@
 #define SCM_MARK(a) ((a)->gcmark)
 
 #define SCM_INTP(a)  (SCM_TYPE(a) == ScmInt)
-#define SCM_INT(a)   (sigassert(SCM_INTP(a)), (a))
+#define SCM_AS_INT(a)   (sigassert(SCM_INTP(a)), (a))
 #define SCM_ENTYPE_INT(a)    (SCM_ENTYPE((a), ScmInt))
-#define SCM_INT_VALUE(a) (SCM_INT(a)->obj.int_value.value)
+#define SCM_INT_VALUE(a) (SCM_AS_INT(a)->obj.int_value.value)
 #define SCM_INT_SET_VALUE(a, val) (SCM_INT_VALUE(a) = (val))
 
 #define SCM_CONSP(a) (SCM_TYPE(a) == ScmCons)
-#define SCM_CONS(a)  (sigassert(SCM_CONSP(a)), (a))
+#define SCM_AS_CONS(a)  (sigassert(SCM_CONSP(a)), (a))
 #define SCM_ENTYPE_CONS(a) (SCM_ENTYPE((a), ScmCons))
-#define SCM_CAR(a)   (SCM_CONS(a)->obj.cons.car)
+#define SCM_CAR(a)   (SCM_AS_CONS(a)->obj.cons.car)
 #define SCM_CONS_SET_CAR(a,car)   (SCM_CAR(a) = car)
-#define SCM_CDR(a)   (SCM_CONS(a)->obj.cons.cdr)
+#define SCM_CDR(a)   (SCM_AS_CONS(a)->obj.cons.cdr)
 #define SCM_CONS_SET_CDR(a,cdr)   (SCM_CDR(a) = cdr)
 #define SCM_CAAR(a)  (SCM_CAR(SCM_CAR(a)))
 #define SCM_CADR(a)  (SCM_CAR(SCM_CDR(a)))
@@ -263,33 +263,33 @@
 #define SCM_CDDR(a)  (SCM_CDR(SCM_CDR(a)))
 
 #define SCM_SYMBOLP(a)      (SCM_TYPE(a) == ScmSymbol)
-#define SCM_SYMBOL(a)       (sigassert(SCM_SYMBOLP(a)), (a))
+#define SCM_AS_SYMBOL(a)       (sigassert(SCM_SYMBOLP(a)), (a))
 #define SCM_ENTYPE_SYMBOL(a)    (SCM_ENTYPE((a), ScmSymbol))
-#define SCM_SYMBOL_NAME(a)  (SCM_SYMBOL(a)->obj.symbol.sym_name)
+#define SCM_SYMBOL_NAME(a)  (SCM_AS_SYMBOL(a)->obj.symbol.sym_name)
 #define SCM_SYMBOL_SET_NAME(a, name)   (SCM_SYMBOL_NAME(a) = (name))
-#define SCM_SYMBOL_VCELL(a) (SCM_SYMBOL(a)->obj.symbol.v_cell)
+#define SCM_SYMBOL_VCELL(a) (SCM_AS_SYMBOL(a)->obj.symbol.v_cell)
 #define SCM_SYMBOL_SET_VCELL(a, vcell) (SCM_SYMBOL_VCELL(a) = (vcell))
 
 #define SCM_CHARP(a) (SCM_TYPE(a) == ScmChar)
-#define SCM_CHAR(a)  (sigassert(SCM_CHARP(a)), (a))
+#define SCM_AS_CHAR(a)  (sigassert(SCM_CHARP(a)), (a))
 #define SCM_ENTYPE_CHAR(a) (SCM_ENTYPE((a), ScmChar))
-#define SCM_CHAR_VALUE(a) (SCM_CHAR(a)->obj.ch.ch)
+#define SCM_CHAR_VALUE(a) (SCM_AS_CHAR(a)->obj.ch.ch)
 #define SCM_CHAR_SET_VALUE(a, chr) (SCM_CHAR_VALUE(a) = (chr))
 
 #define SCM_STRINGP(a) (SCM_TYPE(a) == ScmString)
-#define SCM_STRING(a)  (sigassert(SCM_STRINGP(a)), (a))
+#define SCM_AS_STRING(a)  (sigassert(SCM_STRINGP(a)), (a))
 #define SCM_ENTYPE_STRING(a)  (SCM_ENTYPE((a), ScmString))
-#define SCM_STRING_STR(a) (SCM_STRING(a)->obj.string.str)
+#define SCM_STRING_STR(a) (SCM_AS_STRING(a)->obj.string.str)
 #define SCM_STRING_SET_STR(a, str) (SCM_STRING_STR(a) = (str))
-#define SCM_STRING_LEN(a) (SCM_STRING(a)->obj.string.len)
+#define SCM_STRING_LEN(a) (SCM_AS_STRING(a)->obj.string.len)
 #define SCM_STRING_SET_LEN(a, len) (SCM_STRING_LEN(a) = (len))
 
 #define SCM_FUNCP(a) (SCM_TYPE(a) == ScmFunc)
-#define SCM_FUNC(a) (sigassert(SCM_FUNCP(a)), (a))
+#define SCM_AS_FUNC(a) (sigassert(SCM_FUNCP(a)), (a))
 #define SCM_ENTYPE_FUNC(a)     (SCM_ENTYPE((a), ScmFunc))
-#define SCM_FUNC_NUMARG(a) (SCM_FUNC(a)->obj.func.num_arg)
+#define SCM_FUNC_NUMARG(a) (SCM_AS_FUNC(a)->obj.func.num_arg)
 #define SCM_FUNC_SET_NUMARG(a, numarg) (SCM_FUNC_NUMARG(a) = (numarg))
-#define SCM_FUNC_CFUNC(a)   (SCM_FUNC(a)->obj.func.subrs.subr0.func)
+#define SCM_FUNC_CFUNC(a)   (SCM_AS_FUNC(a)->obj.func.subrs.subr0.func)
 #define SCM_FUNC_SET_CFUNC(a, func)     (SCM_FUNC_CFUNC(a) = (ScmFuncType)(func))
 
 #define SCM_FUNC_EXEC_SUBR0(a)                               ((*(a)->obj.func.subrs.subr0.func) ())
@@ -303,19 +303,19 @@
 #define SCM_FUNC_EXEC_SUBR2N(a, arg1, arg2)                  ((*(a)->obj.func.subrs.subr2.func) ((arg1), (arg2)))
 
 #define SCM_CLOSUREP(a) (SCM_TYPE(a) == ScmClosure)
-#define SCM_CLOSURE(a)  (sigassert(SCM_CLOSUREP(a)), (a))
+#define SCM_AS_CLOSURE(a)  (sigassert(SCM_CLOSUREP(a)), (a))
 #define SCM_ENTYPE_CLOSURE(a) (SCM_ENTYPE((a), ScmClosure))
-#define SCM_CLOSURE_EXP(a) (SCM_CLOSURE(a)->obj.closure.exp)
+#define SCM_CLOSURE_EXP(a) (SCM_AS_CLOSURE(a)->obj.closure.exp)
 #define SCM_CLOSURE_SET_EXP(a, exp) (SCM_CLOSURE_EXP(a) = exp)
-#define SCM_CLOSURE_ENV(a) (SCM_CLOSURE(a)->obj.closure.env)
+#define SCM_CLOSURE_ENV(a) (SCM_AS_CLOSURE(a)->obj.closure.env)
 #define SCM_CLOSURE_SET_ENV(a, env) (SCM_CLOSURE_ENV(a) = env)
 
 #define SCM_VECTORP(a) (SCM_TYPE(a) == ScmVector)
-#define SCM_VECTOR(a)  (sigassert(SCM_VECTORP(a)), (a))
+#define SCM_AS_VECTOR(a)  (sigassert(SCM_VECTORP(a)), (a))
 #define SCM_ENTYPE_VECTOR(a) (SCM_ENTYPE((a), ScmVector))
-#define SCM_VECTOR_VEC(a) (SCM_VECTOR(a)->obj.vector.vec)
+#define SCM_VECTOR_VEC(a) (SCM_AS_VECTOR(a)->obj.vector.vec)
 #define SCM_VECTOR_SET_VEC(a, vec) (SCM_VECTOR_VEC(a) = (vec))
-#define SCM_VECTOR_LEN(a) (SCM_VECTOR(a)->obj.vector.len)
+#define SCM_VECTOR_LEN(a) (SCM_AS_VECTOR(a)->obj.vector.len)
 #define SCM_VECTOR_SET_LEN(a, len) (SCM_VECTOR_LEN(a) = (len))
 #define SCM_VECTOR_CREF(a, idx) (SCM_VECTOR_VEC(a)[idx])
 #define SCM_VECTOR_SET_CREF(a, idx, b) (SCM_VECTOR_CREF((a), (idx)) = (b))
@@ -324,11 +324,11 @@
 #define SCM_VECTOR_CHECK_IDX(a, idx) ()
 
 #define SCM_PORTP(a) (SCM_TYPE(a) == ScmPort)
-#define SCM_PORT(a)  (sigassert(SCM_PORTP(a)), (a))
+#define SCM_AS_PORT(a)  (sigassert(SCM_PORTP(a)), (a))
 #define SCM_ENTYPE_PORT(a) (SCM_ENTYPE((a), ScmPort))
-#define SCM_PORT_PORTDIRECTION(a) (SCM_PORT(a)->obj.port.port_direction)
+#define SCM_PORT_PORTDIRECTION(a) (SCM_AS_PORT(a)->obj.port.port_direction)
 #define SCM_PORT_SET_PORTDIRECTION(a, pdirection) (SCM_PORT_PORTDIRECTION(a) = pdirection)
-#define SCM_PORT_PORTINFO(a) (SCM_PORT(a)->obj.port.port_info)
+#define SCM_PORT_PORTINFO(a) (SCM_AS_PORT(a)->obj.port.port_info)
 #define SCM_PORT_SET_PORTINFO(a, pinfo) (SCM_PORT_PORTINFO(a) = (pinfo))
 #define SCM_PORTINFO_PORTTYPE(a) (SCM_PORT_PORTINFO(a)->port_type)
 #define SCM_PORTINFO_FILE(a) (SCM_PORT_PORTINFO(a)->info.file_port.file)
@@ -339,24 +339,24 @@
 #define SCM_PORTINFO_UNGOTTENCHAR(a) (SCM_PORT_PORTINFO(a)->ungottenchar)
 
 #define SCM_CONTINUATIONP(a) (SCM_TYPE(a) == ScmContinuation)
-#define SCM_CONTINUATION(a)  (sigassert(SCM_CONTINUATIONP(a)), (a))
+#define SCM_AS_CONTINUATION(a)  (sigassert(SCM_CONTINUATIONP(a)), (a))
 #define SCM_ENTYPE_CONTINUATION(a) (SCM_ENTYPE((a), ScmContinuation))
-#define SCM_CONTINUATION_CONTINFO(a) (SCM_CONTINUATION(a)->obj.continuation.cont_info)
-#define SCM_CONTINUATION_JMPENV(a) (SCM_CONTINUATION(a)->obj.continuation.cont_info->jmp_env)
+#define SCM_CONTINUATION_CONTINFO(a) (SCM_AS_CONTINUATION(a)->obj.continuation.cont_info)
+#define SCM_CONTINUATION_JMPENV(a) (SCM_AS_CONTINUATION(a)->obj.continuation.cont_info->jmp_env)
 #define SCM_CONTINUATION_SET_CONTINFO(a, cinfo) (SCM_CONTINUATION_CONTINFO(a) = (cinfo))
 
 #define SCM_VALUEPACKETP(a)          (SCM_TYPE(a) == ScmValuePacket)
-#define SCM_VALUEPACKET(a)           (sigassert(SCM_VALUEPACKETP(a)), (a))
+#define SCM_AS_VALUEPACKET(a)           (sigassert(SCM_VALUEPACKETP(a)), (a))
 #define SCM_ENTYPE_VALUEPACKET(a)        (SCM_ENTYPE((a), ScmValuePacket))
-#define SCM_VALUEPACKET_VALUES(a)    (SCM_VALUEPACKET(a)->obj.value_pack.values)
+#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))
 
 /*============================================================================
   Etcetra Variables (Special Constants like SCM_NULL)
 ============================================================================*/
 #define SCM_ETCP(a) (SCM_TYPE(a) == ScmEtc)
-#define SCM_ETC(a) (sigassert(SCM_ETCP(a)), (a))
-#define SCM_ETC_TYPE(a) (SCM_ETC(a)->obj.etc.type)
+#define SCM_AS_ETC(a) (sigassert(SCM_ETCP(a)), (a))
+#define SCM_ETC_TYPE(a) (SCM_AS_ETC(a)->obj.etc.type)
 #define SCM_SETETC_TYPE(a, etctype) (SCM_ETC_TYPE(a) = (etctype))
 #define SCM_NEW_ETC(a, impl, etctype)     \
     do {                                  \
@@ -369,15 +369,15 @@
   C Pointer Object
 ============================================================================*/
 #define SCM_C_POINTERP(a) (SCM_TYPE(a) == ScmCPointer)
-#define SCM_C_POINTER(a)  (sigassert(SCM_C_POINTERP(a)), (a))
+#define SCM_AS_C_POINTER(a)  (sigassert(SCM_C_POINTERP(a)), (a))
 #define SCM_ENTYPE_C_POINTER(a) (SCM_ENTYPE((a), ScmCPointer))
-#define SCM_C_POINTER_VALUE(a) (SCM_C_POINTER(a)->obj.c_pointer.data)
+#define SCM_C_POINTER_VALUE(a) (SCM_AS_C_POINTER(a)->obj.c_pointer.data)
 #define SCM_C_POINTER_SET_VALUE(a, ptr) (SCM_C_POINTER_VALUE(a) = ptr)
 
 #define SCM_C_FUNCPOINTERP(a) (SCM_TYPE(a) == ScmCFuncPointer)
-#define SCM_C_FUNCPOINTER(a)  (sigassert(SCM_C_FUNCPOINTERP(a)), (a))
+#define SCM_AS_C_FUNCPOINTER(a)  (sigassert(SCM_C_FUNCPOINTERP(a)), (a))
 #define SCM_ENTYPE_C_FUNCPOINTER(a) (SCM_ENTYPE((a), ScmCFuncPointer))
-#define SCM_C_FUNCPOINTER_VALUE(a) (SCM_C_FUNCPOINTER(a)->obj.c_func_pointer.func)
+#define SCM_C_FUNCPOINTER_VALUE(a) (SCM_AS_C_FUNCPOINTER(a)->obj.c_func_pointer.func)
 #define SCM_C_FUNCPOINTER_SET_VALUE(a, funcptr) (SCM_C_FUNCPOINTER_VALUE(a) = funcptr)
 
 /*============================================================================



More information about the uim-commit mailing list