[Openmcl-devel] Generating a warning when loading fasls with duplicate function definitions

R. Matthew Emerson rme at clozure.com
Fri Jul 13 12:29:14 PDT 2012


On Jul 11, 2012, at 3:50 AM, Gary Byers wrote:

> If CCL:*WARN-IF-REDEFINE* is true when a duplicate definition is
> loaded (from source or fasl), you'll get a warning of the form:
> 
> ; Warning: FUNCTION X previously defined in: home:a.lisp.newest is now being redefined in: home:b.lisp.newest
> 
> Such a warning can certainly be useful; it can also be annoying.
> (It's sometimes necessary/desirable to define simple versions of
> things that run early in the process of bootstrapping a large system
> and are replaced with more feature-rich versions when it's possible
> to define such versions.)
> 
> *WARN-IF-REDEFINE* was present (with pretty much current semantics) in
> MCL 25 years ago, and I think that I personally found it annoying far
> more often than I found it useful.  I changed the default value to
> NIL in OpenMCL/CCL at some point in the dim past and have managed
> to completely forget about it, so thanks.  Thanks a lot ...
> 
> (I don't have a serious objection to changing the default value to T,
> at least experimentally.)
> 
> One thing that CCL and its ancestors have never tried to detect and warn
> about is the case where something's defined more than once in the same
> file.  This probably doesn't happen too often but probably isn't too
> hard to check for, and warning when it does happen could be worthwhile.
> (Or could be annoying.)


We've actually warned about duplicate definitions in the same file
for a few years now.  http://trac.clozure.com/ccl/changeset/10942 is
when that feature came into the trunk.  I find that this warning is
usually more helpful than annoying.

I am pretty sure that I would be annoyed if *warn-if-redefine* were t.
But, I suppose that's why we have init files.




More information about the Openmcl-devel mailing list