DMD 0.148 - regular expressions

Lars Ivar Igesund larsivar at igesund.net
Sun Feb 26 09:23:45 PST 2006


James Dunne wrote:

> Trevor Parscal wrote:
>> In article <dtsjs6$1lp0$1 at digitaldaemon.com>, Dave says...
>> 
>>>In article <dts47r$14c0$1 at digitaldaemon.com>, Lars Ivar Igesund says...
>>>
>>>>Walter Bright wrote:
>>>>
>>>>
>>>>>The match expressions are gone. Based on the feedback, people didn't
>>>>>want D to adopt perl'ish notation or implicitly defined variables.
>>>>>Instead, foreach statements now allow implicit typing of the key/value
>>>>>declarations, and the if statement now can declare a variable for the
>>>>>result (an adaptation of Ben Hinkle's idea).
>>>>
>>>>I liked the idea (match expressions), just not the operator, and I
>>>>thought that was a common opinion...
>>>
>>>So did I (but the operators didn't bother me). I was surprised to see the
>>>'built-in' behaviour removed. From my understanding, it wasn't terribly
>>>complicated to implement and there wasn't any overhead unless it was
>>>used. There really wasn't any 'perl'ish notation' to speak of, and the
>>>recent addition of if statement result variables would have taken care of
>>>the implicitly defined variable issue.
>>>
>>>I think it was a mistake to remove the built-in's. Now I bet they're gone
>>>for good. Arrrgh. I think D would better appeal to a large segment of
>>>developers (using scripting languages like Perl) with the built-in regex
>>>match functionality.
>>>
>>>IIRC, most of the posts liked the built-in idea but took issue with a few
>>>of the details. We've gone from talk about how the compiler can optimize
>>>matching behaviour to removing the built-in's entirely. I don't get it..
>>>
>>>- Dave
>>>
>>>
>> 
>> 
>> I think the addition and than removal was pretty odd.. I was just about
>> to rewrite some code using the match operator - but I am glad I diddn't.
>> 
>> But you know - as much as we all demand features and get mad when they
>> aren't included, it was nice to see a feature get included. But now it
>> gets taken away so quickly, I don't know what will be taken out next.. :)
>> 
>> Please don't remove dynamic arrays walter!
>> 
>> Just kidding - we all love you!
>> 
>> Thanks,
>> Trevor Parscal
> 
> Why is this move (taking out the built-in behavior) so seemingly
> unexpected to everyone?  Walter outright said "Don't write production
> code with this feature."
> 

You are of course correct in this, but it in my (quite so erratic at times)
mind, this meant that the syntax probably would be changed, not removed
altoghether. Also, I don't really think the D as Script feature makes much
sense without some additional regexy sugar, even if it is still quite
usable of course.



More information about the Digitalmars-d mailing list