[uim-commit] r1614 - branches/r5rs/sigscheme
kzk at freedesktop.org
kzk at freedesktop.org
Tue Sep 27 09:59:02 PDT 2005
Author: kzk
Date: 2005-09-27 09:58:59 -0700 (Tue, 27 Sep 2005)
New Revision: 1614
Modified:
branches/r5rs/sigscheme/TODO
branches/r5rs/sigscheme/datas.c
branches/r5rs/sigscheme/eval.c
branches/r5rs/sigscheme/operations.c
branches/r5rs/sigscheme/sigscheme.h
Log:
* sigscheme/operations.c
* sigscheme/datas.c
* sigscheme/sigscheme.h
- (Scm_Intern,
ScmOp_c_length,
ScmOp_reverse,
ScmOp_listtail_internal,
ScmOp_list_tail,
ScmOp_list_ref,
ScmOp_memq,
ScmOp_memv,
ScmOp_member,
ScmOp_assq,
ScmOp_assv,
ScmOp_assoc,
ScmOp_list2string,
ScmOp_list2vector): rename "list" to "lst"
* sigscheme/eval.c
- (qquote_internal): rename "list" to "lst"
* sigscheme/TODO
- update
Modified: branches/r5rs/sigscheme/TODO
===================================================================
--- branches/r5rs/sigscheme/TODO 2005-09-27 16:35:27 UTC (rev 1613)
+++ branches/r5rs/sigscheme/TODO 2005-09-27 16:58:59 UTC (rev 1614)
@@ -28,8 +28,6 @@
* [uim] link libsscm into libuim statically
-* Split the configuration macros such as SCM_USE_SRFI1 off into config.h
-
* Dynamic encoding switching for a conversion between string and char list,
based on a SRFI or de facto standard API
@@ -38,9 +36,6 @@
==============================================================================
Extensions:
-* SRFI-2 and-let* (significantly beneficial for uim codes, especially composer
- branch)
-
==============================================================================
Performance improvements:
@@ -82,8 +77,6 @@
* Rename STL names (string, list) to another such as str, lst
-* Split configuration macros such as SCM_COMPAT_SIOD off to config.h
-
* Grand renaming (prefix reorganization, consideration about func_name and
FuncName styles) ([Anthy-dev 2254], [Anthy-dev 2251])
Modified: branches/r5rs/sigscheme/datas.c
===================================================================
--- branches/r5rs/sigscheme/datas.c 2005-09-27 16:35:27 UTC (rev 1613)
+++ branches/r5rs/sigscheme/datas.c 2005-09-27 16:58:59 UTC (rev 1614)
@@ -866,25 +866,25 @@
ScmObj Scm_Intern(const char *name)
{
int n = symbol_name_hash(name);
- ScmObj sym = SCM_FALSE;
- ScmObj list = SCM_FALSE;
- ScmObj sym_list = symbol_hash[n];
+ ScmObj sym = SCM_FALSE;
+ ScmObj lst = SCM_FALSE;
+ ScmObj sym_lst = symbol_hash[n];
/* Search Symbol by name */
- for (list = sym_list; !NULLP(list); list = CDR(list)) {
- sym = CAR(list);
+ for (lst = sym_lst; !NULLP(lst); lst = CDR(lst)) {
+ sym = CAR(lst);
if (strcmp(SCM_SYMBOL_NAME(sym), name) == 0) {
return sym;
}
}
- /* If not in the sym_list, allocate new Symbol */
+ /* If not in the sym_lst, allocate new Symbol */
sym = Scm_NewSymbol(strdup(name), SCM_UNBOUND);
/* And Append it to the head of symbol_hash */
- sym_list = CONS(sym, sym_list);
- symbol_hash[n] = sym_list;
+ sym_lst = CONS(sym, sym_lst);
+ symbol_hash[n] = sym_lst;
return sym;
}
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2005-09-27 16:35:27 UTC (rev 1613)
+++ branches/r5rs/sigscheme/eval.c 2005-09-27 16:58:59 UTC (rev 1614)
@@ -595,16 +595,16 @@
ScmObj car = SCM_NULL;
ScmObj args = SCM_NULL;
ScmObj result = SCM_NULL;
- ScmObj ret_list = SCM_NULL;
+ ScmObj ret_lst = SCM_NULL;
ScmObj *ret_tail = NULL;
int splice_flag = 0;
/* local "functions" */
-#define qquote_copy_delayed() (QQUOTE_IS_VERBATIM(ret_list))
+#define qquote_copy_delayed() (QQUOTE_IS_VERBATIM(ret_lst))
#define qquote_force_copy_upto(end) \
do { \
ScmObj src = qexpr; \
- ret_tail = &ret_list; \
+ ret_tail = &ret_lst; \
while (!EQ(src, end)) { \
*ret_tail = CONS(CAR(src), SCM_NULL); \
ret_tail = &CDR(*ret_tail); \
@@ -613,7 +613,7 @@
} while (0)
- QQUOTE_SET_VERBATIM(ret_list); /* default return value */
+ QQUOTE_SET_VERBATIM(ret_lst); /* default return value */
if (CONSP(qexpr)) {
car = CAR(qexpr);
@@ -699,7 +699,7 @@
*ret_tail = result;
}
- return ret_list;
+ return ret_lst;
#undef qquote_is_spliced
#undef qquote_copy_delayed
#undef qquote_force_copy_upto
Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c 2005-09-27 16:35:27 UTC (rev 1613)
+++ branches/r5rs/sigscheme/operations.c 2005-09-27 16:58:59 UTC (rev 1614)
@@ -60,7 +60,7 @@
/*=======================================
File Local Function Declarations
=======================================*/
-static int ScmOp_c_length(ScmObj list);
+static int ScmOp_c_length(ScmObj lst);
static ScmObj ScmOp_listtail_internal(ScmObj obj, int k);
/*=======================================
@@ -843,23 +843,23 @@
*
* This function is ported from Gauche, by Shiro Kawai(shiro at acm.org)
*/
-static int ScmOp_c_length(ScmObj obj)
+static int ScmOp_c_length(ScmObj lst)
{
- ScmObj slow = obj;
+ ScmObj slow = lst;
int len = 0;
for (;;) {
- if (NULLP(obj)) break;
- if (!CONSP(obj)) return -1;
- if (len != 0 && obj == slow) return -1; /* circular */
+ if (NULLP(lst)) break;
+ if (!CONSP(lst)) return -1;
+ if (len != 0 && lst == slow) return -1; /* circular */
- obj = CDR(obj);
+ lst = CDR(lst);
len++;
- if (NULLP(obj)) break;
- if (!CONSP(obj)) return -1;
- if (obj == slow) return -1; /* circular */
+ if (NULLP(lst)) break;
+ if (!CONSP(lst)) return -1;
+ if (lst == slow) return -1; /* circular */
- obj = CDR(obj);
+ lst = CDR(lst);
slow = CDR(slow);
len++;
}
@@ -884,8 +884,8 @@
*/
ScmObj ScmOp_append(ScmObj args, ScmObj env)
{
- ScmObj ret_list = SCM_NULL;
- ScmObj *ret_tail = &ret_list;
+ ScmObj ret_lst = SCM_NULL;
+ ScmObj *ret_tail = &ret_lst;
ScmObj ls;
ScmObj obj = SCM_NULL;
@@ -908,111 +908,98 @@
/* append the last argument */
*ret_tail = CAR(args);
- return ret_list;
+ return ret_lst;
}
-ScmObj ScmOp_reverse(ScmObj list)
+ScmObj ScmOp_reverse(ScmObj lst)
{
- ScmObj ret_list = SCM_NULL;
+ ScmObj ret_lst = SCM_NULL;
- for (; CONSP(list); list = CDR(list))
- ret_list = CONS(CAR(list), ret_list);
+ for (; CONSP(lst); lst = CDR(lst))
+ ret_lst = CONS(CAR(lst), ret_lst);
- if (!NULLP(list))
- SigScm_ErrorObj("reverse: got improper list: ", list);
+ if (!NULLP(lst))
+ SigScm_ErrorObj("reverse: got improper list: ", lst);
- return ret_list;
+ return ret_lst;
}
-static ScmObj ScmOp_listtail_internal(ScmObj list, int k)
+static ScmObj ScmOp_listtail_internal(ScmObj lst, int k)
{
while (k--) {
- if (!CONSP(list))
+ if (!CONSP(lst))
return SCM_INVALID;
- list = CDR(list);
+ lst = CDR(lst);
}
- return list;
+ return lst;
}
-ScmObj ScmOp_list_tail(ScmObj list, ScmObj scm_k)
+ScmObj ScmOp_list_tail(ScmObj lst, ScmObj scm_k)
{
ScmObj ret;
if (FALSEP(ScmOp_numberp(scm_k)))
SigScm_ErrorObj("list-tail: number required but got ", scm_k);
- ret = ScmOp_listtail_internal(list, SCM_INT_VALUE(scm_k));
+ ret = ScmOp_listtail_internal(lst, SCM_INT_VALUE(scm_k));
if (EQ(ret, SCM_INVALID))
SigScm_ErrorObj("list-tail: out of range or bad list, arglist is: ",
- CONS(list, scm_k));
+ CONS(lst, scm_k));
return ret;
}
-ScmObj ScmOp_list_ref(ScmObj list, ScmObj scm_k)
+ScmObj ScmOp_list_ref(ScmObj lst, ScmObj scm_k)
{
ScmObj tail = SCM_NULL;
if (FALSEP(ScmOp_numberp(scm_k)))
SigScm_ErrorObj("list-ref : int required but got ", scm_k);
- tail = ScmOp_listtail_internal(list, SCM_INT_VALUE(scm_k));
+ tail = ScmOp_listtail_internal(lst, SCM_INT_VALUE(scm_k));
if (EQ(tail, SCM_INVALID) || NULLP(tail))
SigScm_ErrorObj("list-ref : out of range or bad list, arglist is: ",
- CONS(list, scm_k));
+ CONS(lst, scm_k));
return CAR(tail);
}
-ScmObj ScmOp_memq(ScmObj obj, ScmObj list)
+ScmObj ScmOp_memq(ScmObj obj, ScmObj lst)
{
- ScmObj tmplist = SCM_NULL;
- for (tmplist = list; CONSP(tmplist); tmplist = CDR(tmplist)) {
- if (EQ(obj, CAR(tmplist))) {
- return tmplist;
- }
- }
+ for (; CONSP(lst); lst = CDR(lst))
+ if (EQ(obj, CAR(lst)))
+ return lst;
return SCM_FALSE;
}
-ScmObj ScmOp_memv(ScmObj obj, ScmObj list)
+ScmObj ScmOp_memv(ScmObj obj, ScmObj lst)
{
- ScmObj tmplist = SCM_NULL;
- ScmObj tmpobj = SCM_NULL;
- for (tmplist = list; CONSP(tmplist); tmplist = CDR(tmplist)) {
- tmpobj = CAR(tmplist);
- if (NFALSEP(ScmOp_eqvp(obj, tmpobj))) {
- return tmplist;
- }
- }
+ for (; CONSP(lst); lst = CDR(lst))
+ if (NFALSEP(ScmOp_eqvp(obj, CAR(lst))))
+ return lst;
return SCM_FALSE;
}
-ScmObj ScmOp_member(ScmObj obj, ScmObj list)
+ScmObj ScmOp_member(ScmObj obj, ScmObj lst)
{
- ScmObj tmplist = SCM_NULL;
- ScmObj tmpobj = SCM_NULL;
- for (tmplist = list; CONSP(tmplist); tmplist = CDR(tmplist)) {
- tmpobj = CAR(tmplist);
- if (NFALSEP(ScmOp_equalp(obj, tmpobj))) {
- return tmplist;
- }
- }
+ for (; CONSP(lst); lst = CDR(lst))
+ if (NFALSEP(ScmOp_equalp(obj, CAR(lst))))
+ return lst;
return SCM_FALSE;
}
ScmObj ScmOp_assq(ScmObj obj, ScmObj alist)
{
- ScmObj tmplist = SCM_NULL;
+ ScmObj tmp_lst = SCM_NULL;
ScmObj tmpobj = SCM_NULL;
ScmObj car;
- for (tmplist = alist; CONSP(tmplist); tmplist = CDR(tmplist)) {
- tmpobj = CAR(tmplist);
+ for (tmp_lst = alist; CONSP(tmp_lst); tmp_lst = CDR(tmp_lst)) {
+ tmpobj = CAR(tmp_lst);
car = CAR(tmpobj);
#if SCM_STRICT_R5RS
if (!CONSP(tmpobj))
@@ -1030,12 +1017,12 @@
ScmObj ScmOp_assv(ScmObj obj, ScmObj alist)
{
- ScmObj tmplist = SCM_NULL;
+ ScmObj tmp_lst = SCM_NULL;
ScmObj tmpobj = SCM_NULL;
ScmObj car;
- for (tmplist = alist; CONSP(tmplist); tmplist = CDR(tmplist)) {
- tmpobj = CAR(tmplist);
+ for (tmp_lst = alist; CONSP(tmp_lst); tmp_lst = CDR(tmp_lst)) {
+ tmpobj = CAR(tmp_lst);
car = CAR(tmpobj);
#if SCM_STRICT_R5RS
if (!CONSP(tmpobj))
@@ -1053,12 +1040,12 @@
ScmObj ScmOp_assoc(ScmObj obj, ScmObj alist)
{
- ScmObj tmplist = SCM_NULL;
+ ScmObj tmp_lst = SCM_NULL;
ScmObj tmpobj = SCM_NULL;
ScmObj car;
- for (tmplist = alist; CONSP(tmplist); tmplist = CDR(tmplist)) {
- tmpobj = CAR(tmplist);
+ for (tmp_lst = alist; CONSP(tmp_lst); tmp_lst = CDR(tmp_lst)) {
+ tmpobj = CAR(tmp_lst);
car = CAR(tmpobj);
#if SCM_STRICT_R5RS
if (!CONSP(tmpobj))
@@ -1490,7 +1477,7 @@
return head;
}
-ScmObj ScmOp_list2string(ScmObj list)
+ScmObj ScmOp_list2string(ScmObj lst)
{
int len = 0;
int total_size = 0;
@@ -1500,14 +1487,14 @@
char *ch = NULL;
char *p = NULL;
- if (FALSEP(ScmOp_listp(list)))
- SigScm_ErrorObj("list->string : list required but got ", list);
+ if (FALSEP(ScmOp_listp(lst)))
+ SigScm_ErrorObj("list->string : list required but got ", lst);
- if (NULLP(list))
+ if (NULLP(lst))
return Scm_NewStringCopying("");
/* count total size of the string */
- for (chars = list; !NULLP(chars); chars = CDR(chars)) {
+ for (chars = lst; !NULLP(chars); chars = CDR(chars)) {
obj = CAR(chars);
if (!CHARP(obj))
SigScm_ErrorObj("list->string : char required but got ", obj);
@@ -1520,7 +1507,7 @@
/* copy char by char */
p = new_str;
- for (chars = list; !NULLP(chars); chars = CDR(chars)) {
+ for (chars = lst; !NULLP(chars); chars = CDR(chars)) {
obj = CAR(chars);
ch = SCM_CHAR_VALUE(obj);
len = strlen(SCM_CHAR_VALUE(obj));
@@ -1683,7 +1670,7 @@
return head;
}
-ScmObj ScmOp_list2vector(ScmObj list)
+ScmObj ScmOp_list2vector(ScmObj lst)
{
ScmObj scm_len = SCM_NULL;
ScmObj *v = NULL;
@@ -1691,15 +1678,15 @@
int i = 0;
/* TOOD : canbe optimized. scanning list many times */
- if (FALSEP(ScmOp_listp(list)))
- SigScm_ErrorObj("list->vector : list required but got ", list);
+ if (FALSEP(ScmOp_listp(lst)))
+ SigScm_ErrorObj("list->vector : list required but got ", lst);
- scm_len = ScmOp_length(list);
+ scm_len = ScmOp_length(lst);
c_len = SCM_INT_VALUE(scm_len);
v = (ScmObj*)malloc(sizeof(ScmObj) * c_len);
for (i = 0; i < c_len; i++) {
- v[i] = CAR(list);
- list = CDR(list);
+ v[i] = CAR(lst);
+ lst = CDR(lst);
}
return Scm_NewVector(v, c_len);
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-09-27 16:35:27 UTC (rev 1613)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-09-27 16:58:59 UTC (rev 1614)
@@ -448,12 +448,12 @@
ScmObj ScmOp_listp(ScmObj obj);
ScmObj ScmOp_length(ScmObj obj);
ScmObj ScmOp_append(ScmObj args, ScmObj env);
-ScmObj ScmOp_reverse(ScmObj list);
-ScmObj ScmOp_list_tail(ScmObj list, ScmObj scm_k);
-ScmObj ScmOp_list_ref(ScmObj list, ScmObj scm_k);
-ScmObj ScmOp_memq(ScmObj obj, ScmObj list);
-ScmObj ScmOp_memv(ScmObj obj, ScmObj list);
-ScmObj ScmOp_member(ScmObj obj, ScmObj list);
+ScmObj ScmOp_reverse(ScmObj lst);
+ScmObj ScmOp_list_tail(ScmObj lst, ScmObj scm_k);
+ScmObj ScmOp_list_ref(ScmObj lst, ScmObj scm_k);
+ScmObj ScmOp_memq(ScmObj obj, ScmObj lst);
+ScmObj ScmOp_memv(ScmObj obj, ScmObj lst);
+ScmObj ScmOp_member(ScmObj obj, ScmObj lst);
ScmObj ScmOp_assq(ScmObj obj, ScmObj alist);
ScmObj ScmOp_assv(ScmObj obj, ScmObj alist);
ScmObj ScmOp_assoc(ScmObj obj, ScmObj alist);
@@ -483,7 +483,7 @@
ScmObj ScmOp_string_substring(ScmObj str, ScmObj start, ScmObj end);
ScmObj ScmOp_string_append(ScmObj arg, ScmObj env);
ScmObj ScmOp_string2list(ScmObj string);
-ScmObj ScmOp_list2string(ScmObj list);
+ScmObj ScmOp_list2string(ScmObj lst);
ScmObj ScmOp_string_copy(ScmObj string);
ScmObj ScmOp_string_fill(ScmObj string, ScmObj ch);
ScmObj ScmOp_vectorp(ScmObj obj);
@@ -493,7 +493,7 @@
ScmObj ScmOp_vector_ref(ScmObj vec, ScmObj scm_k);
ScmObj ScmOp_vector_set(ScmObj vec, ScmObj scm_k, ScmObj obj);
ScmObj ScmOp_vector2list(ScmObj vec);
-ScmObj ScmOp_list2vector(ScmObj list);
+ScmObj ScmOp_list2vector(ScmObj lst);
ScmObj ScmOp_vector_fill(ScmObj vec, ScmObj fill);
ScmObj ScmOp_procedurep(ScmObj obj);
ScmObj ScmOp_map(ScmObj map_arg, ScmObj env);
@@ -572,8 +572,8 @@
ScmObj ScmOp_SRFI1_cons_star(ScmObj obj, ScmObj env);
ScmObj ScmOp_SRFI1_make_list(ScmObj obj, ScmObj env);
ScmObj ScmOp_SRFI1_list_tabulate(ScmObj arg, ScmObj env);
-ScmObj ScmOp_SRFI1_list_copy(ScmObj list);
-ScmObj ScmOp_SRFI1_circular_list(ScmObj list, ScmObj env);
+ScmObj ScmOp_SRFI1_list_copy(ScmObj lst);
+ScmObj ScmOp_SRFI1_circular_list(ScmObj lst, ScmObj env);
ScmObj ScmOp_SRFI1_iota(ScmObj args, ScmObj env);
ScmObj ScmOp_SRFI1_proper_listp(ScmObj lst);
ScmObj ScmOp_SRFI1_circular_listp(ScmObj lst);
More information about the uim-commit
mailing list