[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiling multiple files



    Date: Tue 3 Sep 85 16:57:21-PDT
    From: SCHUMACHER%hplabs.csnet@csnet-relay.arpa

    What you need can be done using the require function (sec 11.8 modules in CLtL)
    assuming that the appropriate provide calls have been made, or you can
    simply use (eval-when (eval compile) (load ...)) .

     Lee Schumacher
    -------

This isn't the same thing at all, especially this last
suggestion.  Loading a file into the compilation
environment is not the same as compiling it into the file!

Nor is putting a REQUIRE into a file the same as compiling
the required software into a resulting file, which is what
was request.

I believe this describes the desired behaviour:

(defmacro insert-file-and-compile (file)
  (with-open-file (stream file)
    (do* ((eof (cons 'eof nil))
	  (form (read stream nil eof) (read stream nil eof))
	  (forms))
	 ((eq form eof)
          `(progn ,@(nreverse forms)))
      (push form forms))))