From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Thoughts on getting correct line numbers in the byte compiler's warning messages Date: Mon, 12 Nov 2018 15:44:48 +0000 Message-ID: <20181112154448.GB4459@ACM> References: <20181105105302.GA10520@ACM> <20181106151143.GB4030@ACM> <20181107170036.GA4934@ACM> <20181107184708.GB4934@ACM> <20181108140843.GB5041@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1542037541 12950 195.159.176.226 (12 Nov 2018 15:45:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2018 15:45:41 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Michael Heerdegen , emacs-devel@gnu.org To: Stefan Monnier , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 12 16:45:36 2018 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 1gMEPA-0003G3-Nb for ged-emacs-devel@m.gmane.org; Mon, 12 Nov 2018 16:45:36 +0100 Original-Received: from localhost ([::1]:49291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMERH-0000Fr-62 for ged-emacs-devel@m.gmane.org; Mon, 12 Nov 2018 10:47:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMEQQ-0000Fd-2o for emacs-devel@gnu.org; Mon, 12 Nov 2018 10:46:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMEQO-0000zI-6G for emacs-devel@gnu.org; Mon, 12 Nov 2018 10:46:54 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:61837 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1gMEQN-0000pR-KK for emacs-devel@gnu.org; Mon, 12 Nov 2018 10:46:51 -0500 Original-Received: (qmail 93092 invoked by uid 3782); 12 Nov 2018 15:46:29 -0000 Original-Received: from acm.muc.de (p5B147649.dip0.t-ipconnect.de [91.20.118.73]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 12 Nov 2018 16:46:28 +0100 Original-Received: (qmail 10238 invoked by uid 1000); 12 Nov 2018 15:44:48 -0000 Content-Disposition: inline In-Reply-To: <20181108140843.GB5041@ACM> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:231094 Archived-At: Hello, Stefan and Eli. A snag..... On Thu, Nov 08, 2018 at 14:08:43 +0000, Alan Mackenzie wrote: [ .... ] > One thing we'd need to watch out for is using equal, not eq, when we > compare symbols. (eq 'foo #) will surely > be nil, but (equal ....) would be t. Same with member and memq. Unfortunately, this isn't going to work. There will be macros which do things like: (cond ((eq (car form) 'bar) ....) .....) Here, (car form) is going to be #, so the eq is going to return nil. The only way out of this I can see at the moment is to amend eq (and memq, assq, delq, ....) so that it recognises a symbol with position as being eq to the bare symbol. At least when the flag variable symbols-with-pos-enabled is currently non-nil. At the implementation level, when that variable is nil (i.e. for normal running), there would be a cost of one comparison of an in-cache variable with zero on each eq operation which returns nil. This isn't pretty. If this modification of eq, memq, .... is too much to take, then I think the current approach is doomed to failure. What do you think? [ .... ] -- Alan Mackenzie (Nuremberg, Germany).