Understanding regexes (Was: Re: DMD 0.147 release)
Walter Bright
newshound at digitalmars.com
Tue Feb 21 09:08:02 PST 2006
"Georg Wrede" <georg.wrede at nospam.org> wrote in message
news:43FB25FC.8090806 at nospam.org...
> Walter Bright wrote:
>> If the compiler is to constant fold regular expressions, then it
>> needs to build in to the compiler exactly what would happen if the
>> regex code was evaluated at runtime.
> Yes. IMHO in essence, the binary machine code, which the runtime also
> would build. What I have a hard time seeing is, how this differs from
> building a normal function at compile time?
Consider the strlen() function. Compiling a strlen() function and generating
machine code for it is a very different thing from the compiler knowing what
strlen is and replacing:
strlen("abc")
with:
3
More information about the Digitalmars-d-announce
mailing list