From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Brinkhoff Newsgroups: gmane.emacs.devel Subject: Re: User-defined record types Date: Tue, 14 Mar 2017 18:23:05 +0100 Organization: nocrew Message-ID: <86fuif22o6.fsf@molnjunk.nocrew.org> References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> <878tp0i74g.fsf@users.sourceforge.net> <87efyg6y0i.fsf_-_@drachen> <87zigwz9wx.fsf@tromey.com> <86bmtbd45s.fsf@molnjunk.nocrew.org> <86bmt42nk2.fsf_-_@molnjunk.nocrew.org> <86o9x40z35.fsf@molnjunk.nocrew.org> <86k27s0w6m.fsf@molnjunk.nocrew.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489512229 11600 195.159.176.226 (14 Mar 2017 17:23:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Mar 2017 17:23:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 14 18:23:42 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 1cnqAf-0002Ac-RP for ged-emacs-devel@m.gmane.org; Tue, 14 Mar 2017 18:23:41 +0100 Original-Received: from localhost ([::1]:60907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnqAl-0001wG-KZ for ged-emacs-devel@m.gmane.org; Tue, 14 Mar 2017 13:23:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnqAc-0001uk-4l for emacs-devel@gnu.org; Tue, 14 Mar 2017 13:23:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnqAX-00052Y-Dq for emacs-devel@gnu.org; Tue, 14 Mar 2017 13:23:38 -0400 Original-Received: from [195.159.176.226] (port=43160 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cnqAX-00051r-7N for emacs-devel@gnu.org; Tue, 14 Mar 2017 13:23:33 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cnqAF-0008Fb-Tk for emacs-devel@gnu.org; Tue, 14 Mar 2017 18:23:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:1KImPUVKM1qkj2PxAYjfOoAIKaY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:213026 Archived-At: Stefan Monnier writes: >> - If you don't pass the :type option to cl-defstruct, you get a >> cl-struct-FOO type tag in slot 0. > > That's right. And this symbol's value is the class object. > The same holds for EIEIO. > > These are the main candidates for use of the new `record` type. Yes, at first I tried to make cl-deftype do this by default. But I ran into problems in cl-preloaded.el and cl-generic.el. >> - If you pass :type but not :named, you don't get any type tag. > > And those should not use `record` but `vector` or `list` > depending on the :type that was specified. > >> - If you pass :type and :named, you get a type tag in slot 0, which is >> the same symbol as the struct name. > > But again, these shouldn't use `record`. Right, I just wanted to list all possible variations to gain some understanding. For example, I don't know if it makes a difference if the slot 0 type tag has the form cl-struct-FOO as is the default, or just FOO as when you specify :type. But now I know there might be.