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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18494 in the body.
You can then email your comments to 18494 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Thu, 18 Sep 2014 02:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tom Tromey <tom <at> tromey.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 18 Sep 2014 02:11:02 GMT) Full text and rfc822 format available.

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

From: Tom Tromey <tom <at> tromey.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50; defclass creates undocumented *-list-p function
Date: Wed, 17 Sep 2014 20:09:57 -0600
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.

However, if it is kept, it ought to be documented.




In GNU Emacs 24.4.50.8 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9)
 of 2014-09-15 on bapiya
Repository revision: 117884 dancol <at> dancol.org-20140915050944-sqsajysnwef51f9m
Windowing system distributor `Fedora Project', version 11.0.11404000
Configured using:
 `configure --prefix=/home/tromey/Emacs/install'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  diff-auto-refine-mode: t
  which-function-mode: t
  global-auto-revert-mode: t
  desktop-save-mode: t
  erc-services-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  savehist-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t

Recent input:
n C-h f e c l <backspace> <backspace> l c o m p - - 
b a s <tab> l i <tab> <M-backspace> <M-backspace> <tab> 
<tab> C-g M-< C-h C-g C-u C-SPC C-h C-g C-x b C-g C-g 
C-g C-x b <return> , C-/ C-h C-g C-v C-h f e c l i 
p <M-backspace> e l c o m p - - s e t - <tab> l i s 
t <tab> <return> C-x 1 C-l M-{ C-f C-M-f C-M-f C-f 
C-v M-} C-M-f C-M-f C-M-f C-M-f C-M-f C-M-f C-z n C-z 
n C-a C-n C-n C-s e l C-w C-w C-w C-s C-a C-z n M-v 
M-v z n C-x C-g C-/ C-z n C-x b <return> C-f M-v M-v 
M-v M-v M-> <return> ; ; ; C-l C-a C-k C-q C-l <return> 
<return> ( d e f u n SPC e c l C-t o m p - - c o m 
p u t e - d o m i n a n c e - f r o n t i e r C-z n 
C-x b e l c o m <tab> <return> M-< C-u C-u C-n C-u 
C-u C-n C-p C-p C-v C-u C-n C-u C-n C-n C-n C-n C-n 
C-u C-p C-u C-p C-l <switch-frame> C-z n C-z n C-SPC 
C-a C-p C-p C-p C-w C-f C-x C-s C-x s C-c r C-u C-n 
p SPC q SPC q C-v C-u C-n C-u C-n p C-l C-u C-p C-u 
C-p n SPC 8 <return> SPC SPC SPC = n k SPC n C-z n 
C-h f M-p M-p <return> C-z n C-z n C-x b * C-g C-z 
n C-z n C-x 1 C-z n n n q s y M-x r e p o r t - e m 
<tab> <return>

Recent messages:
Saving file /home/tromey/DotEmacs/.bbdb...
Wrote /home/tromey/DotEmacs/.bbdb
Saving Gnus registry (857 entries) to ~/.gnus.registry.eioio...
Saving Gnus registry (size 857) to ~/.gnus.registry.eioio...done
Saving file /home/tromey/.newsrc...
Wrote /home/tromey/.newsrc
Saving /home/tromey/.newsrc.eld...
Saving file /home/tromey/.newsrc.eld...
Wrote /home/tromey/.newsrc.eld
Saving /home/tromey/.newsrc.eld...done

Load-path shadows:
/home/tromey/.emacs.d/elpa/css-mode-1.0/css-mode hides /home/tromey/Emacs/install/share/emacs/24.4.50/lisp/textmodes/css-mode
/home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /home/tromey/Emacs/install/share/emacs/24.4.50/lisp/play/bubbles

Features:
(shadow emacsbug log-view cus-edit tar-mode bbdb-sc supercite regi debug
cl-macs eieio-opt speedbar sb-image ezimage dframe help-mode dabbrev
log-edit pcvs-util copyright url-http url-gw url-auth url-queue
mailalias misearch multi-isearch mail-hist nnir find-file gnus-fun
gnus-html xml url-cache mm-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util url-parse
url-vars shr-color color shr browse-url bbdb-gui bbdb-hooks mule-util
sort smiley gnus-cite flow-fill mm-archive gnus-async gnus-bcklg qp
gnus-ml disp-table gnus-topic nndraft nnmh nnfolder utf-7 bbdb-gnus
bbdb-snarf mail-extr bbdb-com warnings cl gv gnutls network-stream
starttls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg
nntp gnus-cache gnus-registry registry eieio-base gnus-art mm-uu mml2015
epg-config mm-view mml-smime smime dig mailcap gnus-sum gnus-group
gnus-undo smtpmail sendmail gnus-start gnus-cloud nnimap nnmail
mail-source tls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range
message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader
gnus-win gnus gnus-ems nnheader mail-utils tcl autoconf autoconf-mode
make-mode smerge-mode diff-mode goto-addr python js json vc-arch vc-mtn
vc-hg vc-bzr vc-sccs vc-svn vc-cvs vc-rcs bug-reference cc-mode cc-fonts
cc-guess cc-menus cc-cmds org-element org-rmail org-mhe org-irc org-info
org-gnus org-docview doc-view jka-compr image-mode dired org-bibtex
bibtex org-bbdb org-w3m org org-macro org-footnote org-pcomplete
org-list org-faces org-entities noutline outline easy-mmode org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs vc-git
add-log flyspell ispell eldoc diminish projectile edmacro kmacro
pkg-info find-func lisp-mnt epl grep compile dash s appt diary-lib
diary-loaddefs cal-menu calendar cal-loaddefs which-func imenu minimap
autorevert filenotify desktop frameset cus-start cus-load status
erc-services erc-list erc-menu erc-join erc-ring erc-networks
erc-pcomplete pcomplete erc-track erc-match erc-button wid-edit
cl-loaddefs cl-lib erc-fill erc-stamp erc-netsplit erc-goodies erc
erc-backend erc-compat format-spec auth-source eieio byte-opt bytecomp
byte-compile cconv eieio-core gnus-util mm-util mail-prsvr
password-cache thingatpt pp advice help-fns vc-dir ewoc vc vc-dispatcher
cc-styles cc-align cc-engine cc-vars cc-defs bbdb timezone ange-ftp
comint ansi-color ring server savehist dwarf-mode-autoloads
gdb-shell-autoloads jabber-autoloads lisppaste-autoloads
pydoc-info-autoloads info-look info easymenu weblogger-autoloads package
bbdb-autoloads time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 989562 137419)
 (symbols 48 105520 6)
 (miscs 40 40605 3713)
 (strings 32 330874 35484)
 (string-bytes 1 14735697)
 (vectors 16 96901)
 (vector-slots 8 2164002 205204)
 (floats 8 554 830)
 (intervals 56 50349 2797)
 (buffers 976 308)
 (heap 1024 288009 55648))

