From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: Should vtable-goto-object use 'equal instead of 'eq? Date: Sat, 16 Nov 2024 16:57:00 -0600 Message-ID: <6265bdc3-9ba2-4e9e-a90d-2e87791066ef@alphapapa.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9655"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org To: krisbalintona@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 16 23:57:59 2024 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 1tCRjq-0002Ml-R3 for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Nov 2024 23:57:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCRj3-0001QE-0t; Sat, 16 Nov 2024 17:57:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tCRj1-0001Q5-Ll for emacs-devel@gnu.org; Sat, 16 Nov 2024 17:57:07 -0500 Original-Received: from shrimp.cherry.relay.mailchannels.net ([23.83.223.164]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tCRj0-0000pn-7K for emacs-devel@gnu.org; Sat, 16 Nov 2024 17:57:07 -0500 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A36651648DD; Sat, 16 Nov 2024 22:57:02 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a211.dreamhost.com (trex-8.trex.outbound.svc.cluster.local [100.111.109.236]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 3153E164152; Sat, 16 Nov 2024 22:57:02 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1731797822; a=rsa-sha256; cv=none; b=N1NiVVOQRojITxS9Rf/dcgI+aVoJ/HLI2aSMMRBnuOM82n8qVv5GPwidqsFr9aU1+ZiAGa 6FLg5MOWJVfYF8+ni7Th3EIWQthyMX3Mj92iM95gxjZwcUwI1aG6+jhcHFBdJ7acYAQnPs YCf1BjroiZZF4QcvI7xcd4WXt8JxqOHFweGoMHjEG4tN/0xktMPgaWArM1BfML5uUVi+zY 4mWTqJ0AFx73Lfejn1qbdfLG9SPbf7qiAW3B53IUaXopkn19RS9wBWP8Q2IoPV7pfrJ/B0 8uxVCeJkS3wR1FfDgw2TUDVAz/4NSeYlUox8PttyxftviXgNVGkCjzg0Wb7xMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1731797822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=agnC0enJWVbfu35Sz4Hf9xKzdjeSBJiNHsceXEe+IlM=; b=9vlR2HGw16I1DyDqMYyNt8u06C2aLMiu2hVs2/0rb741a4UfL7abfHh9C8sVodBUeapgq7 AZCEXM7lqsakNUAxsP1NuLXnWiuf3sqgEoAkTaPxRdCXVbUntmFSngYP8/tNBjOE4iFoW5 H9BX9eHAgVB8I7jA084qi+WYzOVp2Bi6Ta+5FYt/QmHyuPp+tX25HRClucQR2tvMe0Wm2T CIzVE+E4GeA2GBhSLMvdL3znZYuzCsbBnoBXhNcA2h7+37OeMqEMVGEcUDfbXjRxtABQ1P mpbZPcPGSItb18PTAg982yakIUwSbMftuRvdIwQhc5/a7Gm2szR9LT9u33EjYw== ARC-Authentication-Results: i=1; rspamd-645676964-gxrkf; auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net X-MailChannels-Auth-Id: dreamhost X-Reign-Robust: 33ef90725e6d8096_1731797822429_3391319139 X-MC-Loop-Signature: 1731797822429:160245130 X-MC-Ingress-Time: 1731797822428 Original-Received: from pdx1-sub0-mail-a211.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.111.109.236 (trex/7.0.2); Sat, 16 Nov 2024 22:57:02 +0000 Original-Received: from [10.66.233.225] (unknown [91.193.232.98]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: adam@alphapapa.net) by pdx1-sub0-mail-a211.dreamhost.com (Postfix) with ESMTPSA id 4XrTmF51Dvz3c; Sat, 16 Nov 2024 14:57:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1731797822; bh=agnC0enJWVbfu35Sz4Hf9xKzdjeSBJiNHsceXEe+IlM=; h=Date:To:Cc:Subject:From:Content-Type:Content-Transfer-Encoding; b=P6a1C2S77ANHoTxjQNUG8igs6hyJc70X4aDFxGmxVGE+X2hQ8asnRu7zENEVYbH7y TJbuJEJWePmRtInYnET+gwnBGLszjZNnv4GVjHIEUM3fz24lVYYAc801j8w+aYTIee TqssRydWUD6cQgoyamJOu+QqZCLPlywJCkETvcOXIcsE+HGk3WQroxNxHTeOhiDCYE HCgALXVgnc5uKoez+Vpv4gXtz/SMNIYQGidsYswLgMlkfTRSaPBMSJ4V1jDJ8fMs5l X+GgAd9Lyfjn9XYGPr//+sX2jeQ5yYQeodvXNYvhISjQfepYNmkydVrAm32oLgAxQs jZ6FQtRR1bHHw== Content-Language: en-US In-Reply-To: Received-SPF: neutral client-ip=23.83.223.164; envelope-from=adam@alphapapa.net; helo=shrimp.cherry.relay.mailchannels.net X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325480 Archived-At: Hi Kristoffer, > With these cases in mind, would it be best for vtable-goto-object to > have as a parameter the predicate used by text-property-search-forward > (the default being eq)? Personally, I have no objection to making the predicate a parameter, if it's necessary to enable a real use case. I would suggest that a concrete, real-world use case be presented before making such a change; I'm not sure if the example you gave is complete enough to be one. AIUI Vtable is intended to present representations of a collection of objects. Strings are objects, of course, and one can have multiple references to a string, which should facilitate comparison with EQ. Obviously, if a user inputs a new string that matches one in a collection, the two strings would not be EQ, but one could easily use, e.g. CL-FIND to locate the matching string and use it for VTABLE-GOTO-OBJECT. As well, I could imagine circumstances in which there could be multiple objects in a collection which are EQUAL but not EQ. Of course, you didn't suggest changing the default predicate, so that wouldn't be impacted. Thinking about it further, making the predicate a parameter would allow one to pass a bespoke predicate that could do things like look inside objects and compare parts of them, which I could imagine being very useful. (So maybe my suggestion about a concrete use case being required is too strong, haha.) So, if no one else objects, I would be in favor of your suggestion being implemented. It should be just a few lines of code and documentation, right? If you submit a bug/patch, feel free to cc me on it. --Adam