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: make-record Date: Sat, 23 Dec 2017 10:53:29 -0500 Message-ID: References: <20171211213729.41411-1-phst@google.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1514044393 25896 195.159.176.226 (23 Dec 2017 15:53:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 23 Dec 2017 15:53:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: p.stephani2@gmail.com, npostavs@users.sourceforge.net, emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 23 16:53:09 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 1eSm6e-0005tk-Qu for ged-emacs-devel@m.gmane.org; Sat, 23 Dec 2017 16:53:00 +0100 Original-Received: from localhost ([::1]:47514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSm8d-0001C1-7u for ged-emacs-devel@m.gmane.org; Sat, 23 Dec 2017 10:55:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSm7g-0000bC-8m for emacs-devel@gnu.org; Sat, 23 Dec 2017 10:54:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSm7f-0001Iq-JB for emacs-devel@gnu.org; Sat, 23 Dec 2017 10:54:04 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:55027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSm7a-0001Dp-1V; Sat, 23 Dec 2017 10:53:58 -0500 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id vBNFrrko025641; Sat, 23 Dec 2017 10:53:54 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 89BA266367; Sat, 23 Dec 2017 10:53:29 -0500 (EST) In-Reply-To: (Richard Stallman's message of "Sat, 23 Dec 2017 09:56:08 -0500") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6186=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6186> : inlines <6281> : streams <1773954> : uri <2556128> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:221387 Archived-At: > So how about making 'make-record' validate the type, > and having another function 'make-record-fast' which doesn't validate? > I think this gets the best of both worlds. No program uses directly `make-record` (or `record` for that matter). They are used internally by cl-lib and eieio to implement cl-defstruct and eieio's defclass. So, `make-record` and `record` should be of the "fast" kind, since the extra check can be in defclass and cl-defstruct (where it's very cheap anyway). Stefan