Re: How is this code supposed to work?

2019-01-25 Thread Neia Neutuladh via Digitalmars-d-learn
On Fri, 25 Jan 2019 19:14:51 -0500, Steven Schveighoffer wrote: > Interestingly, It's not possible to do the second form, so it's a bit > curious why we don't just drop the requirements for nested > parentheses... The error messages there are really hideous, too: template Just(alias s) { alias

Re: How is this code supposed to work?

2019-01-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/25/19 11:19 AM, Neia Neutuladh wrote: On Fri, 25 Jan 2019 09:34:47 +, AndreasDavour wrote: auto point3 = getResponse!Point!int("What's the point? "); This could be: getResponse!(Point!int) or: (getResponse!Point)!int D requires this to be disambiguated at the

Re: How is this code supposed to work?

2019-01-25 Thread AndreasDavour via Digitalmars-d-learn
On Friday, 25 January 2019 at 16:19:38 UTC, Neia Neutuladh wrote: On Fri, 25 Jan 2019 09:34:47 +, AndreasDavour wrote: auto point3 = getResponse!Point!int("What's the point? "); This could be: getResponse!(Point!int) or: (getResponse!Point)!int D requires this to be

Re: How is this code supposed to work?

2019-01-25 Thread AndreasDavour via Digitalmars-d-learn
On Friday, 25 January 2019 at 14:25:33 UTC, AndreasDavour wrote: https://run.dlang.io/is/a4oDFZ is an example of how this looks. I feel like there's more to these templates than meet the eye. To clarify. I really don't understand the thinking behind these templates, and wonder a bit about

Re: How is this code supposed to work?

2019-01-25 Thread Neia Neutuladh via Digitalmars-d-learn
On Fri, 25 Jan 2019 09:34:47 +, AndreasDavour wrote: >auto point3 = getResponse!Point!int("What's the point? "); This could be: getResponse!(Point!int) or: (getResponse!Point)!int D requires this to be disambiguated at the parsing stage, before the compiler works out what

Re: How is this code supposed to work?

2019-01-25 Thread AndreasDavour via Digitalmars-d-learn
On Friday, 25 January 2019 at 12:11:51 UTC, AndreasDavour wrote: On Friday, 25 January 2019 at 12:09:34 UTC, AndreasDavour wrote: On Friday, 25 January 2019 at 09:36:24 UTC, rikki cattermole wrote: On 25/01/2019 10:34 PM, AndreasDavour wrote: [...] auto point3 =

Re: How is this code supposed to work?

2019-01-25 Thread AndreasDavour via Digitalmars-d-learn
On Friday, 25 January 2019 at 12:09:34 UTC, AndreasDavour wrote: On Friday, 25 January 2019 at 09:36:24 UTC, rikki cattermole wrote: On 25/01/2019 10:34 PM, AndreasDavour wrote: [...] auto point3 = getResponse!(Point!int)("What's the point? "); [...] I thought about that option, if it

Re: How is this code supposed to work?

2019-01-25 Thread AndreasDavour via Digitalmars-d-learn
On Friday, 25 January 2019 at 09:36:24 UTC, rikki cattermole wrote: On 25/01/2019 10:34 PM, AndreasDavour wrote: How am I supposed to use that??   auto point3 = getResponse!Point!int("What's the point? "); auto point3 = getResponse!(Point!int)("What's the point? ");   auto point4 =

Re: How is this code supposed to work?

2019-01-25 Thread rikki cattermole via Digitalmars-d-learn
On 25/01/2019 10:34 PM, AndreasDavour wrote: How am I supposed to use that??   auto point3 = getResponse!Point!int("What's the point? "); auto point3 = getResponse!(Point!int)("What's the point? ");   auto point4 = getResponse!Point!int("What's the point? ");   writeln("Distance: ",