diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-23 07:33:01 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-23 07:33:01 -0700 |
commit | e04e3677661a1ddb8dda4ea64bbb83c68c4724ba (patch) | |
tree | 752a109b39f46dc0f951fcc542a4959620998a3c /lisplib.c | |
parent | 89257e70fba9b57de6c80f00280decf49b73cd76 (diff) | |
download | txr-e04e3677661a1ddb8dda4ea64bbb83c68c4724ba.tar.gz txr-e04e3677661a1ddb8dda4ea64bbb83c68c4724ba.tar.bz2 txr-e04e3677661a1ddb8dda4ea64bbb83c68c4724ba.zip |
compiler: optimizations in cond and if.
We optimize based on test being constant expressions.
* share/txr/stdlib/compiler.tl (compiler comp-cond): Whenever
a test is a constant null, we need not evaluate the forms in that case;
the entire case basically disappears so we compile it to nil.
We also need not consider any cases after the first case whose
test is a constant true.
(compiler comp-if): Optimize all situations when the test is
constant.
Diffstat (limited to 'lisplib.c')
0 files changed, 0 insertions, 0 deletions