From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] add regexp-split Date: Fri, 30 Dec 2011 23:23:16 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1325258605 21702 80.91.229.12 (30 Dec 2011 15:23:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2011 15:23:25 +0000 (UTC) Cc: guile-devel@gnu.org To: Nala Ginrut Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Dec 30 16:23:21 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RgeIj-0007Wb-Gd for guile-devel@m.gmane.org; Fri, 30 Dec 2011 16:23:21 +0100 Original-Received: from localhost ([::1]:53203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgeIj-0007uQ-1J for guile-devel@m.gmane.org; Fri, 30 Dec 2011 10:23:21 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgeIh-0007u7-4Z for guile-devel@gnu.org; Fri, 30 Dec 2011 10:23:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgeIf-0005ay-Pg for guile-devel@gnu.org; Fri, 30 Dec 2011 10:23:19 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:59710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgeIf-0005as-LL for guile-devel@gnu.org; Fri, 30 Dec 2011 10:23:17 -0500 Original-Received: by iacb35 with SMTP id b35so27730657iac.0 for ; Fri, 30 Dec 2011 07:23:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=onDKhM4C7ZW6d3zp/NuTvXNUofYIbVe7vxKusZIefV4=; b=T/MP1mSBk44S3ZqgVOryoDAdDQh2UqBXvvGq6K3xFY0IpaT3mZ3c4OUqJgQ/3VPRqH LcFMyDdh3vp9LhjDQa1g7VqlWRU7VOj364/7jC8T5WJvYuIR7/fWtZpFWcOoKRtDK28q kb/S4EQorl0Jwk6gXIOK+uKLMUxoc0HWq7cOI= Original-Received: by 10.42.29.1 with SMTP id p1mr47669974icc.40.1325258596930; Fri, 30 Dec 2011 07:23:16 -0800 (PST) Original-Received: by 10.231.48.68 with HTTP; Fri, 30 Dec 2011 07:23:16 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13210 Archived-At: On 30 December 2011 19:47, Nala Ginrut wrote: > Forget to load (srfi-1 iota) ,again... > > > On Fri, Dec 30, 2011 at 7:40 PM, Nala Ginrut wrote: >> >> Great! It's better now. >> Here's the brand new patch~ I notice that this does not handle the case where there are no matches: scheme@(guile-user)> (regexp-split "[^0-9]" "123") $26 = (("")) (let ((ret (fold-matches regex str (list '() 0 '("")) becomes: (let ((ret (fold-matches regex str (list '() 0 str) and the result: scheme@(guile-user)> (regexp-split "[^0-9]" "123") $28 = ("123") scheme@(guile-user)> (string-split "123" #\!) $29 = ("123") I also note that you are using `substring/shared' when I think you are after `substring'. Both of these are efficient and use shared memory when they can, but there is a difference.