Better type derivation for APPEND, NCONC, LIST.
authorStas Boukarev <stassats@gmail.com>
Sun, 5 May 2013 16:51:15 +0000 (20:51 +0400)
committerStas Boukarev <stassats@gmail.com>
Sun, 5 May 2013 16:51:15 +0000 (20:51 +0400)
commitf32ee7df37cdc62596e849c079f365000424a712
treeb3dcd0e65b51d2b5a7f011fa2ccd7e0b34d3c8c9
parent03e8baab974e52e86df105ee269e83efd65e3d8e
Better type derivation for APPEND, NCONC, LIST.

The result types of APPEND/NCONC depend on the last argument and the
presence of conses in the middle.
For example (append 42) => 42, (append nil nil 42) => 42,
(append (list 1) 42) => (1 . 42), etc.

LIST returns NIL in case of no arguments and a cons in other
cases. That fact required an adjustment for a values-list optimizer,
which removed all arguments from a LIST call making it change the type
from LIST to NULL and confusing things.

Closes lp#538957
NEWS
src/compiler/fndb.lisp
src/compiler/generic/vm-ir2tran.lisp
src/compiler/ir1opt.lisp
src/compiler/srctran.lisp
tests/compiler.pure.lisp