From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Ludlam Newsgroups: gmane.emacs.bugs Subject: bug#18494: 24.4.50; defclass creates undocumented *-list-p function Date: Sat, 20 Sep 2014 15:53:58 -0400 Message-ID: <541DDB56.1020000@gmail.com> References: <87a95xvfuy.fsf@tromey.com> <87bnqavaju.fsf@engster.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1411243877 16141 80.91.229.3 (20 Sep 2014 20:11:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Sep 2014 20:11:17 +0000 (UTC) Cc: 18494@debbugs.gnu.org, Tom Tromey , Eric Ludlam To: David Engster Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 20 22:11:10 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XVQzu-0004LU-1v for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Sep 2014 22:11:10 +0200 Original-Received: from localhost ([::1]:35884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVQzt-0006kn-J5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Sep 2014 16:11:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVQzj-0006bz-Sr for bug-gnu-emacs@gnu.org; Sat, 20 Sep 2014 16:11:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XVQzc-0000Yi-D9 for bug-gnu-emacs@gnu.org; Sat, 20 Sep 2014 16:10:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVQzc-0000Xa-9F for bug-gnu-emacs@gnu.org; Sat, 20 Sep 2014 16:10:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XVQkI-0004oQ-HD for bug-gnu-emacs@gnu.org; Sat, 20 Sep 2014 15:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Ludlam Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Sep 2014 19:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18494 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18494-submit@debbugs.gnu.org id=B18494.141124284418417 (code B ref 18494); Sat, 20 Sep 2014 19:55:02 +0000 Original-Received: (at 18494) by debbugs.gnu.org; 20 Sep 2014 19:54:04 +0000 Original-Received: from localhost ([127.0.0.1]:46849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XVQjL-0004my-TJ for submit@debbugs.gnu.org; Sat, 20 Sep 2014 15:54:04 -0400 Original-Received: from mail-qg0-f46.google.com ([209.85.192.46]:58459) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XVQjJ-0004mW-PX for 18494@debbugs.gnu.org; Sat, 20 Sep 2014 15:54:02 -0400 Original-Received: by mail-qg0-f46.google.com with SMTP id q108so1337273qgd.33 for <18494@debbugs.gnu.org>; Sat, 20 Sep 2014 12:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=MSC0iC9ejQ1eGvESVS46ySMiyCB9ZNQ2hMiDSpcVaVM=; b=cnD6pmNdDFnR2cUdt9i/LLmncPtkGzPxi4T6+Yi5HGiMHCqnmWg/eIhIvWYZ3gNuQg Mx42lmaKrWknnogtl7s9zxDVfhu6TbJF/BAwLIc5WNgP9K6OOy8wt1NJPRvtEItWTAHN 0WFd3nZOGG/vmpHZ3BJoZBoX3CH/L/XjkRfac7dIveb8lrNyclwO8TLuN8dhnDZv0LoD W4kAd2Hd7KCiPPhDWeLBzJ8i7YW12jNQ36cOplYnnaJK06Q/ylTvTf/sQGZRW2My4zIu RuUSg3BDpTiyZpgJGDNi8nS2z+onu6v+hwChRS9pWDDazca9OTWkYN2hURlIK8X5xNjn /EOw== X-Received: by 10.140.97.247 with SMTP id m110mr10887507qge.80.1411242840980; Sat, 20 Sep 2014 12:54:00 -0700 (PDT) Original-Received: from [192.168.1.201] (pool-71-184-209-46.bstnma.fios.verizon.net. [71.184.209.46]) by mx.google.com with ESMTPSA id 96sm4228640qgf.20.2014.09.20.12.53.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Sep 2014 12:54:00 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.3a1pre) Gecko/20091222 Shredder/3.1a1pre In-Reply-To: <87bnqavaju.fsf@engster.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93555 Archived-At: 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