summaryrefslogtreecommitdiffstats
path: root/tests/002/proc/1930
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-02-03 19:02:28 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-02-03 19:02:28 -0800
commit8bc0ac3a54d248ba2d4a8a045dc2bc0619a60886 (patch)
tree2639b008221362f3c06f329ac7a4f63cf3cf0d3b /tests/002/proc/1930
parent06f994c1fd99290535a918e4b0954b6350684966 (diff)
downloadtxr-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/1930')
0 files changed, 0 insertions, 0 deletions