[Prev][Next][Index][Thread]
Re: Simple Reader Macros for Dylan
On Fri, 19 Nov 1999 23:39:45 -0000, "Keith Playford"
<keith.playford@pobox.com> wrote:
> Re: Simple Reader Macros for Dylan
What did you think about my idea for adopting Perl's convention for regexp
delimiters in Dylan reader macros? Perl lets you use any character as the
delimiter, then it just searches for another one of those. In practice, this
lets you sidestep the problem of escaping the delimiter character when you
want to refer to it in the literal. Instead of escaping the fixed delimiter
you simply use a different character. Sort of "lexer judo".
e.g.
#regexp:"foo.*bar"
or if you need to match on double quote characters:
#regexp:/baz(".*")/
However, this would mean that you couldn't use balanced pairs of 'opposite'
characters like '(' and ')' unless the you extended Perl's notion of "another
one" to include opposites.
__Jason
Follow-Ups:
References: