Hi, Andrzej!
 
I like that you like it :)  To answer your question: no, in the example I gave (
set route_ref='$(route_ref),${ref|not-contained:,:route_ref}' | '$(route_ref)' | '${ref}';
) there will be no extra comma in case of repeating names. In such a case the first alternative in the rule cannot be applied but the second one ('$(route_ref)') can and so it fires, leaving the value unchanged.
So, if you had a string "1,2" and then get again a ref=2, after applying the filter the string would still be "1,2". If after that you get a ref=3, after applying the filter you get "1,2,3". So you don't have to worry about it.
Actually, I also miss conditional statements in apply block. But for now, as long as it's not possible, this filter could be useful in some situations.
 
Max
 
Gesendet: Mittwoch, 28. Januar 2015 um 17:01 Uhr
Von: "Andrzej Popowski" <popej@poczta.onet.pl>
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] Patch: New filter "not-contained"
Hi Max,

I like your idea, but application in style doesn't look good for me.
Wouldn't your rule add a superfluous comma, if name repeats?

What I really would like to have, are conditional statements inside
apply{} block. This could be used not only to parse name, but for
example to examine member's role in relation.

--
Best regards,
Andrzej
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev