|
Boost : |
Subject: Re: [boost] Formal Review of Proposed Boost.Process library
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-02-19 17:07:25
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk