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]

Re: A useful syntax for regexps and other things


"Harvey J. Stein" <abel@netvision.net.il> writes:

> In scheme one can do much better.  When I was moving my URL parsing
> code around I finally wrote a function
> 
>    (list->string-regexp lst)

This is a great idea!  Nice!

> which would take a regular expression such as 
>    '((set "^a-zA-Z_$")
>      (group "read" or "readv" or "readln"
> 	    or "write" or "writev" or "writeln"
> 	    or "reset" or "extend" or "rewrite"
> 	    or "close")
>      (zero-or-more whitespace)
>      "(")

But I like the syntax in the commentary better:

> ;;          (or regexp1 regexp2 ...)   - Match regexp1 or regexp2 or ...

Why do you use infix notation above?  Is that the in-"complete job"?

I think we should add such a function as standard in Guile.

/mdj