shouting versus dotting

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Oct 5 09:18:42 PDT 2008


Sean Kelly wrote:
> Andrei Alexandrescu wrote:
>> Sean Kelly wrote:
>>>
>>> Will do.  It's easy enough to search-replace '!' with '.'
>>
>> You'll need a sed expression to not catch unary ! and != as well.
> 
> Nah, just replace "!(" with ".("  I basically never use "!(exp)" in 
> conditions so there should be no problems.

Well well laziness never helps.

sed --in-place -e 's/\([a-zA-Z0-9_]\)\(\s*\)!\(\s*\)(/\1\2.\3(/' *.d

Preserves whitespace used around !, too. The major problem is it will 
transform insides of strings too. Also, won't transform instantiations
across lines, and won't work with Unicode symbols...


Andrei




More information about the Digitalmars-d mailing list