From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Add string-replace-substring to (ice-9 string-fun) Date: Mon, 06 Jan 2020 10:08:28 +0100 Message-ID: <7f2a676f-6d79-44e2-854d-06fc30d2aeba@www.fastmail.com> References: <27656CBA-297B-4EE3-93D6-FD56BFBDDC44@sarc.name> Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="148658"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Cyrus-JMAP/3.1.7-731-g1812a7f-fmstable-20200106v2 To: lloda , guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 06 10:09:09 2020 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ioONn-000cWk-TZ for guile-devel@m.gmane.org; Mon, 06 Jan 2020 10:09:08 +0100 Original-Received: from localhost ([::1]:49590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioONm-00042V-Mz for guile-devel@m.gmane.org; Mon, 06 Jan 2020 04:09:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51668) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioONZ-00042N-7c for guile-devel@gnu.org; Mon, 06 Jan 2020 04:08:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioONY-0007R2-7v for guile-devel@gnu.org; Mon, 06 Jan 2020 04:08:53 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:46853) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ioONX-0007Q2-Tc for guile-devel@gnu.org; Mon, 06 Jan 2020 04:08:52 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 56F0022006; Mon, 6 Jan 2020 04:08:51 -0500 (EST) Original-Received: from imap1 ([10.202.2.51]) by compute3.internal (MEProxy); Mon, 06 Jan 2020 04:08:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type:content-transfer-encoding; s=fm1; bh=8NUQT EBTRC+KIz5QACglIB7KklyZm2VoDAaACEd++Vk=; b=WzknkBFsSCoVMNmHrrBCD kaE/UL5iuglOqS7doYm+dqfIuv6AohsIpHgXi6HjldbvwZGt1yisT6VuJWC8fHGo ZZ0BzsXXUmvjbQVnxbrcAj302tCclH2UuH9G0469UH5ObnMsdDr+dgRE9pBpLgll kCHGTz1qtPRHePFnZQyuCDtGq4vOhvxKi2h5uPfEOsFc8nLd4bSVJeZsClIfWxx3 4DwUWV7ixQX7aDtSRCb00A3dVgKFewbvIESO4XgQ9R1aXenqRPF44JVChuWg72yg 3Dj7w5dPEC6Bl3SgP4Oasf1f79PVHrGJM1YHbNGNySxE6ffi4frz0XtPLVXw3B7A w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=8NUQTEBTRC+KIz5QACglIB7KklyZm2VoDAaACEd++ Vk=; b=QFrbhbUMC8VjteYX+l7Acyaz6eiYkyizs3oWyICzbTWfTdWaY/7rrQcYe jcXsUIF9TgujvHrMk0yMgRm0eFTAMwlrOIsQwCcG+C+/axVh8+IiFWBaetQ4yLo1 t9RN6sLmyV83/NYTZTI/OoITYvr9NXUQHpwS/ZCqvFgJjpwIccRXFI6KTK2GEwgz G2qCD23rjcPmGLhpUgUIftDjpOpYhQ7MvlvG5q8yJAHmjBqilI5ww3vFkji69pU7 20GtgfE36cn1AQo6NErI6O5a9zRGZCywEQe2vn/r/TgiXdOY9LXZ1soDHqmsmczh W2a1TJtVSVA2EhpNq+Jpn+PigkGpw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdehtddgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtgfesth hqredtreerjeenucfhrhhomhepnfhinhhushgpuehjnphrnhhsthgrmhcuoehlihhnuhhs rdgsjhhorhhnshhtrghmsehvvghrhihfrghsthdrsghiiieqnecurfgrrhgrmhepmhgrih hlfhhrohhmpehlihhnuhhsrdgsjhhorhhnshhtrghmsehvvghrhihfrghsthdrsghiiien ucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 25016C200A4; Mon, 6 Jan 2020 04:08:51 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <27656CBA-297B-4EE3-93D6-FD56BFBDDC44@sarc.name> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.27 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20229 Archived-At: Did you try it with a "better" string-contains? IIRC the guile one is a = naive string search (but in C) which could maybe be better if it was imp= lemented as, say, a KMP search. The reference srfi-13 has one you could = try. That could be faster for longer strings and longer patterns.=20 If that is faster, I can port a constant-space one that I have in ocaml = somewhere in the catacombs of my.computer. --=20 Linus Bj=C3=B6rnstam On Fri, 20 Dec 2019, at 18:32, lloda wrote: >=20 > This patch adds string-replace-substring that wingo posted to the=20 > mailing list to (ice-9 strings). This is a commonly used function and = a=20 > good implementation isn't trivial, so I think it deserves inclusion. >=20 >=20 >=20 > Attachments: > * 0001-Add-string-replace-substring-to-ice-9-string-fun.patch