diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-10-22 12:09:17 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-10-22 12:09:17 -0700 |
commit | a76f849126fd2cd1c541e8383f777b3b485ddf9e (patch) | |
tree | 38c42344e88848b4f42ffc537b0428c469f8f74d /tests/019/compile-package.tl | |
parent | 9159f2fbbd4d57df6d13717acbc758a97cd97c41 (diff) | |
download | txr-a76f849126fd2cd1c541e8383f777b3b485ddf9e.tar.gz txr-a76f849126fd2cd1c541e8383f777b3b485ddf9e.tar.bz2 txr-a76f849126fd2cd1c541e8383f777b3b485ddf9e.zip |
match: translate some match-case forms into casequal.
The motivation here is that casequal brings in some optimizations
not done by match-case, like hashed lookup and jump tables.
* stdlib/match.tl (non-triv-pat-t): Move temporary definition
higher in file since it is needed earlier in the bootsrapping.
(match-case-to-casequal): New function.
(match-case): Try converting clauses to casequal with new
function. If that returns something, use that as the expansion,
otherwise perform the normal expansion.
* txr.1: Documentation revised. Existing text is wrong which
says that the clauses of a caseq, caseql or casequal are
always evaluated sequentially. Furthermore, now that
match-case and match-ecase can be transformed to casequal,
they also don't necessarily evaluate sequentially. We spell
out the conditions under which they may translate.
Diffstat (limited to 'tests/019/compile-package.tl')
0 files changed, 0 insertions, 0 deletions