compile-file-if-needed input-pathname &key output-file load &allow-other-keys => output-truename, warnings-p, failure-p
The function compile-file-if-needed
compares the file-write-date
of the source file named by input-pathname with the file-write-date
of the appropriate fasl file (as computed by compile-file-pathname
from input-pathname and output-file).
If the fasl file does not exist or is older than input-pathname, then compile-file
is called with input-pathname, output-file, load and any other arguments passed., and the values returned are those returned from compile-file
.
Otherwise, if load is true compile-file-if-needed
loads the fasl file and returns nil
, and if load is nil
it simply returns nil
.
CL-USER 19 > (compile-file-if-needed "H:/tmp/foo.lisp"
:output-file
"C:/temp/")
;;; Compiling file H:/tmp/foo.lisp ...
;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 0
;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3
;;; Source level debugging is off
;;; Source file recording is on
;;; Cross referencing is off
; (TOP-LEVEL-FORM 1)
; (TOP-LEVEL-FORM 2)
; (TOP-LEVEL-FORM 3)
; FOO
; BAR
#P"C:/temp/foo.ofasl"
NIL
NIL
CL-USER 20 > (compile-file-if-needed "H:/tmp/foo.lisp"
:output-file
"C:/temp/"
:load t)
; Loading fasl file C:\temp\foo.ofasl
NIL
LispWorks User Guide and Reference Manual - 20 Sep 2017