GNU bug report logs - #52220
29.0.50; [PATCH] Declare struct predicates as pure functions

Previous Next

Package: emacs;

Reported by: Andrea Corallo <akrl <at> sdf.org>

Date: Wed, 1 Dec 2021 10:30:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrea Corallo <akrl <at> sdf.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 52220 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#52220: 29.0.50; [PATCH] Declare struct predicates as pure functions
Date: Wed, 01 Dec 2021 21:16:01 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Andrea Corallo <akrl <at> 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




This bug report was last modified 3 years and 225 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.