[uim-commit] r1247 - in branches/r5rs: scm sigscheme uim

kzk at freedesktop.org kzk at freedesktop.org
Sun Aug 21 04:31:44 EST 2005


Author: kzk
Date: 2005-08-20 11:31:37 -0700 (Sat, 20 Aug 2005)
New Revision: 1247

Modified:
   branches/r5rs/scm/im-custom.scm
   branches/r5rs/sigscheme/datas.c
   branches/r5rs/sigscheme/eval.c
   branches/r5rs/sigscheme/sigscheme.c
   branches/r5rs/sigscheme/sigscheme.h
   branches/r5rs/sigscheme/sigschemetype.h
   branches/r5rs/uim/uim-scm.c
Log:
* now we can successfully create "installed-modules.scm" and
  "loader.scm". Yey!

* implement uim_scm_return_value for SIOD compatibility
* implement "the-environment", "%%closure-code" for SIOD compatibility
* fix small bugs
* set big HEAP_SIZE now

* sigscheme/sigscheme.c
  - (SigScm_Initialize): export "the-environment" and "%%closure-env"
* sigscheme/sigscheme.h
  - (ScmOp_the_environment, ScmOp_closure_env): new func
* sigscheme/sigschemetype.h
  - (SCM_C_FUNCPOINTER_FUNC): fix mistake
* sigscheme/eval.c
  - (ScmOp_the_environment, ScmOp_closure_env): new func
* sigscheme/datas.c
  - (NAMEHASH_SIZE, SCM_HEAP_SIZE, scm_heap_num): set big num
  - (scm_return_value): new variable
  - (Scm_eval_c_string): set scm_return_value
  - (Scm_return_value): new func

* uim/uim-scm.c
  - (uim_scm_f): fix weird mistake
  - (uim_scm_return_value): implemented

* scm/im-custom.scm
  - restore commented out code, because it works successfully now


Modified: branches/r5rs/scm/im-custom.scm
===================================================================
--- branches/r5rs/scm/im-custom.scm	2005-08-20 18:12:01 UTC (rev 1246)
+++ branches/r5rs/scm/im-custom.scm	2005-08-20 18:31:37 UTC (rev 1247)
@@ -116,21 +116,15 @@
   (_ "Specify default IM")
   (_ "long description will be here."))
 
