summaryrefslogtreecommitdiff
path: root/libguile/modules.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-11-30 22:17:46 +0100
committerAndy Wingo <wingo@pobox.com>2009-12-01 21:00:26 +0100
commitc7a2a803bd0c3ca8860929d4700a46e104cf2643 (patch)
tree1915b4742285810ee453f1897dcc6c945cfc4ce2 /libguile/modules.c
parent1d30393fbfac4b80dc9f3a5c8289ba4b55b345bb (diff)
downloadguile-c7a2a803bd0c3ca8860929d4700a46e104cf2643.tar.gz
export scm_define to scheme as define!
* libguile/modules.c (scm_define): Export to Scheme as `define!'. The evaluator needs it, and actually it's an OK thing to have around.
Diffstat (limited to 'libguile/modules.c')
-rw-r--r--libguile/modules.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libguile/modules.c b/libguile/modules.c
index f0576e924..e653571bb 100644
--- a/libguile/modules.c
+++ b/libguile/modules.c
@@ -761,14 +761,20 @@ scm_c_define (const char *name, SCM value)
return scm_define (scm_from_locale_symbol (name), value);
}
-SCM
-scm_define (SCM sym, SCM value)
+SCM_DEFINE (scm_define, "define!", 2, 0, 0,
+ (SCM sym, SCM value),
+ "Define @var{sym} to be @var{value} in the current module."
+ "Returns the variable itself. Note that this is a procedure, "
+ "not a macro.")
+#define FUNC_NAME s_scm_define
{
- SCM var =
- scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_T);
+ SCM var;
+ SCM_VALIDATE_SYMBOL (SCM_ARG1, sym);
+ var = scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_T);
SCM_VARIABLE_SET (var, value);
return var;
}
+#undef FUNC_NAME
SCM_DEFINE (scm_module_reverse_lookup, "module-reverse-lookup", 2, 0, 0,
(SCM module, SCM variable),