[lug] XEmacs quoting madness!

Tom Tromey tromey at redhat.com
Tue Aug 21 12:44:50 MDT 2001


>>>>> "Tkil" == Tkil  <tkil at scrye.com> writes:

Tkil> it's particularly touchy with regular expressions embedded within
Tkil> other languages (be it emacs-lisp or perl).  regexps are essentially
Tkil> a little language with its own quoting rules.  when we put this little
Tkil> language within a larger one, we have to deal with the containing
Tkil> language's quoting rules as well.

I've heard that in Guile they've considered introducing a more schemey
regexp syntax, perhaps something like David's.

Back when I was interested in Guile, I lobbied for regular expressions
to be treated like ordinary scheme procedures.  That is, you would
compile a regular expression, and the object you got back would be an
ordinary scheme function.  You'd never have to apply a regular
expression with something like Emacs' string-match.

That is, instead of:

    (let ((compiled (regexp-compile "^.*$")))
        (string-match compiled "foo"))

you would just write something like:

    (let ((compiled (regexp-compile "^.*$")))
        (compiled "foo"))

The observation here is that a compiled regular expression is just a
certain sort of closure.

This becomes even more obvious if you use a more scheme-like syntax
for the expression itself.

The Guile guys didn't like this though.  They thought it was "too cute".
I still think it is the scheme way though :-)

Tom



More information about the LUG mailing list