-;
-; TODO : fix me! Kazuki Ohta <mover at hct.zaq.ne.jp>
-;
-; This code becomes an error for some reason.
-; May be SigScheme's bug.
-;
-;(define-custom 'custom-preserved-default-im-name
-;  (and (not (null? im-list))
-;       (im-name (find-default-im #f)))
-;  '(global im-deployment)
-;  (cons
-;   'choice
-;   (custom-im-list-as-choice-rec (reverse im-list)))
-;  (_ "Default input method")
-;  (_ "long description will be here."))
+(define-custom 'custom-preserved-default-im-name
+  (and (not (null? im-list))
+       (im-name (find-default-im #f)))
+  '(global im-deployment)
+  (cons
+   'choice
+   (custom-im-list-as-choice-rec (reverse im-list)))
+  (_ "Default input method")
+  (_ "long description will be here."))
 
 ;; activity dependency
 (custom-add-hook 'custom-preserved-default-im-name
@@ -293,20 +287,20 @@
 ; May be SigScheme's bug.
 ;
 ; referred by some bridges
-;(define-custom 'candidate-window-position 'caret
-;  '(global visual-preference)
-;  (list 'choice
-;	(list 'caret
-;	      (_ "Adjacent to cursor")
-;	      (_ "Adjacent to cursor"))
-;	(list 'left
-;	      (_ "Left end of preedit area")
-;	      (_ "Left end of preedit area"))
-;	(list 'right
-;	      (_ "Right end of preedit area")
-;	      (_ "Right end of preedit area")))
-; (_ "Candidate window position")
-; (_ "long description will be here."))
+(define-custom 'candidate-window-position 'caret
+  '(global visual-preference)
+  (list 'choice
+	(list 'caret
+	      (_ "Adjacent to cursor")
+	      (_ "Adjacent to cursor"))
+	(list 'left
+	      (_ "Left end of preedit area")
+	      (_ "Left end of preedit area"))
+	(list 'right
+	      (_ "Right end of preedit area")
+	      (_ "Right end of preedit area")))
+ (_ "Candidate window position")
+ (_ "long description will be here."))
 
 (define-custom 'enable-lazy-loading? #t
   '(global advanced)

Modified: branches/r5rs/sigscheme/datas.c
===================================================================
--- branches/r5rs/sigscheme/datas.c	2005-08-20 18:12:01 UTC (rev 1246)
+++ branches/r5rs/sigscheme/datas.c	2005-08-20 18:31:37 UTC (rev 1247)
@@ -105,7 +105,7 @@
 /*=======================================
   File Local Macro Declarations
 =======================================*/
-#define NAMEHASH_SIZE 128
+#define NAMEHASH_SIZE 1024
 
 #define SCM_NEW_OBJ_INTERNAL(VALNAME)                                   \
     if (EQ(scm_freelist, SCM_NIL))					\
@@ -124,8 +124,8 @@
 /*=======================================
   Variable Declarations
 =======================================*/
-static int           SCM_HEAP_SIZE = 1024;
-static int           scm_heap_num  = 8;
+static int           SCM_HEAP_SIZE = 16384;
+static int           scm_heap_num  = 64;
 static ScmObjHeap   *scm_heaps     = NULL;
 static ScmObj        scm_freelist  = NULL;
 
@@ -137,6 +137,8 @@
 static ScmObj *symbol_hash = NULL;
 static gc_protected_obj *protected_obj_list = NULL;
 
+ScmObj scm_return_value    = NULL;
+
 /*=======================================
   File Local Function Declarations
 =======================================*/
@@ -919,8 +921,15 @@
     ret = SigScm_Read(str_port);
     ret = ScmOp_eval(ret, SCM_NIL);
 
+    scm_return_value = ret;
+
     /* now no need to protect stack */
     SigScm_gc_unprotect_stack(&stack_start);
 
     return ret;
 }
+
+ScmObj Scm_return_value(void)
+{
+    return scm_return_value;
+}

Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c	2005-08-20 18:12:01 UTC (rev 1246)
+++ branches/r5rs/sigscheme/eval.c	2005-08-20 18:31:37 UTC (rev 1247)
@@ -1749,3 +1749,16 @@
 
     return Scm_NewInt(~SCM_INT_VALUE(obj));
 }
+
+ScmObj ScmOp_the_environment(ScmObj arg, ScmObj env)
+{
+    return env;
+}
+
+ScmObj ScmOp_closure_code(ScmObj closure)
+{
+    if (!SCM_CLOSUREP(closure))
+	SigScm_ErrorObj("%%closure-code : closure required but got ", closure);
+
+    return SCM_CLOSURE_EXP(closure);
+}

Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c	2005-08-20 18:12:01 UTC (rev 1246)
+++ branches/r5rs/sigscheme/sigscheme.c	2005-08-20 18:31:37 UTC (rev 1247)
@@ -134,14 +134,6 @@
     Scm_RegisterFuncR("define"               , ScmExp_define);
     Scm_RegisterFunc1("scheme-report-environment", ScmOp_scheme_report_environment);
     Scm_RegisterFunc1("null-environment"         , ScmOp_null_environment);
-    /* SIOD compatible functions */
-    Scm_RegisterFunc1("symbol-bound?"        , ScmOp_symbol_boundp);
-    Scm_RegisterFunc1("symbol-value"         , ScmOp_symbol_value);
-    Scm_RegisterFunc2("set-symbol-value!"    , ScmOp_set_symbol_value);
-    Scm_RegisterFunc2("bit-and"              , ScmOp_bit_and);
-    Scm_RegisterFunc2("bit-or"               , ScmOp_bit_or);
-    Scm_RegisterFunc2("bit-xor"              , ScmOp_bit_xor);
-    Scm_RegisterFunc1("bit-not"              , ScmOp_bit_not);
     /* operations.c */
     Scm_RegisterFunc2("eqv?"                 , ScmOp_eqvp);
     Scm_RegisterFunc2("eq?"                  , ScmOp_eqp);
@@ -311,9 +303,29 @@
     Scm_RegisterFuncL("iota"                 , ScmOp_SRFI_1_iota);
 #endif
 #if USE_SRFI8
+    /*=======================================================================
+      SRFI-8 Procedure
+    =======================================================================*/
     Scm_RegisterFuncR("receive"              , ScmOp_SRFI_8_receive);
 #endif
 
+    /*=======================================================================
+      SIOD Compatible Variables and Procedures
+    =======================================================================*/
+    /* eval.c */
+    Scm_RegisterFunc1("symbol-bound?"        , ScmOp_symbol_boundp);
+    Scm_RegisterFunc1("symbol-value"         , ScmOp_symbol_value);
+    Scm_RegisterFunc2("set-symbol-value!"    , ScmOp_set_symbol_value);
+    Scm_RegisterFunc2("bit-and"              , ScmOp_bit_and);
+    Scm_RegisterFunc2("bit-or"               , ScmOp_bit_or);
+    Scm_RegisterFunc2("bit-xor"              , ScmOp_bit_xor);
+    Scm_RegisterFunc1("bit-not"              , ScmOp_bit_not);
+    Scm_RegisterFuncL("the-environment"      , ScmOp_the_environment);
+    Scm_RegisterFunc1("%%closure-code"       , ScmOp_closure_code);
+    /* datas.c */
+    extern ScmObj scm_return_value;
+    scm_return_value = SCM_NIL;
+
     stack_start_pointer = NULL;
 }
 

Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h	2005-08-20 18:12:01 UTC (rev 1246)
+++ branches/r5rs/sigscheme/sigscheme.h	2005-08-20 18:31:37 UTC (rev 1247)
@@ -155,6 +155,7 @@
 void*  Scm_GetCPointer(ScmObj c_ptr);
 C_FUNC Scm_GetCFuncPointer(ScmObj c_funcptr);
 ScmObj Scm_eval_c_string(const char *exp);
+ScmObj Scm_return_value(void);
 
 /* eval.c */
 ScmObj ScmOp_eval(ScmObj obj, ScmObj env);
@@ -187,6 +188,8 @@
 ScmObj ScmOp_bit_or(ScmObj obj1, ScmObj obj2);
 ScmObj ScmOp_bit_xor(ScmObj obj1, ScmObj obj2);
 ScmObj ScmOp_bit_not(ScmObj obj);
+ScmObj ScmOp_the_environment(ScmObj arg, ScmObj env);
+ScmObj ScmOp_closure_code(ScmObj closure);
 
 /* operations.c */
 ScmObj ScmOp_eqvp(ScmObj obj1, ScmObj obj2);

Modified: branches/r5rs/sigscheme/sigschemetype.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype.h	2005-08-20 18:12:01 UTC (rev 1246)
+++ branches/r5rs/sigscheme/sigschemetype.h	2005-08-20 18:31:37 UTC (rev 1247)
@@ -367,7 +367,7 @@
 
 #define SCM_C_FUNCPOINTERP(a) (SCM_GETTYPE(a) == ScmCFuncPointer)
 #define SCM_C_FUNCPOINTER(a)  (sigassert(SCM_C_FUNCPOINTERP(a)), (a))
-#define SCM_C_FUNCPOINTER_FUNC(a) (SCM_C_POINTER(a)->obj.c_func_pointer.func)
+#define SCM_C_FUNCPOINTER_FUNC(a) (SCM_C_FUNCPOINTER(a)->obj.c_func_pointer.func)
 #define SCM_SETC_FUNCPOINTER(a) (SCM_SETTYPE((a), ScmCFuncPointer))
 #define SCM_SETC_FUNCPOINTER_FUNC(a, funcptr) (SCM_C_FUNCPOINTER_FUNC(a) = funcptr)
 

Modified: branches/r5rs/uim/uim-scm.c
===================================================================
--- branches/r5rs/uim/uim-scm.c	2005-08-20 18:12:01 UTC (rev 1246)
+++ branches/r5rs/uim/uim-scm.c	2005-08-20 18:31:37 UTC (rev 1247)
@@ -235,7 +235,7 @@
 uim_lisp
 uim_scm_f(void)
 {
-  return (uim_lisp)SigScm_true;
+  return (uim_lisp)SigScm_false;
 }
 
 uim_lisp
@@ -339,7 +339,7 @@
 uim_scm_return_value(void)
 {
   /* FIXME: This function should be removed. */
-  SigScm_Error("uim_scm_return_value is not implemented\n");
+  return (uim_lisp)Scm_return_value();
 }
 
 uim_lisp



More information about the uim-commit mailing list