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: David Engster
Subject: bug#18494: 24.4.50; defclass creates undocumented *-list-p function
Date: Sat, 20 Sep 2014 12:41:25 +0200
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.93 (gnu/linux)

[add CC Eric]

Tom Tromey writes:
> Try:
>
> (defclass zzz-whatever () ((hi)))
>
> Now notice there is a new function:
>
> (symbol-function 'zzz-whatever-list-p)
> (lambda (obj) "Test OBJ to see if it a list of objects which are a child of 
> type zzz-whatever" (when (listp obj) (let ((ans t)) (while (and obj ans) 
> (setq ans (and (eieio-object-p (car obj)) (object-of-class-p (car obj) 
> zzz-whatever))) (setq obj (cdr obj))) ans)))
>
>
> This new -list-p function is not documented in the EIEIO manual.
>
> It seems to me that it would be a bit better not to define it.
> It doesn't seem generally useful enough, to me.

I agree it's not generally useful. It was added as a helper function to
validate a slot which should hold a list of objects (as part of the
EIEIO/EDE security fix for Emacs 23.4).

At least that's what I remember. I was under the impression that
eieio-persistent-validate/fix-slot-value would use this, but I cannot
see it; maybe it's just hidden very well. If it is not used, I'd agree
that it should better be removed or at least renamed to X--list-p.

Eric, WDYT?

-David





reply via email to

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