Subject: bug#52220: 29.0.50; [PATCH] Declare struct predicates as pure functions

From: Andrea Corallo <[email-masked]>
Date: Wed, 01 Dec 2021 21:16:01 +0000

Lars Ingebrigtsen <[email-masked]> writes:

> Andrea Corallo <[email-masked]> writes:
>
>> shouldn't we declare structure predicates as pure functions?
>
> I think that's correct?  The predicates take the struct as the argument,
> so they seem like pure functions to me.  I've added Stefan to the CCs;
> perhaps there's some subtlety here I don't see.

Yes we have all conventional predicates as pure, the only difference is
that here the result of the predicate depends also on the global state.

IOW redefining a structure could change the result of a predicate, but
my guess is that we don't want to be robust against that (structs in
general AFAIK are not robust against run-time redefinition).

  Andrea