LOAD-TIME-VALUE improvements
authorNikodemus Siivola <nikodemus@sb-studio.net>
Tue, 9 Aug 2011 07:57:41 +0000 (10:57 +0300)
committerNikodemus Siivola <nikodemus@sb-studio.net>
Tue, 9 Aug 2011 09:13:40 +0000 (12:13 +0300)
commited066199124c46998798122cc776e615c9c50372
treead4e3ff66cfa0fe54f1a02db228f1541842f216b
parent140a70b39c52de58ddd8a3d5caabebd99fd2a2c6
LOAD-TIME-VALUE improvements

 * Derive the type of :TOPLEVEL lambdas properly. Without this we were
   never able to utilize the type from COMPILE-LOAD-TIME-STUFF.

 * Use the source-type whenever it is more accurate than the type from
   COMPILE-LOAD-TIME-STUFF -- eg. when using a value cell.

 * Add ALIAS argument to IR1-CONVERT, allowing saving alternate forms
   into *CURRENT-PATH*: this allows

     (defparameter *var* 10)

     (compile nil '(lambda () (the list (load-time-value *var*))))

    to give the warning

      ;   Derived type of *VAR* is
      ;     (VALUES (INTEGER 10 10) &OPTIONAL),
      ;   conflicting with its asserted type
      ;     LIST.

    instead of the much less useful

      ;   Constant 10 conflicts with its asserted type LIST.

  * Use THE-IN-POLICY directly in LOAD-TIME-VALUE, allowing the file-
    compiler to report the LOAD-TIME-VALUE form for type-conflicts
    instead of (TRULY-THE <type> (%LOAD-TIME-VALUE ...))
NEWS
src/compiler/ir1final.lisp
src/compiler/ir1tran.lisp
src/compiler/ltv.lisp
tests/compiler.impure-cload.lisp
tests/compiler.impure.lisp
tests/compiler.pure.lisp