Compile time executable calling?

Tofu Ninja emmons0 at purdue.edu
Mon Jul 15 10:54:56 PDT 2013


On Monday, 15 July 2013 at 17:49:04 UTC, H. S. Teoh wrote:
> 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
  Or something more complex where a template generates its code 
based on the output of an executable, so in that case the 
template args would be passed into the executable call.


More information about the Digitalmars-d mailing list