From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: false warnings when compiling with lexical-binding and cl-lib. Date: Sun, 24 Nov 2013 13:08:35 -0500 Message-ID: References: <8761rl6ael.fsf@gmail.com> <87ob5bzlvr.fsf@gmail.com> <87d2lrunbg.fsf@gmail.com> <878uwfulw5.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1385316530 16091 80.91.229.3 (24 Nov 2013 18:08:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Nov 2013 18:08:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 24 19:08:55 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vke74-00020W-AH for ged-emacs-devel@m.gmane.org; Sun, 24 Nov 2013 19:08:54 +0100 Original-Received: from localhost ([::1]:48062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vke73-0006Qn-R4 for ged-emacs-devel@m.gmane.org; Sun, 24 Nov 2013 13:08:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vke6u-0006Jj-2m for emacs-devel@gnu.org; Sun, 24 Nov 2013 13:08:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vke6m-0007nQ-Qg for emacs-devel@gnu.org; Sun, 24 Nov 2013 13:08:44 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:12477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vke6m-0007nL-Ma for emacs-devel@gnu.org; Sun, 24 Nov 2013 13:08:36 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+K4R/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAs0EhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFHO+K4R/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAs0EhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="40288858" Original-Received: from 206-248-174-17.dsl.teksavvy.com (HELO pastel.home) ([206.248.174.17]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 24 Nov 2013 13:08:36 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 9BD1C60021; Sun, 24 Nov 2013 13:08:35 -0500 (EST) In-Reply-To: <878uwfulw5.fsf@gmail.com> (Thierry Volpiatto's message of "Sat, 23 Nov 2013 17:24:10 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165658 Archived-At: >> Also the warning is only at compile time, should we return an error on >> evaluation ? I don't see why we should bother with an error. (let* ((a 1) (a 2)) ...) is not very useful, but it's not an error. The warning we currently have is not perfect because it applies to the post-macroexpansion code, so the user may not immediately understand what's going on, but your suggested patch has the following downsides: - it breaks previously working code. - it does not tell you where (approximate line number) the error is located. So if we want to improve on the current code, I think rather than `cl-assert' we should use macroexp--warn-and-return (grep for it to see sample uses). But the patch won't be as trivial. Stefan