Tom




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Sat, 20 Sep 2014 10:42:02 GMT) Full text and rfc822 format available.

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

From: David Engster <deng <at> randomsample.de>
To: Tom Tromey <tom <at> tromey.com>
Cc: 18494 <at> debbugs.gnu.org, Eric Ludlam <eric <at> siege-engine.com>
Subject: Re: bug#18494: 24.4.50;
 defclass creates undocumented *-list-p function
Date: Sat, 20 Sep 2014 12:41:25 +0200
[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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Sat, 20 Sep 2014 19:55:02 GMT) Full text and rfc822 format available.

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

From: Eric Ludlam <ericludlam <at> gmail.com>
To: David Engster <deng <at> randomsample.de>
Cc: 18494 <at> debbugs.gnu.org, Tom Tromey <tom <at> tromey.com>,
 Eric Ludlam <eric <at> siege-engine.com>
Subject: Re: bug#18494: 24.4.50;
 defclass creates undocumented *-list-p function
Date: Sat, 20 Sep 2014 15:53:58 -0400
 On 09/20/2014 06:41 AM, David Engster wrote:
> [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.

Hi,

I found that many of my programs that use EIEIO have slots that are of 
:type that is an object of some class, which is why there are base 
predicates.  Thus, if I have some object class foo, I can set to the 
:type of some other class to foo, instead of some other more complex 
type.  Having another predicate that also handles the list of objects 
that include subclasses is just handy.

David is right about the time when it was introduced, where only slots 
with a constrained :type for an object were allowed to be loaded in, 
allowing the loader to never 'eval anything, only read.

Technically, I could hand write a few of those predicates for the EDE 
loader, but I thought it would be generally useful, especially if other 
folk want to save their objects.  I'm not sure how widely used it is 
outside of EDE, semanticdb, and cogre which all have save files.  I 
certainly think it should be documented if consensus is that it stays.  
Perhaps an extra option for the defclass to add extra predicates along 
with :method-invocation-order.

Eric




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Sat, 20 Sep 2014 23:09:02 GMT) Full text and rfc822 format available.

