From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: User-defined record types, v2 Date: Sat, 18 Mar 2017 19:35:24 +0200 Message-ID: <8337eaxzc3.fsf@gnu.org> References: <86y3w2tt2n.fsf@molnjunk.nocrew.org> <86tw6qtt01.fsf@molnjunk.nocrew.org> <86k27mtsnv.fsf@molnjunk.nocrew.org> <86fuiatsh3.fsf@molnjunk.nocrew.org> <86bmsyts9f.fsf@molnjunk.nocrew.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1489858597 17807 195.159.176.226 (18 Mar 2017 17:36:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 18 Mar 2017 17:36:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Brinkhoff Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 18 18:36:33 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 1cpIHF-0003lK-8z for ged-emacs-devel@m.gmane.org; Sat, 18 Mar 2017 18:36:29 +0100 Original-Received: from localhost ([::1]:54197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpIHL-0005Hp-2c for ged-emacs-devel@m.gmane.org; Sat, 18 Mar 2017 13:36:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpIGe-0005Hj-8E for emacs-devel@gnu.org; Sat, 18 Mar 2017 13:35:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpIGb-0000Ai-38 for emacs-devel@gnu.org; Sat, 18 Mar 2017 13:35:52 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpIGa-0000Ae-W7; Sat, 18 Mar 2017 13:35:49 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2232 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cpIGZ-0007WD-PN; Sat, 18 Mar 2017 13:35:48 -0400 In-reply-to: <86bmsyts9f.fsf@molnjunk.nocrew.org> (message from Lars Brinkhoff on Sat, 18 Mar 2017 18:21:48 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:213138 Archived-At: > From: Lars Brinkhoff > Date: Sat, 18 Mar 2017 18:21:48 +0100 > > +static const char *old_struct_prefix = "cl-struct-"; > +static int old_struct_prefix_length; > + > +static int > +vector_struct_p (Lisp_Object object) > +{ > + if (! old_struct_compat || ASIZE (object) < 1) > + return false; > + > + Lisp_Object type = AREF (object, 0); > + return SYMBOLP (type) > + && strncmp (SDATA (SYMBOL_NAME (type)), > + old_struct_prefix, > + old_struct_prefix_length) == 0; Why not make old_struct_prefix be an array, and then use sizeof instead of computing the length of the string at dump time? > + DEFVAR_BOOL ("old-struct-compat", old_struct_compat, > + doc: /* Non-nil means hack for old structs is in effect. */); This doc string should explain more about the effect of this variable. Thanks.