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: Should records be able to mimic primitive types? Date: Mon, 12 Jun 2017 13:15:35 -0400 Message-ID: References: <8777899d-ca8e-212c-b8bf-2f8da4c54836@cs.ucla.edu> <83zidg57xv.fsf@gnu.org> <83tw3l3zv4.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1497287809 2814 195.159.176.226 (12 Jun 2017 17:16:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Jun 2017 17:16:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 12 19:16:45 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 1dKSxJ-0000Ew-Ff for ged-emacs-devel@m.gmane.org; Mon, 12 Jun 2017 19:16:45 +0200 Original-Received: from localhost ([::1]:39262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKSxJ-0000qS-Jb for ged-emacs-devel@m.gmane.org; Mon, 12 Jun 2017 13:16:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKSwQ-0000pA-AX for emacs-devel@gnu.org; Mon, 12 Jun 2017 13:15:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKSwL-00008y-BS for emacs-devel@gnu.org; Mon, 12 Jun 2017 13:15:50 -0400 Original-Received: from [195.159.176.226] (port=50577 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dKSwL-00008h-3m for emacs-devel@gnu.org; Mon, 12 Jun 2017 13:15:45 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dKSwC-0005U7-5K for emacs-devel@gnu.org; Mon, 12 Jun 2017 19:15:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:2eMYoOERLUqc1NnFn7vRwZJIk2k= 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:215595 Archived-At: > If some usage is unequivocally wrong, can never support legitimate use > cases, and the defenses are not too expensive, then I think this could > be okay. But we need to be careful not to disallow legitimate, though > perhaps somewhat dangerous practices. Emacs's tradition is to trust > the Lisp programmers not to shoot themselves in the foot, so we > generally prefer to err on that side of the line, when in doubt. > Punishing the innocent on behalf of possibly guilty is something I > think we should try to avoid. I think the kind of added checks he's thinking of are "safe" in this respect. The reason why I disagree with them is because they are too costly compared to the likelihood they'll ever help catch a bug (either because they'd virtually never trigger except maybe during experimentation, and in the unlikely event that they do trigger, the problem they discover would quickly lead to lots of other problems anyway). We generally don't check every imaginable meaningless circumstance, but only those that we've found to occur often enough to warrant the runtime and maintenance cost of an extra test. E.g. the byte-compiler doesn't emit a warning when you try to compile an expression like (+ 'b x). Stefan