diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2003-05-06 20:05:04 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2003-05-06 20:05:04 +0000 |
commit | f58c472a84489fa86e0ddecf7d747e99ab98c123 (patch) | |
tree | 9667af4d31bde2f20111d4d6eec305113f80c7c1 | |
parent | d963e93f3b54e2e628d305c5da2b3bc5679e0f0c (diff) | |
download | guile-f58c472a84489fa86e0ddecf7d747e99ab98c123.tar.gz |
* eval.c, eval.h, evalext.c, evalext.h (scm_m_undefine): Moved
from evalext to eval. This will allow to make some of the
definitions in eval.c static.
-rw-r--r-- | libguile/ChangeLog | 6 | ||||
-rw-r--r-- | libguile/eval.c | 31 | ||||
-rw-r--r-- | libguile/eval.h | 8 | ||||
-rw-r--r-- | libguile/evalext.c | 30 | ||||
-rw-r--r-- | libguile/evalext.h | 1 |
5 files changed, 47 insertions, 29 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 1d1bf3ff1..54734aba0 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +2003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de> + + * eval.c, eval.h, evalext.c, evalext.h (scm_m_undefine): Moved + from evalext to eval. This will allow to make some of the + definitions in eval.c static. + 2003-05-06 Kevin Ryde <user42@zip.com.au> * numbers.c (scm_difference): In inum - bignum, handle negative inum. diff --git a/libguile/eval.c b/libguile/eval.c index 3b3d1b4fe..161ad6b5d 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1221,6 +1221,37 @@ scm_m_atfop (SCM xorig, SCM env SCM_UNUSED) #endif /* SCM_ENABLE_ELISP */ +/* Start of the memoizers for deprecated macros. */ + + +#if (SCM_ENABLE_DEPRECATED == 1) + +SCM_SYNTAX (s_undefine, "undefine", scm_makacro, scm_m_undefine); + +SCM +scm_m_undefine (SCM x, SCM env) +{ + SCM arg1 = x; + x = SCM_CDR (x); + SCM_ASSYNT (SCM_TOP_LEVEL (env), "bad placement ", s_undefine); + SCM_ASSYNT (SCM_CONSP (x) && SCM_NULLP (SCM_CDR (x)), + scm_s_expression, s_undefine); + x = SCM_CAR (x); + SCM_ASSYNT (SCM_SYMBOLP (x), scm_s_variable, s_undefine); + arg1 = scm_sym2var (x, scm_env_top_level (env), SCM_BOOL_F); + SCM_ASSYNT (!SCM_FALSEP (arg1) && !SCM_UNBNDP (SCM_VARIABLE_REF (arg1)), + "variable already unbound ", s_undefine); + SCM_VARIABLE_SET (arg1, SCM_UNDEFINED); +#ifdef SICP + return x; +#else + return SCM_UNSPECIFIED; +#endif +} + +#endif + + SCM scm_m_expand_body (SCM xorig, SCM env) { diff --git a/libguile/eval.h b/libguile/eval.h index 92c53d224..fbab147e5 100644 --- a/libguile/eval.h +++ b/libguile/eval.h @@ -241,6 +241,14 @@ SCM_API SCM scm_eval_x (SCM exp, SCM module); SCM_API void scm_init_eval (void); + +#if (SCM_ENABLE_DEPRECATED == 1) + +SCM_API SCM scm_m_undefine (SCM x, SCM env); + +#endif + + #endif /* SCM_EVAL_H */ /* diff --git a/libguile/evalext.c b/libguile/evalext.c index 3643e0cf4..4db0a8030 100644 --- a/libguile/evalext.c +++ b/libguile/evalext.c @@ -20,9 +20,8 @@ #include "libguile/_scm.h" #include "libguile/eval.h" -#include "libguile/macros.h" -#include "libguile/modules.h" #include "libguile/fluids.h" +#include "libguile/modules.h" #include "libguile/validate.h" #include "libguile/evalext.h" @@ -77,35 +76,10 @@ SCM_DEFINE (scm_defined_p, "defined?", 1, 1, 0, } #undef FUNC_NAME -#if (SCM_ENABLE_DEPRECATED == 1) - -SCM_SYNTAX (s_undefine, "undefine", scm_makacro, scm_m_undefine); - -SCM -scm_m_undefine (SCM x, SCM env) -{ - SCM arg1 = x; - x = SCM_CDR (x); - SCM_ASSYNT (SCM_TOP_LEVEL (env), "bad placement ", s_undefine); - SCM_ASSYNT (SCM_CONSP (x) && SCM_NULLP (SCM_CDR (x)), - scm_s_expression, s_undefine); - x = SCM_CAR (x); - SCM_ASSYNT (SCM_SYMBOLP (x), scm_s_variable, s_undefine); - arg1 = scm_sym2var (x, scm_env_top_level (env), SCM_BOOL_F); - SCM_ASSYNT (!SCM_FALSEP (arg1) && !SCM_UNBNDP (SCM_VARIABLE_REF (arg1)), - "variable already unbound ", s_undefine); - SCM_VARIABLE_SET (arg1, SCM_UNDEFINED); -#ifdef SICP - return x; -#else - return SCM_UNSPECIFIED; -#endif -} - -#endif SCM_REGISTER_PROC (s_map_in_order, "map-in-order", 2, 0, 1, scm_map); + SCM_DEFINE (scm_self_evaluating_p, "self-evaluating?", 1, 0, 0, (SCM obj), "Return #t for objects which Guile considers self-evaluating") diff --git a/libguile/evalext.h b/libguile/evalext.h index defb8a1c8..c8250de26 100644 --- a/libguile/evalext.h +++ b/libguile/evalext.h @@ -33,7 +33,6 @@ SCM_API void scm_init_evalext (void); #if (SCM_ENABLE_DEPRECATED == 1) #define scm_definedp scm_defined_p -SCM_API SCM scm_m_undefine (SCM x, SCM env); #endif |