Subject: inlined function calls
From: Erik Naggum <>
Date: 1996/11/30
Newsgroups: comp.lang.lisp
Message-ID: <>

this is probably a very simple question, but I'd like to have some
assumptions confirmed.

given a form like (mapcar (lambda (<args>) <body>) <list>), is a compiler
free to produce code without any other function calls than those in <body>
(which it may also inline)?  that is, knowing that symbols in the
COMMON-LISP package cannot be redefined, can a compiler fully utilize any
knowledge it may have about the use of functions, even to the point of
"refining" the programmer's implementation as long as it maintains the

e.g, can (map nil (lambda (file) <whatever>) (directory <dirspec>)) and
(dolist (file (directory <dirspec>)) <whatever>) produce exactly the same

I believe this should be possible, but then there are all sorts of problems
in debugging and tracing Lisp programs which may have caused somebody not
to allow it.  (I can't find anything either way in the standard.)

Please address private replies, only, to "erik".  Junk mail, spam,
stupid flames, courtesy copies, etc, should be sent to "nobody".