Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread Timoses via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 14:58:42 UTC, vino.B wrote: Hi Alex, I am getting the output as tuples of multiple arrays, but the requirement is to get the all the tuple in a single array like the below so that we can perform sorting and printing the output is easy. Something along the way

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread vino.B via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 14:50:53 UTC, Alex wrote: On Tuesday, 10 July 2018 at 14:38:03 UTC, vino.B wrote: Hi Alex, The reason the I am storing the output of "PFresult.toRange" to another array "rData" is that the output of the PFresult.toRange is different each time we execute the

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread Alex via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 14:38:03 UTC, vino.B wrote: Hi Alex, The reason the I am storing the output of "PFresult.toRange" to another array "rData" is that the output of the PFresult.toRange is different each time we execute the code.(Data is correct) but the way the it output is

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread vino.B via Digitalmars-d-learn
On Monday, 9 July 2018 at 18:07:49 UTC, Alex wrote: On Monday, 9 July 2018 at 17:26:30 UTC, vino.B wrote: Request Help: void process(alias coRoutine, T...)(Array!string Dirlst, T params) { ReturnType!coRoutine rData; / This line is not working alias scRType =

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-09 Thread Alex via Digitalmars-d-learn
On Monday, 9 July 2018 at 17:26:30 UTC, vino.B wrote: Request Help: void process(alias coRoutine, T...)(Array!string Dirlst, T params) { ReturnType!coRoutine rData; / This line is not working alias scRType = typeof(coRoutine(string.init, T.init)); auto PFresult =

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-09 Thread vino.B via Digitalmars-d-learn
On Monday, 9 July 2018 at 15:49:50 UTC, Alex wrote: On Monday, 9 July 2018 at 15:40:53 UTC, vino.B wrote: On Sunday, 8 July 2018 at 19:10:24 UTC, Alex wrote: On Sunday, 8 July 2018 at 18:46:31 UTC, vino.B wrote: Request you help, in the below code we pass the function "Testfun" as a

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-09 Thread Alex via Digitalmars-d-learn
On Monday, 9 July 2018 at 15:40:53 UTC, vino.B wrote: On Sunday, 8 July 2018 at 19:10:24 UTC, Alex wrote: On Sunday, 8 July 2018 at 18:46:31 UTC, vino.B wrote: Request you help, in the below code we pass the function "Testfun" as a parameter to another function "process" in order for the

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-09 Thread vino.B via Digitalmars-d-learn
On Sunday, 8 July 2018 at 19:10:24 UTC, Alex wrote: On Sunday, 8 July 2018 at 18:46:31 UTC, vino.B wrote: Request you help, in the below code we pass the function "Testfun" as a parameter to another function "process" in order for the function "process" to work we have to specify the type of

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-09 Thread Timoses via Digitalmars-d-learn
On Monday, 9 July 2018 at 05:54:27 UTC, vino.B wrote: On Sunday, 8 July 2018 at 19:22:32 UTC, Timoses wrote: Perhaps you could tell us what your goal is. People here might come up with a nice solution. Why do you feel like having to use templated functions in the first place? That is, what is

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-09 Thread Simen Kjærås via Digitalmars-d-learn
On Monday, 9 July 2018 at 05:54:27 UTC, vino.B wrote: In phase 2 we are transferring few more function to the existing D code, and these functions has variable number of parameter and different type eg: Function3(string, string, string), Function(string, int, string, int). Initially I

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-08 Thread vino.B via Digitalmars-d-learn
On Sunday, 8 July 2018 at 19:22:32 UTC, Timoses wrote: On Sunday, 8 July 2018 at 18:46:31 UTC, vino.B wrote: Hi All, Request you help, in the below code we pass the function "Testfun" as a parameter to another function "process" in order for the function "process" to work we have to specify

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-08 Thread Timoses via Digitalmars-d-learn
On Sunday, 8 July 2018 at 18:46:31 UTC, vino.B wrote: Hi All, Request you help, in the below code we pass the function "Testfun" as a parameter to another function "process" in order for the function "process" to work we have to specify the type of the parameter that is passed to the

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-08 Thread Alex via Digitalmars-d-learn
On Sunday, 8 July 2018 at 18:46:31 UTC, vino.B wrote: Request you help, in the below code we pass the function "Testfun" as a parameter to another function "process" in order for the function "process" to work we have to specify the type of the parameter that is passed to the function "(T

Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-08 Thread vino.B via Digitalmars-d-learn
Hi All, Request you help, in the below code we pass the function "Testfun" as a parameter to another function "process" in order for the function "process" to work we have to specify the type of the parameter that is passed to the function "(T function(string, int) coRoutine, string Test,