Re: regexp-split for Guile

2012-09-17 Thread Chris K. Jester-Young
On Mon, Sep 17, 2012 at 09:32:14PM +0200, Thien-Thi Nguyen wrote: >(define (string-empty? str) > (zero? (string-length str))) > > You can use ‘string-null?’ instead. Ah, nice! Thanks for the pointer. > Style nit: i find it easier to read ‘if’ expressions w/ the condition, > then and els

Re: regexp-split for Guile

2012-09-17 Thread Thien-Thi Nguyen
() "Chris K. Jester-Young" () Mon, 17 Sep 2012 10:01:33 -0400 (define (string-empty? str) (zero? (string-length str))) You can use ‘string-null?’ instead. (define* (regexp-split pat str #:optional (limit 0)) (let* ((result (fold-matches pat str '(0) regexp-split-fold 0

regexp-split for Guile

2012-09-17 Thread Chris K. Jester-Young
Hi there, I'm currently implementing regexp-split for Guile, which provides a Perl-style split function (including correctly implementing the "limit" parameter), minus the special awk-style whitespace handling (that is used with a pattern of " ", as opposed to / /, with Perl's split). Attached is