bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18494: 24.4.50; defclass creates undocumented *-list-p function


From: Stefan Monnier
Subject: bug#18494: 24.4.50; defclass creates undocumented *-list-p function
Date: Fri, 17 Oct 2014 01:11:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]