Some uim companion tools are requiring direct Scheme code evaluation, but uim is currently not exporting required functions. A patch [Anthy-dev 763] by Kouhei Sutou-san resolved this, but I think that these functions should be distinguished from ordinary uim API because the functions are requied by few uim companion tools only. Following consideration is needed. 1. add appropriate prefix to the functions (such as "uim_scm") ex) uim_scm_repl_c_string() 2. aggregate these functions into independent header file ex) uim-scm.h "uim_scm" is not the best choice because the API will contain non Scheme-related definitions later. The prefix should be meaning "friend" in C++. Any ideas? The new API will be used by following uim companion tools. - uim-shell (may be renamed to uim-sh) uim interactive shell for debugging, batch processing and serving as generic inferior process - Sumika (http://sourceforge.jp/projects/sumika/) A GUI tool for dictionary maintenance and uim configuration
We also need this to implement plugin feature. Shall we make a big structure that contains all of exported scheme functions? Say, struct uim_scheme { LISP (*car)(LISP ); LISP (*cdr)(LISP ); .. other functions here .. };
I'm no sure about the Tabata-san's idea. Although we have a similar structure uim_code_converter to handle a set of functions, I think that it's existing to handle polymorphism. I suppose that uim is always using one Scheme implementation only, so runtime polymorphism is not required. Simple abstraction through uim_scm_foo() is sufficient. Or other reason (efficiency)?
I've Added uim-scm.h to svn repository by r727. This isn't the final API. Discussions are welcome.
Exporting scheme object to C is somehow dangerous. Garbage Collector can't recognize reference to the objects outside libuim. current sumika has possibilities of following scenario (1) uim_lisp v = uim_scm_???() -> allocate cells and return them. (2) uim_scm_???() -> invoke GC inside. contents of v will be collected. (3) use v -> operation to garbage. good luck!
uim-scm API reorganization has recently done. More elaboration is required.
Current uim-scm implementation is enough to unblock bug #538.
The uim-scm API will be revised and simplified at uim 1.3.0.
Current uim-scm implementation is enough to close this bug. Simplification and reorganization should be separated as another bug.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.