#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 13 years ago by
| Cc: | stassats@… added |
|---|
comment:2 Changed 13 years ago by
| Keywords: | pathname added |
|---|---|
| Milestone: | → 1.2.0 |
| Version: | → 1.2.0-dev |
comment:3 Changed 13 years ago by
comment:4 Changed 13 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:5 Changed 13 years ago by
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)
Should read "device", instead of "host".