Repository navigation
v66.19.2
Sequence patterns match over lazy sequences (#3723)
Enhancements:
- A pattern in square brackets matches over any Iterable[T], not just
lists and arrays: a pipe, a generator result, a range - A string matches as a lazy sequence of its chars; its rest element is
a sequence of chars rather than a string - A rest element over a lazy sequence is a lazy sequence of its own: its
first read continues the pull, later reads re-derive from the source - A case over a lazy sequence is exhaustiveness-checked the same way as
over a list
Technical:
- One pull per matching statement, shared by every arm, its elements in
locals; rest is built from the Ghul.Pipes buffered pipe stages
(ghul-runtime 31.0.0) - Lazy matching is not built for while let, guards, case-pattern
nesting, assignment, or generator and async bodies
Co-authored-by: ghul-coder[bot] <286450068+ghul-coder[bot]@users.noreply.github.com>
Co-authored-by: GLM-5.3 noreply@z.ai