From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Roland Winkler Newsgroups: gmane.emacs.devel Subject: Re: case-insensitive string comparison Date: Tue, 19 Jul 2022 21:21:13 -0500 Message-ID: <87wnc8o76u.fsf@gnu.org> References: <87ilnsq4cr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14838"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jul 20 04:21: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 1oDzLX-0003dP-Fi for ged-emacs-devel@m.gmane-mx.org; Wed, 20 Jul 2022 04:21:55 +0200 Original-Received: from localhost ([::1]:56032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDzLV-0004JT-Qa for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Jul 2022 22:21:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDzKs-0003Xq-LH for emacs-devel@gnu.org; Tue, 19 Jul 2022 22:21:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDzKs-00063y-D2 for emacs-devel@gnu.org; Tue, 19 Jul 2022 22:21:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=I9EupVi3x2FtahXcp5pJkphAIJ8M8B0wtAF+UDZ9PJ0=; b=dGqywD3hs4d5z42sADvg tdLXaeIRgBkHBrptSmy/X1I4aZVHmfesaOq79rkS7wcuNNdFYBceEHXlusMhlN6FrNuis5fUSmuDY CgycL0YUwjVF294IRHjwpkIzaXooIgIFfwxAlBFBHTWya2FiM3XHk1KARLwkZ9OnoqJkPPozGLxva W5u7JNELZNyG5nj3HWKQhk5eTxSlgNmu7+MfzwbToFfgFtWjM21nMhCjWy7C6xWS6cO6/5R2LOWIV g53LCJfV7uwPEUCwMBNdFwoRXygB78b4V1N+mBZ2YU3vAmuwXgn07Wqay7Xmu+Rcctmvv8EDtbX5P zI4FLrPq7m7vYA==; Original-Received: from [2600:1700:5650:f790::42] (port=50980 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDzKs-0004XZ-4O for emacs-devel@gnu.org; Tue, 19 Jul 2022 22:21:14 -0400 In-Reply-To: (Sam Steingold's message of "Tue, 19 Jul 2022 18:47:14 -0400") 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:292297 Archived-At: On Tue, Jul 19 2022, Sam Steingold wrote: > No, because I need to be able to pass `string-equal-ignore-case' to > things like `cl-find' as `:test' &c. That sounds like a rather particular use case that, I believe, should not motivate the design of what goes into subr.el. > Also, if you look at fns.c, `string-equal' is basically `memcmp', while > `compare-strings' is way more complex. I don't think that's an obstacle for anything. - The string-delimiting args and underlying machinery of compare-strings are something that can be skipped with string-equal. - On the other hand, string comparison with case-folding is more complex than string comparison without case-folding, by its very definition. > PS. Actually, compare-strings/ignore_case is broken because it does, > essentially, upcase both arguments, see > https://stackoverflow.com/q/319426/850781 That's a very different issue.