Questions about builtin RegExp

Georg Wrede georg.wrede at nospam.org
Mon Feb 20 15:24:19 PST 2006


Andrew Fedoniouk wrote:
> "Walter Bright" <newshound at digitalmars.com>
>> "Andrew Fedoniouk" <news at terrainformatica.com>

>>> In general shortcuts are good but in this particular case it has
>>> hidden side effects in creation of new RegExp object on each test
>>> invocation.
>> 
>> Yes, but why is that a bad thing?
> 
> 
> You need to explain very well what is going on under the hood of this
> ~~ - it is statefull operator (if it is /g).
> 
> <ot>
> 
> I am using stream tokenizer in Harmonia instead of this /g. (class
> TokenizerT(CHAR) // harmonia/string.d)
> 
> Simple like(pattern)  method is enough in 90% of cases.
> 
> Perl is completely different story - it is built around RegExp. And
> it is typeless.
> 
> </ot>
> 
> BTW: Have you seen Nemerle and its way of meta-programming? 
> http://nemerle.org/

Had I to do stuff on the M$ "platform", I'd definitely look long and 
hard on Nemerle, before even touching C#.

The macro thing looks quite a bit like what I had in mind last winter 
when we were discussing whether the high level (that is, 
metaprogramming) features of D should be implemented in a syntax 
distinct from the "normal" language syntax or not.

Seems I lost. :-)
(No hard feelings, Walter and Don are really amazing me, over and over 
again!)

Still, there's a lot of obvious stuff that seems trivial with a separate 
syntax, while either impossible or cumbersome with the current one. (But 
hey, with the rate W&D are going, all that will also be fixed by D 1.5.)



More information about the Digitalmars-d mailing list