I have recently been reading the SBCL User Manual and started wondering about the title question. Obviously some lisps, for example clojure, ban all side effects so they can easily parallelize the code. Common Lisp allows side effects and so I was wondering if the fact a given function is 'dirty' or 'clean' affects it's compilation.
For example in the CMUCL compiler manual let optimizations show how, in many casesm the use of 'let' to bind a new variable will be more efficient than modifying with 'setq'. I guess I'm asking if something similar is done for function calls.
I have read the relevant sections of the sbcl manual and poured through the question on stackoverflow but could not find an answer to this.
(println "Hello World")
is a side effect. To ban them entirely they either need to 1. Not be in the language. 2. Be separated by a very strong type system. Anything else would mean the halting problem – Antlion