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 15:28:33 +0100 Organization: nocrew Message-ID: <86k27s0w6m.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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489502350 5831 195.159.176.226 (14 Mar 2017 14:39:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Mar 2017 14:39:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cc: tom@tromey.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 14 15:39:06 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 1cnnbM-0000pc-34 for ged-emacs-devel@m.gmane.org; Tue, 14 Mar 2017 15:39:04 +0100 Original-Received: from localhost ([::1]:59812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnnbS-0007fz-8e for ged-emacs-devel@m.gmane.org; Tue, 14 Mar 2017 10:39:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnnRI-00045V-W9 for emacs-devel@gnu.org; Tue, 14 Mar 2017 10:28:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnnRG-0002A6-By for emacs-devel@gnu.org; Tue, 14 Mar 2017 10:28:41 -0400 Original-Received: from molnjunk.nocrew.org ([178.18.91.250]:48321) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cnnRG-00029n-6N for emacs-devel@gnu.org; Tue, 14 Mar 2017 10:28:38 -0400 Original-Received: from lars by molnjunk.nocrew.org with local (Exim 4.76) (envelope-from ) id 1cnnRB-0004Cg-JT; Tue, 14 Mar 2017 15:28:33 +0100 In-Reply-To: <86o9x40z35.fsf@molnjunk.nocrew.org> (Lars Brinkhoff's message of "Tue, 14 Mar 2017 14:25:50 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 178.18.91.250 X-Mailman-Approved-At: Tue, 14 Mar 2017 10:39:06 -0400 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:213018 Archived-At: > If you pass (:named foo) to cl-defstruct, foo will be put in list or > vector slot 0, so I suppose that should work for records too. > > If you don't use the :named option, it seems there will be no type > information in the instances. I see now this is wrong, and there are more cases to consider. This is the situation as of now: - If you don't pass the :type option to cl-defstruct, you get a cl-struct-FOO type tag in slot 0. - If you pass :type but not :named, you don't get any type tag. - If you pass :type and :named, you get a type tag in slot 0, which is the same symbol as the struct name.