diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-04-04 06:55:36 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-04-04 06:55:36 -0700 |
commit | 14262f7466c4ecaa293097e39ffd768b3309fbd6 (patch) | |
tree | 5dba5aec7024b3c6bb2404f501d3b3c349fc02f4 | |
parent | 611a489bf057d1db648e9b7c4ef5666cd95b128f (diff) | |
download | txr-14262f7466c4ecaa293097e39ffd768b3309fbd6.tar.gz txr-14262f7466c4ecaa293097e39ffd768b3309fbd6.tar.bz2 txr-14262f7466c4ecaa293097e39ffd768b3309fbd6.zip |
compile-file: don't compile constants.
* share/txr/stdlib/compiler.tl: Skip top-level forms which are
just constants. Their value is discarded and they have no
effect.
-rw-r--r-- | share/txr/stdlib/compiler.tl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index a5fd9e0d..e56287c7 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -1372,7 +1372,8 @@ [mapdo compile-form (cdr form)])) (eval-only (let ((*emit* nil)) [mapdo compile-form (cdr form)])) - (t (when (or *eval* *emit*) + (t (when (and (or *eval* *emit*) + (not (constantp form))) (let* ((vm-desc (compile-toplevel form)) (flat-vd (list-from-vm-desc vm-desc))) (when *eval* |