Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#282 closed defect (fixed)

Spurious macros redefinition warnings

Reported by: stassats Owned by: ehuelsmann
Priority: minor Milestone: 1.2.0
Component: compiler Version: 1.2.0-dev
Keywords: pathname Cc: stassats@…
Parent Tickets:

Description

Compiling and loading a file with

(defmacro foo ())
CL-USER(1): (compile-file "foo")
#P"/tmp/foo.abcl"
NIL
NIL
CL-USER(2): (load *)
STYLE-WARNING: redefining COMMON-LISP-USER::FOO in #P"/tmp/foo.lisp" (previously defined in #P"/tmp/foo.lisp")
T

But it's the same file, turns out, the old source is different because it has :host :unspecific.

The place where it does comparison
http://trac.common-lisp.net/armedbear/browser/trunk/abcl/src/org/armedbear/lisp/fdefinition.lisp#L40

And where it sets *source*
http://trac.common-lisp.net/armedbear/browser/trunk/abcl/src/org/armedbear/lisp/compile-file.lisp#L723

So, it does TRUENAME. truename sets :unspecific on non-windows platforms for pathname-host.
http://trac.common-lisp.net/armedbear/browser/trunk/abcl/src/org/armedbear/lisp/Pathname.java#L2185

And the compiler saves the source patname as just
(setq *source* #"path"), so :unspecific is lost when read:
http://trac.common-lisp.net/armedbear/browser/trunk/abcl/src/org/armedbear/lisp/compile-file.lisp#L685

Change History (6)

comment:1 Changed 12 years ago by stassats

Cc: stassats@… added

comment:2 Changed 12 years ago by Mark Evenson

Keywords: pathname added
Milestone: 1.2.0
Version: 1.2.0-dev

comment:3 Changed 12 years ago by stassats

Should read "device", instead of "host".

comment:4 Changed 12 years ago by Mark Evenson

Resolution: fixed
Status: newclosed

(In [14403]) No longer warn on spurious redefinitions.

Fixes #282.

comment:5 Changed 12 years ago by stassats

This commit broke redefinition at the REPL:
CL-USER(1): (defmacro foo ())
FOO
CL-USER(2): (defmacro foo ())
#<THREAD "interpreter" {2EAC0B4}>: Debugger invoked on condition of type TYPE-ERROR

The value :TOP-LEVEL is not of type (OR PATHNAME STRING FILE-STREAM SYSTEM:JAR-STREAM SYSTEM:URL-STREAM).

Restarts:

0: TOP-LEVEL Return to top level.

[1] CL-USER(3)

comment:6 Changed 12 years ago by Mark Evenson

(In [14404]) Fix error on form redefition introduced with r14403.

Addresses #282 comment 5.

Note: See TracTickets for help on using tickets.