[exim] Re: Reduce & inlist

Top Page
Delete this message
Reply to this message
Author: Slavko
Date:  
To: exim-users
Subject: [exim] Re: Reduce & inlist
Dňa 28. februára 2024 18:07:47 UTC používateľ Ian Z via Exim-users <exim-users@???> napísal:

>I have no real solution, but as tricky as it seems to be, I think a
>new built-in expansion operator to uniquify a list would be a good
>thing.


I found solution (workaround) -- move $value outside of inlist:

    INLIST = inlist{$item}{<,$value}
    APPEND = ${if def:value {, $item}{$item}}

    ${reduce {<, item1, item2, item1, item2, item3}\
             {}\
             {$value${if INLIST {}{APPEND}}}\
    }

My test shows that it works, but i am not sure if some problem
is not hidden in it. Comments please?

regards


-- 
Slavko
https://www.slavino.sk/


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/