Re: COMPILE-FILE without a file...
- From: "Tobias C. Rittweiler" <tcr@xxxxxxxxxxx>
- Date: Mon, 02 Feb 2009 20:18:16 +0100
Alessio Stalla <alessiostalla@xxxxxxxxx> writes:
Suppose I have code in text form, coming from an arbitrary stream
(e.g. the network, or a compressed archive, or...): is (1)
(compile nil `(lambda () ,@(read stream)))
equivalent to (2)
(progn
(dump-to-file stream "file.lisp")
(compile-file "file.lisp"))
No, it's not. The first form executes the /run time compiler/, the
second one the /file compiler/. They differ in how they deal with
EVAL-WHEN, and how they coalesce constants.
? Probably not... (rhetorical question) but, exactly what kind of
disaster can I expect if I use (2) instead of (1)? I'd like to avoid
dealing with temporary files if I can...
Some implementations offer a COMPILE-FROM-STREAM. Look at how
SWANK-COMPILE-STRING is implemented in the different SWANK
backends. (The swank-foo.lisp files in the source checkout of Slime.)
-T.
.
- References:
- COMPILE-FILE without a file...
- From: Alessio Stalla
- COMPILE-FILE without a file...
- Prev by Date: Re: JVM vs CLR
- Next by Date: Re: COMPILE-FILE without a file...
- Previous by thread: Re: COMPILE-FILE without a file...
- Next by thread: Re: COMPILE-FILE without a file...
- Index(es):
Relevant Pages
|