diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-02-03 19:02:28 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-02-03 19:02:28 -0800 |
commit | 8bc0ac3a54d248ba2d4a8a045dc2bc0619a60886 (patch) | |
tree | 2639b008221362f3c06f329ac7a4f63cf3cf0d3b /tests/002/proc/2685/status | |
parent | 06f994c1fd99290535a918e4b0954b6350684966 (diff) | |
download | txr-8bc0ac3a54d248ba2d4a8a045dc2bc0619a60886.tar.gz txr-8bc0ac3a54d248ba2d4a8a045dc2bc0619a60886.tar.bz2 txr-8bc0ac3a54d248ba2d4a8a045dc2bc0619a60886.zip |
matcher: reimplementation of lambda-match.
This patch replaces the argument-list-based lambda match with
one that matches fixed arguments without consing. Instead of
generating a variadic function with zero fixed arguments, it
generates a function with required, optional and rest argument
based on considering the arity of all the matches.
* share/txr/stdlib/match.tl (compile-exprs-match): New
function.
(compile-match): Wire a new pattern operator called sys:exprs,
for internal use. This matches a list-like pattern against the
values of multiple expressions, rather than a single
expression.
(when-exprs-mach): New internal macro for matching a sequence
of patterns against a sequence of expressions of the same
arity.
(lambda-clause): New structure.
(parse-lambda-match-clause, expand-lambda-match): New functions.
(lambda-match, defun-match): Redefine using
expand-lambda-match.
Diffstat (limited to 'tests/002/proc/2685/status')
0 files changed, 0 insertions, 0 deletions