Message #14 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: Sat, 20 Sep 2014 19:08:35 -0400
> Technically, I could hand write a few of those predicates for the EDE
> loader, but I thought it would be generally useful, especially if other folk
> want to save their objects.  I'm not sure how widely used it is outside of
> EDE, semanticdb, and cogre which all have save files.  I certainly think it
> should be documented if consensus is that it stays.  Perhaps an extra option
> for the defclass to add extra predicates along
> with :method-invocation-order.

My natural reaction is to say that those *-list-p predicates shouldn't
be automatically created, but could someone explain to me in detail
how/where they're used?
E.g. I hear it's used for types, but can't we use a type like (list foo)
instead of foo-list (or maybe (cl-every foo-p) instead of foo-list-p)?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Sat, 20 Sep 2014 23:35:02 GMT) Full text and rfc822 format available.

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

From: Eric Ludlam <ericludlam <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
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: Sat, 20 Sep 2014 19:34:03 -0400
 On 09/20/2014 07:08 PM, Stefan Monnier wrote:
>> Technically, I could hand write a few of those predicates for the EDE
>> loader, but I thought it would be generally useful, especially if other folk
>> want to save their objects.  I'm not sure how widely used it is outside of
>> EDE, semanticdb, and cogre which all have save files.  I certainly think it
>> should be documented if consensus is that it stays.  Perhaps an extra option
>> for the defclass to add extra predicates along
>> with :method-invocation-order.
> My natural reaction is to say that those *-list-p predicates shouldn't
> be automatically created, but could someone explain to me in detail
> how/where they're used?
> E.g. I hear it's used for types, but can't we use a type like (list foo)
> instead of foo-list (or maybe (cl-every foo-p) instead of foo-list-p)?
>

I recall back in the day trying something like (list foo) and not 
getting it right so I just wrote a predicate.  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, and I could 
certainly convert over to using something list (list foo).  I use those 
predicates mostly with typep.

In that case, the eieio-persistent baseclass will need to be updated to 
extract desired classes from the predicates correctly.  The other 
occurrences would be easier to swap in new values.

Eric




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Sun, 21 Sep 2014 16:21:02 GMT) Full text and rfc822 format available.

Message #20 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: Sun, 21 Sep 2014 12:20:08 -0400
> I recall back in the day trying something like (list foo) and not getting it
> right so I just wrote a predicate.  I'm not that familiar with the nuances
> of typep, but if there is now a typep built into Emacs,

