diff options
author | Eduardo Julian | 2022-07-03 00:35:32 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-07-03 00:35:32 -0400 |
commit | 9e7ddacf853efd7a18c1911d2f287d483b083229 (patch) | |
tree | 140eee091b7453879f072a48044635d03aa5096b /stdlib/source/library/lux/data/collection/stream.lux | |
parent | 7e4c9ba2e02f06fa621ffe24bc0ca046536429ef (diff) |
Added a new custom type for pattern-matching macros.
Diffstat (limited to 'stdlib/source/library/lux/data/collection/stream.lux')
-rw-r--r-- | stdlib/source/library/lux/data/collection/stream.lux | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/stdlib/source/library/lux/data/collection/stream.lux b/stdlib/source/library/lux/data/collection/stream.lux index e0b2088ee..6d9d358e3 100644 --- a/stdlib/source/library/lux/data/collection/stream.lux +++ b/stdlib/source/library/lux/data/collection/stream.lux @@ -129,14 +129,15 @@ (//.pending [wa (disjoint tail)]))))) (def .public pattern - (syntax (_ [patterns (<code>.form (<>.many <code>.any)) - body <code>.any - branches (<>.some <code>.any)]) - (with_symbols [g!stream] - (let [body+ (` (let [(,* (|> patterns - (list#each (function (_ pattern) - (list (` [(, pattern) (, g!stream)]) - (` ((,! //.result) (, g!stream)))))) - list#conjoint))] - (, body)))] - (in (list.partial g!stream body+ branches)))))) + (.pattern + (syntax (_ [patterns (<code>.form (<>.many <code>.any)) + body <code>.any + branches (<>.some <code>.any)]) + (with_symbols [g!stream] + (let [body+ (` (let [(,* (|> patterns + (list#each (function (_ pattern) + (list (` [(, pattern) (, g!stream)]) + (` ((,! //.result) (, g!stream)))))) + list#conjoint))] + (, body)))] + (in (list.partial g!stream body+ branches))))))) |