DMD 0.148 - regular expressions

Dave Dave_member at pathlink.com
Sun Feb 26 08:28:52 PST 2006


In article <dtsge2$1i5t$1 at digitaldaemon.com>, Tom says...
>
>In article <dtse93$1fou$1 at digitaldaemon.com>, Lars Ivar Igesund says...
>>
>>Tom wrote:
>>
>>> In article <dts7qi$18b0$1 at digitaldaemon.com>, Ivan Senji says...
>>>>
>>>>Lars Ivar Igesund wrote:
>>>>> 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...
>>>>
>>>>Me too (except I even liked the operator) :)
>>> 
>>> There was a common opinion but on the opposed. I felt the same as Walter
>>> about match expressions in the NG.
>>> 
>>> My own thought about match expressions is that they introduce TOO MUCH lib
>>> functionality (common only for certain types of apps), making D *very*
>>> overloaded (think about future writers of the compiler). The most of the
>>> people felt that introducing match expressions really introduces NO NEW
>>> functionality. Rather it just saves you the time of writing "import
>>> std.regexp;" (i guess). And also they introduced more complexity than
>>> needed and new bugs to fix. Match expressions was a luxury that D couldn't
>>> afford as D has many other *really-prior-and-crucial* things to work out
>>> if it want's to become 1.0.
>>> 
>>> JMHO
>>> 
>>> 
>>> Tom;
>>
>>I think the "common opinion" was too coloured by the fact that we didn't
>>really expect it to go away (but maybe change), thus many of those having
>>positive feelings toward the match expressions didn't voice their opinion
>>at all (at least I didn't). But I guess a vote would give a 50/50 result :)
>
>Maybe (don't think so) but we'll have to see it to believe it. ;-)
>
>Tom;

IMHO, the vote would be about 70 - 30 for the built-in's, especially with the
addition of 'if statement result declarations' that would get rid of the
implicit variables.

Since AFAIK they don't complicate the compiler that much, they don't have any
overhead if they aren't used and don't prevent the direct use of a regex
library, I don't see any downside of making them built-in.

- Dave





More information about the Digitalmars-d mailing list