This is the mail archive of the guile@cygnus.com mailing list for the guile project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
When the regexp code was changed to use the POSIX matcher there were two useful/practial functionalities in regexp-exec that were dropped/forgotten. The previos procedure "regexec" which is now named "regexp-exec" had a couple of more possibilities with the optional third argument. When the third argument was #f, then regexec returned #t or #f, i.e. just telling whether the expression matched or not (as the even older "regmatch?"). like: scm> (define match (make-regexp "foo|bar")) scm> (regexec match "foobar" #f) #t The mental allocation pain when getting a vector and a cons back when I just want #t or #f is just too much. scm> (regexp-exec match "foobar") #("foobar" (0 . 3)) The other useful feature that disappeared was when the third argment was an atom like: scm> (define eqmatch (make-regexp "=")) scm> (regexec eqmatch "x=y+z" 'split) ("x" "=" "y+z") Best regards Roland Orre ------------------------------+---------------------+----------------- Roland Orre | O---O---O Studies of| orre@nada.kth.se SANS, NADA, KTH | |\ /|\ / Artificial| S-100 44 Stockholm, Sweden | O-O-O-O Neural |Wph:+46 8 7906984 ------------------------------+ |/ \ /| Systems |Fax:+46 8 7900930 Dept. of Computing Science | O---O-O +---------|Mob:+46 70 8269748 Royal Institute of Technology | |http://www.nada.kth.se/~orre ------------------------------+----------+----------------------------