Created
June 23, 2015 23:46
-
-
Save CyberShadow/5cc7e926f566d56a672f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Eager version | |
void main(string[] args) | |
{ | |
import std.algorithm, std.file, std.path, std.range, std.uni; | |
args[1..$].each!(fn => | |
fn | |
.readText() | |
.toLower | |
.copy(File(fn.setExtension(".lower"), "wb").lockingTextWriter) | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Range version - current names | |
void main(string[] args) | |
{ | |
import std.algorithm, std.file, std.path, std.range, std.uni; | |
args[1..$].each!(fn => | |
fn | |
.readText() | |
.toLowerCase() | |
.copy(File(fn.setExt(".lower"), "wb").lockingTextWriter) | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Range version - proposal 1 | |
void main(string[] args) | |
{ | |
import std.algorithm, std.file, std.path, std.range, std.uni; | |
args[1..$].each!(fn => | |
fn | |
.readText() | |
.lowerCased() | |
.copy(File(fn.withExtension(".lower"), "wb").lockingTextWriter) | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Range version - proposal 2 | |
void main(string[] args) | |
{ | |
import std.algorithm, std.file, std.path, std.range, std.uni; | |
args[1..$].each!(fn => | |
fn | |
.readText() | |
.toLowerLazy() | |
.copy(File(fn.setExtensionLazy(".lower"), "wb").lockingTextWriter) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment