1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-29 08:20:20 +02:00

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.
This commit is contained in:
Andy Wingo 2009-11-30 22:17:46 +01:00
parent 1d30393fbf
commit c7a2a803bd

View file

@ -761,14 +761,20 @@ scm_c_define (const char *name, SCM value)
return scm_define (scm_from_locale_symbol (name), value); return scm_define (scm_from_locale_symbol (name), value);
} }
SCM SCM_DEFINE (scm_define, "define!", 2, 0, 0,
scm_define (SCM sym, SCM value) (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 var;
scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_T); SCM_VALIDATE_SYMBOL (SCM_ARG1, sym);
var = scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_T);
SCM_VARIABLE_SET (var, value); SCM_VARIABLE_SET (var, value);
return var; return var;
} }
#undef FUNC_NAME
SCM_DEFINE (scm_module_reverse_lookup, "module-reverse-lookup", 2, 0, 0, SCM_DEFINE (scm_module_reverse_lookup, "module-reverse-lookup", 2, 0, 0,
(SCM module, SCM variable), (SCM module, SCM variable),