From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Time to merge scratch/correct-warning-pos into master, perhaps? Date: Fri, 04 Feb 2022 20:54:20 +0200 Message-ID: <83a6f631k3.fsf@gnu.org> References: <058b682b11f58780b580@heytings.org> <83v8y8ij39.fsf@gnu.org> <6a5bb5a08b3d764611f9@heytings.org> <6a5bb5a08b6337d733c5@heytings.org> <83leyq3kfk.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20100"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, mattiase@acm.org, gregory@heytings.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 04 20:38:57 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nG4Q4-00054d-8u for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Feb 2022 20:38:56 +0100 Original-Received: from localhost ([::1]:50126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nG4Q3-0008GJ-91 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Feb 2022 14:38:55 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nG3lQ-0006p7-8m for emacs-devel@gnu.org; Fri, 04 Feb 2022 13:57:07 -0500 Original-Received: from [2001:470:142:3::e] (port=56708 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nG3jV-0005gf-3x; Fri, 04 Feb 2022 13:56:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9NayA2mwgcbBm0mTD8OnSFqbMSedTbHM6nv8aqIkClE=; b=gWM/0tO0gsxe ARhGx4hKGZ6ZjfA+rZLZoPpb5M3NdFMCVTE5KLFuP6tIOZIO+fkio93k9UFScnGxRmAtb6GN3RNCV cIejwzJKokoSjit6dChpweCnoDmHBMuhbv5eOIwezP9sxfmRQ9aPYwjoLjrQYBW5UWSjL5gsiuQpj jX+LGd48PNQ/lASu/s6LXyRfUQSi2G6d9cUQurkKQJBNrTYcKCwGa/9Wqz8Xt+FcwCsXQG9mBlhoW bDP/uxjzm3+mUG7GovM3IjTXn5MkZXRIGUt27PE0OjmtyrM99/OLSpwkuvZyap6p92cj6d8UCln3K /2z9NP/IVXzuZRNJ8+HyYA==; Original-Received: from [87.69.77.57] (port=1081 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nG3j2-0005vi-9Z; Fri, 04 Feb 2022 13:54:56 -0500 In-Reply-To: (message from Alan Mackenzie on Fri, 4 Feb 2022 18:31:01 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:285868 Archived-At: > Date: Fri, 4 Feb 2022 18:31:01 +0000 > Cc: gregory@heytings.org, monnier@iro.umontreal.ca, mattiase@acm.org, > larsi@gnus.org, emacs-devel@gnu.org > From: Alan Mackenzie > > > Can you explain why we need to complicate EQ so much to account for > > symbols-with-pos? > > There are four possible ways the two Lisp objects might match - each > object can be either a bare symbol, or a symbol with pos, giving four > possibilities. It's worth noting that the last three possibilities are > cut off completely by the check on symbols-with-pos-enabled, except > during compilation. I don't see how the number of combinations is relevant. If all you need to compare is the symbol part, then whether there's something after it in memory is not interesting and doesn't affect comparison. > Specific questions: > > > . comparison of a symbol and symbol-with-pos should only compare the > > symbol part, and disregard the "pos" part, right? > > . if so, couldn't we implement symbol-with-pos as a struct that has > > the symbol at its beginning, and then use memcmp to compare only > > that part? > > > Or what am I missing? > > I don't think we can get anywhere that way. What gets compared in EQ > are the Lisp_Object's, which are typically already in processor > registers. I don't think we typically have a pointer to memory > containing the symbol with position. Sorry, I don't understand how this answers my questions. > Don't forget that the position attaches to the symbol OCCURRENCE, > not the symbol itself. I don't understand what I need not to forget, please elaborate. What is there in a symbol-with-pos except the symbol and the position? (And please be more cooperative and forthcoming, since my questions are meant to help make this feature less expensive, otherwise there's a real chance of the feature to be removed, something I hope you don't want.)