Not any more than before: there was CL's `typep' and now it's been
renamed to `cl-typep'.

> EIEIO will need to remove it's local copy of an old typep, and I could
> certainly convert over to using something list (list foo).  I use
> those predicates mostly with typep.

Could someone explain (and show) to me in detail how/where these
foo-list-p are used in relation to EIEIO?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Sun, 21 Sep 2014 16:38:03 GMT) Full text and rfc822 format available.

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

From: Eric Ludlam <eric <at> siege-engine.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 18494 <at> debbugs.gnu.org, Tom Tromey <tom <at> tromey.com>,
 David Engster <deng <at> randomsample.de>
Subject: Re: bug#18494: 24.4.50;
 defclass creates undocumented *-list-p function
Date: Sun, 21 Sep 2014 12:37:02 -0400
[Message part 1 (text/plain, inline)]
On Sun, Sep 21, 2014 at 12:20 PM, Stefan Monnier <monnier <at> iro.umontreal.ca>
wrote:

>
> > EIEIO will need to remove it's local copy of an old typep, and I could
> > certainly convert over to using something list (list foo).  I use
> > those predicates mostly with typep.
>
> Could someone explain (and show) to me in detail how/where these
> foo-list-p are used in relation to EIEIO?
>
>
>
Sure, in ede/base.el, you will find these lines:

(defclass ede-project (ede-project-placeholder)
  ((subproj :initform nil
    :type list
    :documentation "Sub projects controlled by this project.
For Automake based projects, each directory is treated as a project.")
   (targets :initarg :targets
    :type ede-target-list
    :custom (repeat (object :objectcreatefcn ede-new-target-custom))
    :label "Local Targets"
    :group (targets)
    :documentation "List of top level targets in this project.")


for "targets: you will see:

:type ede-target-list

which will expand to ede-target-list-p, which is a test for a list of type
ede-target.

This also occurs semantic/db.e which tracks a list of tables, and in
cogre.el, where the graph tracks a list of graph elements.

Eric
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Fri, 17 Oct 2014 05:12:02 GMT) Full text and rfc822 format available.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Sun, 30 Jan 2022 21:22:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eric Ludlam <ericludlam <at> gmail.com>, Tom Tromey <tom <at> tromey.com>,
 Eric Ludlam <eric <at> siege-engine.com>, David Engster <deng <at> randomsample.de>,
 18494 <at> debbugs.gnu.org
Subject: Re: bug#18494: 24.4.50; defclass creates undocumented *-list-p
 function
Date: Sun, 30 Jan 2022 22:21:19 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> 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.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

This was seven years ago, and apparently defclass still creates the
undocumented -list-p functions.  Is the consensus that they should be
removed?  Perhaps we should generate them as obsolete functions, to
allow third-party usages of them to be notified?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 30 Jan 2022 21:22:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Mon, 31 Jan 2022 02:35:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eric Ludlam <ericludlam <at> gmail.com>, Tom Tromey <tom <at> tromey.com>,
 Eric Ludlam <eric <at> siege-engine.com>, David Engster <deng <at> randomsample.de>,
 18494 <at> debbugs.gnu.org
Subject: Re: bug#18494: 24.4.50; defclass creates undocumented *-list-p
 function
Date: Sun, 30 Jan 2022 21:34:31 -0500
> This was seven years ago, and apparently defclass still creates the
> undocumented -list-p functions.  Is the consensus that they should be
> removed?  Perhaps we should generate them as obsolete functions, to
> allow third-party usages of them to be notified?

AFAIK that's already what we do:

    (when eieio-backward-compatibility
      (let ((csym (intern (concat (symbol-name cname) "-list-p"))))
        (defalias csym
        [...]
        (make-obsolete csym (format
                             "use (cl-typep ... \\='(list-of %s)) instead"
                             cname)
                       "25.1")))

-- Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18494; Package emacs. (Mon, 31 Jan 2022 15:34:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eric Ludlam <ericludlam <at> gmail.com>, Tom Tromey <tom <at> tromey.com>,
 18494 <at> debbugs.gnu.org, 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: Mon, 31 Jan 2022 16:33:19 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> AFAIK that's already what we do:
>
>     (when eieio-backward-compatibility
>       (let ((csym (intern (concat (symbol-name cname) "-list-p"))))
>         (defalias csym
>         [...]
>         (make-obsolete csym (format
>                              "use (cl-typep ... \\='(list-of %s)) instead"
>                              cname)
>                        "25.1")))

Sorry; should have checked first.

Eric Ludlam <eric <at> siege-engine.com> writes:

>  Could someone explain (and show) to me in detail how/where these
>  foo-list-p are used in relation to EIEIO?
>
> Sure, in ede/base.el, you will find these lines:

[...]

> for "targets: you will see:
>
> :type ede-target-list
>
> which will expand to ede-target-list-p, which is a test for a list of type ede-target.

And this has been fixed, so I guess there's nothing to do here (beyond
removing the -list-p predicates when we start removing things obsoleted
in 25.1 in a couple of years), and I'm therefore closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 25.1, send any further explanations to 18494 <at> debbugs.gnu.org and Tom Tromey <tom <at> tromey.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 31 Jan 2022 15:34:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Mar 2022 12:24:10 GMT) Full text and rfc822 format available.

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.