|
Boost : |
Subject: Re: [boost] Formal Review of Proposed Boost.Process library
From: Artyom (artyomtnk_at_[hidden])
Date: 2011-02-21 08:27:40
>
> Which code is simpler and more clear?
>
>
> auto pipe = ls [--arg("reverse") % -arg('l') % "/usr/lib"] | grep ["^d"];
> pipe();
>
>
> or:
>
Or maybe something like
command_line_params ls_params;
ls_params.add("--reverse");
ls_params.add("-l");
command_line_params grep_params;
grep_params.add("^d");
grep.stdin().connect(ls.stdout());
ls.spawn(ls_params);
grep.spawn(grep_params);
+- something like that.
I'm not telling that Boost.Process's interface is
perfect and in fact in the review I noticed
that it is not clear and hard to understand.
However what you suggest is terribly cryptic.
It may be seems to be clear but actually is is very wired
construction that hard to understand and would likely
lead to very bad error messages.
Especially because
rm [ "foo.txt" % "bar.txt" ]
Would not work...
Artyom
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk