Re: [exim] 4.96 reduce not working

Top Page
Delete this message
Reply to this message
Author: Jeremy Harris
Date:  
To: exim-users
Subject: Re: [exim] 4.96 reduce not working
On 21/09/2022 06:21, Jasen Betts via Exim-users wrote:
> I was using the follwing form to see how many elements of list 1 occur in list2
>
>
> ${reduce{ a:p:p:l:e }{0}{${if inlisti{$item}{ p:e:z }{${eval:$value+1}}{$value}}}}
>
> but this has stopped working in 4.96


To be fair, it wouldn't have worked with anything else rather
than inlisti which left a result in $value.

But... it's unfriendly, and therefore a bug.

We could code to ensure that
the $value used for the update operation of the reduce was always
the one before the condition was evaluated - but then one couldn't
ever use that nested result $value.

We could code to stack $value during each evaluation of the condition
for the reduce. That feels better. I'll have a go.


[ There's actually a worse bug floating around here. I managed to
trip an internal check on memory use, trying to invent an alternate
using filter & listcount. ]
--
Cheers,
Jeremy