Compile time executable calling?
H. S. Teoh
hsteoh at quickfur.ath.cx
Mon Jul 15 10:47:26 PDT 2013
On Mon, Jul 15, 2013 at 07:35:44PM +0200, Tofu Ninja wrote:
[...]
> The use cases I am more interested in are not possible with make.
> Having the ability to pass the arguments from within the language
> itself allows you to define your use cases inline instead of having
> to separately define the use case outside. Something where you would
> have many different points in the code that needed different input
> from what ever executable you were calling. With out ctec you would
> have to maintain a list of every time you needed something generated
> from the outside and add that to your make which is error prone. I
> think it is in these cases where the ctec would be the most useful
> as it would remove a lot of the burden of keeping track of all the
> pregenerated code.
You mean, you want to do something like this?
static inputValues = [
"data1", "data2", "data3"
];
static foreach (val; inputValues) {
import exec("prog", val);
}
I can see why that could be useful.
T
--
By understanding a machine-oriented language, the programmer will tend
to use a much more efficient method; it is much closer to reality. -- D.
Knuth
More information about the Digitalmars-d
mailing list