GNU bug report logs - #18494
24.4.50; defclass creates undocumented *-list-p function

Previous Next

Package: emacs;

Reported by: Tom Tromey <tom <at> tromey.com>

Date: Thu, 18 Sep 2014 02:11:02 UTC

Severity: minor

Tags: moreinfo

Found in version 24.4.50

Fixed in version 25.1

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

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eric Ludlam <ericludlam <at> gmail.com>
Cc: 18494 <at> debbugs.gnu.org, Tom Tromey <tom <at> tromey.com>,
 David Engster <deng <at> randomsample.de>, Eric Ludlam <eric <at> siege-engine.com>
Subject: Re: bug#18494: 24.4.50;
 defclass creates undocumented *-list-p function
Date: Fri, 17 Oct 2014 01:11:39 -0400
> I recall back in the day trying something like (list foo) and not getting it
> right so I just wrote a predicate.

It think that

(cl-deftype list-of (elem-type)
  `(and list
        (satisfies (lambda (list)
                     (cl-every (lambda (elem) (cl-typep elem ',elem-type))
                               list)))))

should work.  I added this definition to eieio-core.el in Emacs's trunk.

> I'm not that familiar with the nuances of typep, but if there is now
> a typep built into Emacs, EIEIO will need to remove it's local copy of
> an old typep,

I removed eieio--typep and used cl-typep instead (one of the benefits
of cl-lib is that it's OK to load it at run time).

> and I could certainly convert over to using something list (list foo).

Please try it.


        Stefan




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

Previous Next


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