chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] grep should use string-search?


From: Alejandro Forero Cuervo
Subject: [Chicken-users] grep should use string-search?
Date: Fri, 6 Aug 2004 12:55:16 -0500
User-agent: Mutt/1.5.6+20040523i

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

Thanks.

Alejo.
http://bachue.com/alejo

---=(  Comunidad de Usuarios de Software Libre en Colombia  )=---               
                                               
---=(  http://bachue.com/colibri )=--=( address@hidden  )=---                   
                                           

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]