
AMDG On 2/19/2011 7:55 AM, Max Sobolev wrote:
(First, please, excuse me for my "english".)
This variant of the Boost.Process library should NOT (--never--) be accepted.
The Boost.Process must be implemented as a DSEL (probably through the Boost.Proto expression templates framework) with a nice (commonly known) syntax like:
I absolutely disagree. Not everything has to be done with expression templates. While I don't have any strong objection to your syntax, I certainly would not consider it essential. You're effectively implementing the shell function in expression templates.
using boost::process; using process::arg; namespace fs = boost::filesystem;
process ls("ls"), grep("grep"); fs::path libs = "/usr/lib";
auto pipe = ls [--arg("reverse") % -arg('l') % libs] | grep ["^d"];
run(pipe); // or: // pipe(); // or: // ls();
This approach provide a declarative, not an imperative programming style. (A lot of work done by expression templates' inner mechanics.)
In Christ, Steven Watanabe