mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-05 17:00:52 -08:00
Changing the function definition of a symbol in a locked package results in a correctable error
This commit is contained in:
parent
5a13085f22
commit
1ed32834f5
3 changed files with 13 additions and 7 deletions
|
|
@ -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 ***
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue