On 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 ?
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 list
but only copying elements that matched/didn't matched, nice :-)
Chris
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make