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

kzk at freedesktop.org kzk at freedesktop.org
Sat Aug 13 03:38:07 EST 2005


Author: kzk
Date: 2005-08-12 10:38:04 -0700 (Fri, 12 Aug 2005)
New Revision: 1191

Modified:
   branches/r5rs/sigscheme/eval.c
   branches/r5rs/sigscheme/sigscheme.c
   branches/r5rs/sigscheme/sigscheme.h
Log:
* implement "quasiquote", "unquote", "unquote-splicing"

* sigscheme/sigscheme.c
  - (SigScm_Initialize): export "quasiquote", "unquote", "unquote-splicing"
* sigscheme/sigscheme.h
* sigscheme/eval.c
  - implement ScmOp_quasiquote, ScmOp_unquote, ScmOp_unquote_splicing


Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c	2005-08-12 16:59:11 UTC (rev 1190)
+++ branches/r5rs/sigscheme/eval.c	2005-08-12 17:38:04 UTC (rev 1191)
@@ -733,9 +733,7 @@
 ===========================================================================*/
 ScmObj ScmOp_quote(ScmObj obj)
 {
-    ScmObj quotedObj = Scm_NewCons(SCM_QUOTE, obj);
-
-    return quotedObj;
+    return Scm_NewCons(SCM_QUOTE, obj);
 }
 
 /*===========================================================================
@@ -1348,19 +1346,19 @@
 /*===========================================================================
   R5RS : 4.2 Derived expression types : 4.2.6 Quasiquotation
 ===========================================================================*/
-ScmObj ScmOp_quasiquote(ScmObj temp)
+ScmObj ScmOp_quasiquote(ScmObj obj)
 {
-    return SCM_FALSE;
+    return Scm_NewCons(SCM_QUASIQUOTE, obj);
 }
 
-ScmObj ScmOp_unquote(ScmObj exp)
+ScmObj ScmOp_unquote(ScmObj obj)
 {
-    return SCM_FALSE;
+    return Scm_NewCons(SCM_UNQUOTE, obj);
 }
 
-ScmObj ScmOp_unquote_splicint(ScmObj exp)
+ScmObj ScmOp_unquote_splicing(ScmObj obj)
 {
-    return SCM_FALSE;
+    return Scm_NewCons(SCM_UNQUOTE_SPLICING, obj);
 }
 
 

Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c	2005-08-12 16:59:11 UTC (rev 1190)
+++ branches/r5rs/sigscheme/sigscheme.c	2005-08-12 17:38:04 UTC (rev 1191)
@@ -110,6 +110,7 @@
     /* eval.c */
     Scm_RegisterFunc2("eval"                 , ScmOp_eval);
     Scm_RegisterFuncL("apply"                , ScmOp_apply);
+    Scm_RegisterFunc1("quote"                , ScmOp_quote);
     Scm_RegisterFuncR("lambda"               , ScmExp_lambda);
     Scm_RegisterFuncR("if"                   , ScmExp_if);
     Scm_RegisterFuncR("set!"                 , ScmExp_set);
@@ -123,11 +124,13 @@
     Scm_RegisterFuncR("begin"                , ScmExp_begin);
     Scm_RegisterFuncR("do"                   , ScmExp_do);
     Scm_RegisterFuncR("delay"                , ScmOp_delay);
+    Scm_RegisterFunc1("quasiquote"           , ScmOp_quasiquote);
+    Scm_RegisterFunc1("unquote"              , ScmOp_unquote);
+    Scm_RegisterFunc1("unquote-splicing"     , ScmOp_unquote_splicing);
     Scm_RegisterFuncR("define"               , ScmExp_define);
     Scm_RegisterFunc1("scheme-report-environment", ScmOp_scheme_report_environment);
     Scm_RegisterFunc1("null-environment"         , ScmOp_null_environment);
     /* operations.c */
-    Scm_RegisterFunc1("quote"                , ScmOp_quote);
     Scm_RegisterFunc2("eqv?"                 , ScmOp_eqvp);
     Scm_RegisterFunc2("eq?"                  , ScmOp_eqp);
     Scm_RegisterFunc2("equal?"               , ScmOp_equalp);

Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h	2005-08-12 16:59:11 UTC (rev 1190)
+++ branches/r5rs/sigscheme/sigscheme.h	2005-08-12 17:38:04 UTC (rev 1191)
@@ -156,9 +156,9 @@
 ScmObj ScmExp_begin(ScmObj arg, ScmObj *envp, int *tail_flag);
 ScmObj ScmExp_do(ScmObj arg, ScmObj *envp, int *tail_flag);
 ScmObj ScmOp_delay(ScmObj arg, ScmObj *envp, int *tail_flag);
-ScmObj ScmOp_quasiquote(ScmObj temp);
-ScmObj ScmOp_unquote(ScmObj exp);
-ScmObj ScmOp_unquote_splicint(ScmObj exp);
+ScmObj ScmOp_quasiquote(ScmObj obj);
+ScmObj ScmOp_unquote(ScmObj obj);
+ScmObj ScmOp_unquote_splicing(ScmObj obj);
 ScmObj ScmExp_define(ScmObj arg, ScmObj *envp, int *tail_flag);
 ScmObj ScmOp_scheme_report_environment(ScmObj version);
 ScmObj ScmOp_null_environment(ScmObj version);



More information about the uim-commit mailing list