From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: new `obarray` type Date: Mon, 13 Mar 2017 13:22:20 -0400 Message-ID: References: <8360jdch3f.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489425764 9159 195.159.176.226 (13 Mar 2017 17:22:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Mar 2017 17:22:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 13 18:22:40 2017 Return-path: Envelope-to: ged-emacs-devel@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 1cnTg0-0001GQ-CF for ged-emacs-devel@m.gmane.org; Mon, 13 Mar 2017 18:22:32 +0100 Original-Received: from localhost ([::1]:53492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnTg6-0006h4-Gr for ged-emacs-devel@m.gmane.org; Mon, 13 Mar 2017 13:22:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnTfx-0006fi-HI for emacs-devel@gnu.org; Mon, 13 Mar 2017 13:22:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnTfw-0004pX-Mj for emacs-devel@gnu.org; Mon, 13 Mar 2017 13:22:29 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:63646) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cnTfq-0004kC-Nf; Mon, 13 Mar 2017 13:22:22 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DjCgBY1MZY/9TkSC1dGwEBAQMBAQEJAQEBg1FBihOFeJBdKQGXH4YcBAICgl5DFQECAQEBAQEBAWsohRYBBAFWIwULCzQSFBgNJIoLCLBUilMBAQEHAiaLPYo5BY9bhiWGQZQ0iEgyhjCTQzUigQQjFggshRcegX8kiggBAQE X-IPAS-Result: A0DjCgBY1MZY/9TkSC1dGwEBAQMBAQEJAQEBg1FBihOFeJBdKQGXH4YcBAICgl5DFQECAQEBAQEBAWsohRYBBAFWIwULCzQSFBgNJIoLCLBUilMBAQEHAiaLPYo5BY9bhiWGQZQ0iEgyhjCTQzUigQQjFggshRcegX8kiggBAQE X-IronPort-AV: E=Sophos;i="5.36,160,1486443600"; d="scan'208";a="295175593" Original-Received: from 45-72-228-212.cpe.teksavvy.com (HELO pastel.home) ([45.72.228.212]) by smtp.teksavvy.com with ESMTP; 13 Mar 2017 13:22:21 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id B80B861DC0; Mon, 13 Mar 2017 13:22:20 -0400 (EDT) In-Reply-To: <8360jdch3f.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 13 Mar 2017 17:49:08 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:212992 Archived-At: >> The patch below introduces a new type for obarrays, distinct >> from vectors. Among other things, this makes it possible to print them >> in a more useful way (it doesn't print the contents, only the size, so >> the printed form is not computer-readable, but it's more >> palatable to the user). >> Printing obarrays in a `read`able way seems like something that should >> be under the control of variable, since it's unclear in general what it >> would mean (for abbrev-tables, it would probably mean to print the name >> of every symbol, along with it value, function, and plist slots, but >> doing that for the `obarray` variable doesn't seem right (and it's not >> even clear what the `value` of each symbol in it should be, for >> buffer-local symbols)). > Let me be the devil's advocate: are there any clients of this change > other than abbrev-tables defined during the build time? Actually, this change doesn't even solve the problem of dumping&reloading abbrev-tables. I think we'd be better off reimplementing abbrev tables using something like hash-tables. IOW, while this new obarray type was inspired by the work on dumping Emacs, it doesn't really attempt to solve that problem. All this does, really, instead is to provide a separate type so that cl-defmethod can dispatch on it, and so we can print it in a human-readable way and using the usual #<...> notation that makes it clear that the output is not `read`able. > Because if they are the only justification, then it's much easier to > define them in startup.el instead, which will make the problem go > away. Right? Definitely. Stefan