summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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),