GNU bug report logs - #50214
28.0.50; cl-struct changes may affect user packages in the wild

Previous Next

Package: emacs;

Reported by: Adam Porter <adam <at> alphapapa.net>

Date: Thu, 26 Aug 2021 16:48:01 UTC

Severity: normal

Tags: moreinfo

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 50214 <at> debbugs.gnu.org (full text, mbox):

From: Philipp <p.stephani2 <at> gmail.com>
To: Adam Porter <adam <at> alphapapa.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 50214 <at> debbugs.gnu.org
Subject: Re: bug#50214: 28.0.50; cl-struct changes may affect user packages in
 the wild
Date: Sat, 4 Sep 2021 19:37:18 +0200

> Am 26.08.2021 um 22:52 schrieb Adam Porter <adam <at> alphapapa.net>:
> 
> On Thu, Aug 26, 2021 at 2:37 PM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>> 
>> I'm not very familiar with the internals of cl-struct, but if I
>> understand correctly, I think this is...  well...  an internal thing
>> that package writers should expect to change, so they shouldn't rely on
>> things like this.
> 
> Unfortunately, I know of no other way to implement what ts.el does
> without modifying the accessors, which requires accessing the internal
> struct details after it is defined.

I haven't checked the code in detail, but AIUI ts.el tries to initialize structure members lazily?  Why not just use a wrapper function for that?

(defun ts-hour (ts)
  (or (ts--hour ts)
      (setf (ts--hour ts) (string-to-number (format-time-string "%H" (ts-unix ts)))))

Here ts--hour is the actual accessor, which is private and shouldn't be used outside of ts.el.





This bug report was last modified 2 years and 274 days ago.

Previous Next


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