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 | eb10286190b64ecbcf023760ce01f1a8ce77ac86 (patch) | |
tree | 5dba5aec7024b3c6bb2404f501d3b3c349fc02f4 | |
parent | 0cc6af7235debd8c4d710d806ffd3a6fb40ebeb4 (diff) | |
download | txr-eb10286190b64ecbcf023760ce01f1a8ce77ac86.tar.gz txr-eb10286190b64ecbcf023760ce01f1a8ce77ac86.tar.bz2 txr-eb10286190b64ecbcf023760ce01f1a8ce77ac86.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* |