From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#28489: Acknowledgement (27.0.50; eieio-persistent slot type validation should be a bit smarter) Date: Wed, 27 Sep 2017 09:39:07 -0700 Message-ID: <87ing4cd04.fsf@ericabrahamsen.net> References: <87lglcn8dt.fsf@ericabrahamsen.net> <878th1i50l.fsf@ericabrahamsen.net> <87wp4lf1kq.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1506530412 29317 195.159.176.226 (27 Sep 2017 16:40:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 27 Sep 2017 16:40:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: 28489@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 27 18:40:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxFNW-00074j-23 for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Sep 2017 18:40:06 +0200 Original-Received: from localhost ([::1]:55572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxFNb-0002TD-Sc for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Sep 2017 12:40:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxFNW-0002T8-5Z for bug-gnu-emacs@gnu.org; Wed, 27 Sep 2017 12:40:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxFNT-00033S-0r for bug-gnu-emacs@gnu.org; Wed, 27 Sep 2017 12:40:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54757) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dxFNS-00033O-SY for bug-gnu-emacs@gnu.org; Wed, 27 Sep 2017 12:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dxFNS-0002WZ-CV for bug-gnu-emacs@gnu.org; Wed, 27 Sep 2017 12:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Sep 2017 16:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28489 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28489-submit@debbugs.gnu.org id=B28489.15065303519643 (code B ref 28489); Wed, 27 Sep 2017 16:40:02 +0000 Original-Received: (at 28489) by debbugs.gnu.org; 27 Sep 2017 16:39:11 +0000 Original-Received: from localhost ([127.0.0.1]:35205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxFMc-0002VT-PO for submit@debbugs.gnu.org; Wed, 27 Sep 2017 12:39:10 -0400 Original-Received: from mail.ericabrahamsen.net ([50.56.99.223]:44245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxFMb-0002VK-0r for 28489@debbugs.gnu.org; Wed, 27 Sep 2017 12:39:09 -0400 Original-Received: from localhost (71-35-182-76.tukw.qwest.net [71.35.182.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 375E5C0443; Wed, 27 Sep 2017 16:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1506530348; bh=w+i15DoWIvv4l1+VRIcms97z5ShNqxaF57Xbf+s72TI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=GyE1ePlkMPkHqobStv/UVmv8nactYPAFnJuZ/LdrIlaIstft8tjLLb6hN+leFxS8X l3nTEmEjdffVhg7mQ0MoODb0E9hKI/fMQoS7gU//Alb93zD1J2nKs+eIFUx9sCg8N+ iElgKvAT9njN0e9k/F7jciQgTQ9O10QIyO6cnu/o= In-Reply-To: <87wp4lf1kq.fsf@users.sourceforge.net> (Noam Postavsky's message of "Tue, 26 Sep 2017 20:05:25 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:137505 Archived-At: On 09/26/17 20:05 PM, Noam Postavsky wrote: > Eric Abrahamsen writes: > >> ((eq (car-safe type) 'or) >> - ;; If type is a list, and is an or, it is possibly something >> - ;; like (or null myclass), so check for that. >> - (let ((ans nil)) >> - (dolist (subtype (cdr type)) >> - (setq ans (eieio-persistent-slot-type-is-class-p >> - subtype))) >> - ans)) >> + ;; If type is a list, and is an or, it is possible that >> + ;; multiple classes are acceptable, find them all. >> + (seq-filter (lambda (elt) (class-p elt)) (cdr type))) > > You seem to have removed some recursion here, is that correct? If yes, > probably something worth explaining in the commit message. > > Minor nitpicks: > - The lambda could be replaced with just #'class-p. > - The indentation has a mix of tabs and spaces. That was a dumb mistake! My only excuse is that this was just a quick code sketch for purposes of discussion. That's my story... It should be: (seq-filter #'eieio-persistent-slot-type-is-class-p (cdr type)) This whole section of code, `eieio-persistent-validate/fix-slot-value' and its neighbors, feels very seat-of-the-pants to me. I wish `cl-typep' could handle more of this work. But in the meantime this patch (or something like it) would at least address the actual bug. I don't think the tabs were my fault! What's Emacs policy on this?