GNU bug report logs - #36407
27.0.50; `plist-get', `equal' etc. and circular "lists"

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Thu, 27 Jun 2019 21:45:02 UTC

Severity: minor

Found in version 27.0.50

Done: Pip Cet <pipcet <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pip Cet <pipcet <at> gmail.com>
To: 36407 <at> debbugs.gnu.org
Subject: bug#36407: 27.0.50; `plist-get', `equal' etc. and circular "lists"
Date: Thu, 27 Jun 2019 21:43:32 +0000
[Message part 1 (text/plain, inline)]
plist-get currently contains this code:

  FOR_EACH_TAIL_SAFE (tail)
    {
      <check for success>
      tail = XCDR (tail);
      if (EQ (tail, li.tortoise))
        break;
    }

I don't understand why the last two lines are there. They're
unnecessary for proper plists; for circular plists, they result in
unintuitive behavior; and they depend on details of the
FOR_EACH_TAIL_SAFE implementation.

Can someone enlighten me?

As a tangential issue, shouldn't `equal' be symmetric?

(let* ((l1 '#1=(0 1 2 . #1#))
       (l2 '(0 1 2 0 1 2 . #1#)))
  (equal l2 l1) => t
  (equal l1 l2) => "List contains a loop" error.
  (plist-get l2 1) => 2
  (plist-get l1 1) => nil

Patches attached.
[0001-Remove-unnecessary-tortoise-checks.patch (text/x-patch, attachment)]
[0001-Make-equal-symmetric.patch (text/x-patch, attachment)]

This bug report was last modified 6 years and 22 days ago.

Previous Next


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