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: regexp-split for Guile Date: Sun, 7 Oct 2012 10:38:43 +0800 Message-ID: References: <20120917140133.GA6315@yarrow> <87lig830ox.fsf@zigzag.favinet> <20120917200603.GB6315@yarrow> <20120918195915.GE6315@yarrow> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1349577529 11775 80.91.229.3 (7 Oct 2012 02:38:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Oct 2012 02:38:49 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Oct 07 04:38:55 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TKglb-0006Pz-Ji for guile-devel@m.gmane.org; Sun, 07 Oct 2012 04:38:55 +0200 Original-Received: from localhost ([::1]:46191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKglV-000358-IL for guile-devel@m.gmane.org; Sat, 06 Oct 2012 22:38:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKglS-00034y-M3 for guile-devel@gnu.org; Sat, 06 Oct 2012 22:38:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKglR-000336-NZ for guile-devel@gnu.org; Sat, 06 Oct 2012 22:38:46 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:57654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKglR-000330-G1 for guile-devel@gnu.org; Sat, 06 Oct 2012 22:38:45 -0400 Original-Received: by mail-we0-f169.google.com with SMTP id u3so2038158wey.0 for ; Sat, 06 Oct 2012 19:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=53U9HF2h85Nu4mpzCkTLp08n+rDJPP479zKWHPd/Gbo=; b=tj5+Qye+j4MEh7VcG7GPt8QKAz70fJDII/pqWJJOUgDxS0XSclQa+WJFbK0UmZJjLk +vudjEBC+0XfPnDr1PzgvOZB8AOOFpWXWCqTQIhHMmPLD++e8GbTpCATD484KsaEw9bJ smWoruK0S/ihSk9j5oiE5BB+rOkG3AZTpDZ0gilMuFZYs6puMHbmoSKr9sDjvR0MAvrs j8JvAfU+mF/jx6Bnkn6ediomCJRBFeOzSrC1uOwkQWGMgdoocR0UHaaltGGG1MpIQNH9 7/wyZXJk3FLSzguw/gyRKpoZc4HseAhzVnfI6vEkb09kXBzf5vLqT4sKgyK/BdUI2VQ3 WfKQ== Original-Received: by 10.180.90.78 with SMTP id bu14mr12200749wib.21.1349577523704; Sat, 06 Oct 2012 19:38:43 -0700 (PDT) Original-Received: by 10.216.158.13 with HTTP; Sat, 6 Oct 2012 19:38:43 -0700 (PDT) In-Reply-To: <20120918195915.GE6315@yarrow> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.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:14936 Archived-At: On 19 September 2012 03:59, Chris K. Jester-Young wrote: > (define* (regexp-split pat str #:optional (limit 0)) > [=E2=80=A6] > (reverse (if (zero? limit) > (drop-while string-null? final) > final)))) > Please simplify this limit arg, removing the maybe-drop-empty-strings behaviour. Either positive limit or #f for all matches. It is trivial for the caller to remove the empty strings if desired, and simplifies the docs for regexp-split. Matching perl semantics is not necessarily desirable. The discussion following the previous thread (started by Nala) is quite useful. Semantics of many other implementations were examined and a good summary later included. (Which does remind me to get back to that TODO list=E2=80=A6) Regards