Re: [exim] 4.96 reduce not working

2022-09-24 Thread Jasen Betts via Exim-users



On 2022-09-22, Jeremy Harris via Exim-users  wrote:
>
> a3d3e7ef81 (just pushed) fixes this.
>
> Given the fix, does
>
>${listcount:${filter {a:p:p:l:e} {inlisti{$item}{ p:e:z 
>
> look plausible?

Yes, that looks good. 

-- 
  Jasen.

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


Re: [exim] 4.96 reduce not working

2022-09-22 Thread Jeremy Harris via Exim-users

On 22/09/2022 13:48, Jeremy Harris via Exim-users wrote:

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


Turn out that's not sufficient.  The issue is not that
the inlisti-output $value mucks up reduce, but that it hides
the reduce's $value from the yes/no evaluations of the ${if.



[ 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. ]


a3d3e7ef81 (just pushed) fixes this.

Given the fix, does

  ${listcount:${filter {a:p:p:l:e} {inlisti{$item}{ p:e:z 

look plausible?
--
Cheers,
  Jeremy


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


Re: [exim] 4.96 reduce not working

2022-09-22 Thread Jeremy Harris via Exim-users

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


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/