[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#52220: 29.0.50; [PATCH] Declare struct predicates as pure functions
From: |
Andrea Corallo |
Subject: |
bug#52220: 29.0.50; [PATCH] Declare struct predicates as pure functions |
Date: |
Wed, 01 Dec 2021 21:16:01 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Andrea Corallo <akrl@sdf.org> 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