|
From: | Felix Winkelmann |
Subject: | Re: [Chicken-users] grep should use string-search? |
Date: | Tue, 10 Aug 2004 06:58:55 +0200 |
User-agent: | Opera M2/7.52 (Win32, build 3834) |
The manual tells us that grep could be implemented as: (define (grep regex lst) (filter (lambda (x) (string-match regex x)) lst) ) Indeed, (grep "f" (list "ale" "fore" "cuer")) returns the empty list. Shouldn't grep use string-search instead of string-match? I would be more consistant with what the Unix grep command does: echo -e "ale\nfore\ncuer" | grep f
That's reasonable. Especially since string-search is the same as string-match "^...$". cheers. felix
[Prev in Thread] | Current Thread | [Next in Thread] |