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, v3 Date: Mon, 03 Apr 2017 19:49:20 +0200 Organization: nocrew Message-ID: <86k271crfj.fsf@molnjunk.nocrew.org> References: <86r31gh7v5.fsf@molnjunk.nocrew.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1491241829 31379 195.159.176.226 (3 Apr 2017 17:50:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Apr 2017 17:50:29 +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 Mon Apr 03 19:50:24 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 1cv67L-0006sk-V5 for ged-emacs-devel@m.gmane.org; Mon, 03 Apr 2017 19:50:16 +0200 Original-Received: from localhost ([::1]:60513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cv67R-0001uv-WD for ged-emacs-devel@m.gmane.org; Mon, 03 Apr 2017 13:50:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cv66p-0001uc-Pl for emacs-devel@gnu.org; Mon, 03 Apr 2017 13:49:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cv66n-0002nW-4a for emacs-devel@gnu.org; Mon, 03 Apr 2017 13:49:43 -0400 Original-Received: from [195.159.176.226] (port=51657 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cv66m-0002mB-U9 for emacs-devel@gnu.org; Mon, 03 Apr 2017 13:49:41 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cv66X-0002Ea-0H for emacs-devel@gnu.org; Mon, 03 Apr 2017 19:49:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:bLSnq8HD2MsNhwN9rg6v1Ow4SY4= 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:213620 Archived-At: Lars Brinkhoff wrote: > Third review round for user-defined record types, available from the > branch scratch/record. John Wiegley has okayed this, so I'm planning to merge this within 24 hours. A full boostrap build (and testsuite run) works fine. Incremental builds can run into problems with .elc files. To be on the safe side, I usually rebuild from a clean repository, but just removing all .elc files also seems to work. > From the manual: > > The purpose of records is to allow programmers to create objects > with new types that are not built into Emacs. They are used as the > underlying representation of @code{cl-defstruct} and @code{defclass} > instances. > > Internally, a record object is much like a vector; its slots can > be accessed using @code{aref}. However, the first slot is used to > hold its type as returned by @code{type-of}. Like arrays, records > use zero-origin indexing: the first slot has index 0.