Changing the function definition of a symbol in a locked package results in a correctable error

This commit is contained in:
jjgarcia 2005-12-20 10:33:06 +00:00
parent 5a13085f22
commit 1ed32834f5
3 changed files with 13 additions and 7 deletions

View file

@ -29,6 +29,9 @@ ECL 0.9i
- Adding a new method to a generic function does no longer result in a warning
when the function belongs to a locked package.
- Trying to change the function definition of a symbol in a locked package
results in a correctable error.
;;; Local Variables: ***
;;; mode:text ***
;;; fill-column:79 ***

View file

@ -33,8 +33,10 @@ cl_set(cl_object var, cl_object val)
@
if (Null(cl_functionp(def)))
FEinvalid_function(def);
if (sym->symbol.hpack != Cnil && sym->symbol.hpack->pack.locked)
funcall(3, @'warn', make_constant_string("~S is being redefined."), fname);
if (sym->symbol.hpack != Cnil && sym->symbol.hpack->pack.locked) {
CEpackage_error("Attempt to redefine function ~S in locked package.",
"Ignore lock and proceed", fname->symbol.hpack, 1, fname);
}
mflag = !Null(macro);
if (sym->symbol.isform && !mflag)
FEerror("Given that ~S is a special form, ~S cannot be defined as a function.",
@ -72,15 +74,16 @@ cl_makunbound(cl_object sym)
ECL_SET(sym, OBJNULL);
@(return sym)
}
cl_object
cl_fmakunbound(cl_object fname)
{
cl_object sym = si_function_block_name(fname);
if (sym->symbol.hpack != Cnil && sym->symbol.hpack->pack.locked)
funcall(3, @'warn', make_constant_string("~S is being redefined."),
fname);
if (sym->symbol.hpack != Cnil && sym->symbol.hpack->pack.locked) {
CEpackage_error("Attempt to remove definition of function ~S in locked package.",
"Ignore lock and proceed", fname->symbol.hpack, 1, fname);
}
if (SYMBOLP(fname)) {
clear_compiler_properties(sym);
#ifdef PDE

View file

@ -48,7 +48,7 @@ FEpackage_error(const char *message, cl_object package, int narg, ...)
@':package', package); /* extra arguments */
}
static void
void
CEpackage_error(const char *message, const char *continue_message, cl_object package, int narg, ...)
{
cl_va_list args;