Re: Passing Function as an argument to another Function

2017-12-05 Thread Vino via Digitalmars-d-learn
On Monday, 4 December 2017 at 19:25:15 UTC, Ali Çehreli wrote: On 12/04/2017 04:52 AM, Vino wrote: > [...] Every expression has a type. 'auto' in that context (or 'const', etc.) just helps with not spelling-out that type. You can see the type with pragma(msg) and typeof: [...] Hi Ali, T

Re: Passing Function as an argument to another Function

2017-12-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, December 04, 2017 20:02:30 kdevel via Digitalmars-d-learn wrote: > On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote: > > On Monday, 4 December 2017 at 10:46:03 UTC, rikki cattermole > > wrote: > > > > FunTest.d(52): Error: template FunTest.ptProcessFiles cannot > > deduce function

Re: Passing Function as an argument to another Function

2017-12-04 Thread kdevel via Digitalmars-d-learn
On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote: On Monday, 4 December 2017 at 10:46:03 UTC, rikki cattermole wrote: FunTest.d(52): Error: template FunTest.ptProcessFiles cannot deduce function from argument types !()(string, Array!(Tuple!(string, string)) function(string FFs, string

Re: Passing Function as an argument to another Function

2017-12-04 Thread Ali Çehreli via Digitalmars-d-learn
On 12/04/2017 04:52 AM, Vino wrote: > if the Variable CleanDirlst is defined as "auto" Every expression has a type. 'auto' in that context (or 'const', etc.) just helps with not spelling-out that type. You can see the type with pragma(msg) and typeof: auto someExpression = [ "one" : 1,

Re: Passing Function as an argument to another Function

2017-12-04 Thread Vino via Digitalmars-d-learn
On Monday, 4 December 2017 at 11:41:06 UTC, codephantom wrote: On Monday, 4 December 2017 at 11:30:02 UTC, codephantom wrote: On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote: The original program is as below Error: FunTest.d(52): Error: template FunTest.ptProcessFiles cannot deduce f

Re: Passing Function as an argument to another Function

2017-12-04 Thread codephantom via Digitalmars-d-learn
On Monday, 4 December 2017 at 11:30:02 UTC, codephantom wrote: On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote: The original program is as below Error: FunTest.d(52): Error: template FunTest.ptProcessFiles cannot deduce function from argument types !()(string, Array!(Tuple!(string, s

Re: Passing Function as an argument to another Function

2017-12-04 Thread codephantom via Digitalmars-d-learn
On Monday, 4 December 2017 at 11:05:22 UTC, Vino wrote: The original program is as below Error: FunTest.d(52): Error: template FunTest.ptProcessFiles cannot deduce function from argument types !()(string, Array!(Tuple!(string, string)) function(string FFs, string Step, int DirAged), File,

Re: Passing Function as an argument to another Function

2017-12-04 Thread Vino via Digitalmars-d-learn
On Monday, 4 December 2017 at 10:46:03 UTC, rikki cattermole wrote: On 04/12/2017 10:36 AM, Vino wrote: Hi Rikki,   Thank you very much, I tired the above code and it is working, so another help on the same topic. IF my function (First) of below type when who do we define the Mid function

Re: Passing Function as an argument to another Function

2017-12-04 Thread rikki cattermole via Digitalmars-d-learn
On 04/12/2017 10:36 AM, Vino wrote: Hi Rikki,   Thank you very much, I tired the above code and it is working, so another help on the same topic. IF my function (First) of below type when who do we define the Mid function Array!(Tuple!(string, string))  First(string Ftext) Tried the below 

Re: Passing Function as an argument to another Function

2017-12-04 Thread Vino via Digitalmars-d-learn
On Monday, 4 December 2017 at 08:27:10 UTC, rikki cattermole wrote: On 04/12/2017 8:22 AM, Vino wrote: Hi All,   Request your help on the below code, I want to send the name of the function ( First and Second) from main as an argument to another function(Mid) and the function "Mid" has to e

Re: Passing Function as an argument to another Function

2017-12-04 Thread Andrea Fontana via Digitalmars-d-learn
On Monday, 4 December 2017 at 08:27:10 UTC, rikki cattermole wrote: On 04/12/2017 8:22 AM, Vino wrote: Hi All,   Request your help on the below code, I want to send the name of the function ( First and Second) from main as an argument to another function(Mid) and the function "Mid" has to e

Re: Passing Function as an argument to another Function

2017-12-04 Thread rikki cattermole via Digitalmars-d-learn
On 04/12/2017 8:22 AM, Vino wrote: Hi All,   Request your help on the below code, I want to send the name of the function ( First and Second) from main as an argument to another function(Mid) and the function "Mid" has to execute the function(First and Second). Program: import std.stdio;

Passing Function as an argument to another Function

2017-12-04 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on the below code, I want to send the name of the function ( First and Second) from main as an argument to another function(Mid) and the function "Mid" has to execute the function(First and Second). Program: import std.stdio; void First (string Ftext) { writeln("