summaryrefslogtreecommitdiffstats
path: root/regex.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-01-18 21:31:30 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-01-18 21:31:30 -0800
commit040ac1066fae0f2041e4b508174518598639bae2 (patch)
tree674f7f1beaff5a6bdf45d2acf8cc466a846f4fd7 /regex.h
parenta91aff6dfa0d97c4130a3a7c630466b8ec2e247b (diff)
downloadtxr-040ac1066fae0f2041e4b508174518598639bae2.tar.gz
txr-040ac1066fae0f2041e4b508174518598639bae2.tar.bz2
txr-040ac1066fae0f2041e4b508174518598639bae2.zip
compiler: improve code for and/or.
Squeeze the constant and unreachable cases out of (and ...) and (or ...) forms, producing a more streamlined translation. This is the first appearance of structural pattern matching in the compiler! * share/txr/stdlib/compiler.tl (compiler compile): Handle and using new expand-and function, which translates it to if forms. Handle or via the renamed method comp-or. (compiler comp-and-or): Renamed to comp-or, since it handles only or. All the switching between or/and is eliminated. The or form is first reduced using simplify-or. We retain this function because one case in cond relies on or; or is a useful primitive because (or a b) evaluates a only once; whereas (if a a b) requires common-subexpression elimination to generate the same code as (or a b). (true-const-p, expand-and, flatten-or, reduce-or, simplify-or): New functions.
Diffstat (limited to 'regex.h')
0 files changed, 0 insertions, 0 deletions