From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Towards a cleaner build: eieio Date: Fri, 14 Jun 2019 09:52:07 -0400 Message-ID: References: <83a7eo9nsh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="174539"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 14 16:35:25 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hbnIW-000j5L-87 for ged-emacs-devel@m.gmane.org; Fri, 14 Jun 2019 16:35:20 +0200 Original-Received: from localhost ([::1]:52136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbnIV-0006uZ-08 for ged-emacs-devel@m.gmane.org; Fri, 14 Jun 2019 10:35:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50371) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbmcs-0001JQ-9L for emacs-devel@gnu.org; Fri, 14 Jun 2019 09:52:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbmcr-0006OI-B4 for emacs-devel@gnu.org; Fri, 14 Jun 2019 09:52:18 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:32653) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbmcq-0006MC-KC for emacs-devel@gnu.org; Fri, 14 Jun 2019 09:52:17 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1D2CF443830; Fri, 14 Jun 2019 09:52:13 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DBBF744382E; Fri, 14 Jun 2019 09:52:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1560520331; bh=rhRzVNHF+7TZ1z4e5bNsusdPTf1U2IGiPpU612pho+s=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=G0jzElMe9VvUsAU9fifQPA+/EMNOFhehNlXGUoH2ATzE+qv9RFMRhegX+NBw8w2E6 r8Fgwp89gU4oNd1i75rDpomANtnw6kNXsuEWsCy3ecWikoe+6gyB4gF80NaE2NS7J6 kdXeYouLXnwDzRXrjjY+/tey2Sqx23rZZkf8rrDP30oLlusatVHA59ql5j6AQbX3LM udi1jMW2ceH0Ef3WUm5eYcjo7zAD6nhkbtJ5qobAINYB4cK7++nATp/RJs4+V8igR2 tKUwcRfvh8A3XDCrS2mMLD4XgRtaNFo2imJbmBPeU+VKjNgabQJOiYBhYY35ZpQWma yPBCbYrQvT/7A== Original-Received: from alfajor (cm-84.215.66.78.getinternet.no [84.215.66.78]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4368E12078A; Fri, 14 Jun 2019 09:52:11 -0400 (EDT) In-Reply-To: (Lars Ingebrigtsen's message of "Fri, 14 Jun 2019 14:11:09 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:237614 Archived-At: >>> (cl-defmethod cl-print-object ((object eieio-default-superclass) stream) >>> "Default printer for EIEIO objects." >>> ;; Fallback to the old `object-print'. >>> (princ (object-print object) stream)) >> >> This is backward compatibility for those packages that define an >> `object-print` method on their own eieio classes (instead of a method >> on cl-print-object). > > Yes, but what I wandered was about the call to `object-print'. It seems > like the definition of object-print here is kinda trivial: > > (cl-defmethod object-print ((this eieio-default-superclass) &rest strings) > > [...] > > (eieio-object-name this (apply #'concat strings))) This is just the default definition. Packages can add their own methods to it. > So couldn't cl-print-object just say > > (eieio-object-name object) > > instead of > > (object-print object) That wouldn't obey the methods added to object-print. Stefan