|
From: | Krzysztof Cieniuch |
Subject: | Re: filter and filter-out functions do they preserve order |
Date: | Wed, 19 Aug 2009 12:36:06 +0100 |
User-agent: | Thunderbird 2.0.0.22 (Windows/20090605) |
Found answer to my question in source code. Yes they do preserve order. The filter/filter-out algorithm is clear and simple tokenize inputs (filter patern and serach text) then iterate over filer patterns and text list and mark on input text list elements that match or do not match (in case of filter-out) and then build result list once more iterating over input listOn Fri, 14 Aug 2009, Krzysztof Cieniuch wrote:Hi, Short question as in subject does filter function preserves original elements order I did some tests like: org:= a b c d e res:=$(filter a d c,$(org)) $(info $(res)) and this prints a c d so it looks like it preserves order but can I relay on that or is this just coincidence in my simple example ?
but only copying elements that matched/didn't matched, nice :-) Chris
[Prev in Thread] | Current Thread | [Next in Thread] |