From 894aec019d3ce82f861a5777236ac079c2f2388d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 25 Dec 2011 00:42:19 -0800 Subject: * eval.c (eval_init): New function interned. * lib.c:x (lazy_flatten_scan, lazy_flatten_func): New static functions. (lazy_flatten): New function. * lib.h (lazy_flatten): Declared. * match.c (v_next): Use lazy_flatten instead of flatten for processing a :list source. This means that @(next :list ...) can be used to process infinite lazy lists. * txr.1: Documented lazy-flatten. --- txr.1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index d0cdcdf4..58112083 100644 --- a/txr.1 +++ b/txr.1 @@ -5606,7 +5606,7 @@ Examples: (ldiff a b)) -> (1) -.SS Function flatten +.SS Functions flatten, lazy-flatten .TP Syntax: @@ -5617,7 +5617,11 @@ Syntax: Description: The flatten function produces a list whose elements are all of the non-nil -atoms contained in the structure of . +atoms contained in the structure of . The lazy-flatten function +works like flatten except that flatten creates and returns a complete +flattened list, whereas lazy-flatten produces a lazy list which is +instantiated on demand. This is particularly useful when the input +structure is itself lazy. .TP Examples: -- cgit v1.2.3