Uniform Function Call Syntax allows for chaining functions in a neat, readable way. Whenever calling a function on a type, the compiler checks if the type has that method. If the type does not have said method, the compiler tries to apply a function that conforms to the signature using the type that is called upon as the first parameter and, if any, other arguments as remaining parameters.
Alternatively, your could add "import std.functional" and do one of the following functional looking one-liners:
D is an extensive language, but it can be simple.
Uniform Function Call Syntax allows for chaining functions in a neat, readable way. Whenever calling a function on a type, the compiler checks if the type has that method. If the type does not have said method, the compiler tries to apply a function that conforms to the signature using the type that is called upon as the first parameter and, if any, other arguments as remaining parameters.
Alternatively, your could add "import std.functional" and do one of the following functional looking one-liners:
compose!(writeln, choice, splitLines, strip,readText)(args[1]);
pipe!(readText, strip, splitLines, choice, writeln)(args[1]);
(reverse order of compose)