Scriptometer
Jesse Phillips
jessekphillips+D at gmail.com
Wed Nov 3 18:51:56 PDT 2010
bearophile Wrote:
> Lutger:
>
> > Here is a quick attempt:
> >
> > import std.file, std.regex;
> >
> > void main(string[] args)
> > {
> > args[1].write( args[1].readText().replace( regex("#.*", "g"), "") );
> > }
>
> It's cute. Compared to the Python version it doesn't work lazily (by lines).
>
> I have tried on Windows that D program and the Python program on a text file that has Unix newlines. The Python program has produced an output with Windows newlines, while the D program has produced an output with Unix newlines. I think Python is more correct here.
>
> Bye,
> bearophile
Disagree completely. The task was to remove comment lines, not properly format line endings for the OS running.
I don't think laziness has any benefit here.
More information about the Digitalmars-d
mailing list