Re: Mixed up over mixins.

2017-08-21 Thread Johnson via Digitalmars-d-learn
On Monday, 21 August 2017 at 07:34:23 UTC, WhatMeForget wrote: On Sunday, 20 August 2017 at 22:50:40 UTC, Johnson Jones wrote: On Sunday, 20 August 2017 at 19:27:43 UTC, WhatMeWorry wrote: [...] It's not difficult, it's just new. It's not that you are a poor programmer, but you simply have

Re: Mixed up over mixins.

2017-08-21 Thread Ali Çehreli via Digitalmars-d-learn
On 08/21/2017 12:29 AM, WhatMeForget wrote: > Thanks. Don't know if you noticed, but i used some code from your book. > Hope you take that as a complement. I did notice that and thank you. Every time I see people struggle with code that originated from my half-witted examples, I actually feel

Re: Mixed up over mixins.

2017-08-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/21/17 3:29 AM, WhatMeForget wrote: On Sunday, 20 August 2017 at 19:41:14 UTC, Ali Çehreli wrote: On 08/20/2017 12:27 PM, WhatMeWorry wrote: > // Mixins are for mixing in generated code into the source code. > // The mixed in code may be generated as a template instance > // or

Re: Mixed up over mixins.

2017-08-21 Thread WhatMeForget via Digitalmars-d-learn
On Sunday, 20 August 2017 at 22:50:40 UTC, Johnson Jones wrote: On Sunday, 20 August 2017 at 19:27:43 UTC, WhatMeWorry wrote: [...] It's not difficult, it's just new. It's not that you are a poor programmer, but you simply have not learned how to think about mixins correctly. Stop whining

Re: Mixed up over mixins.

2017-08-21 Thread WhatMeForget via Digitalmars-d-learn
On Sunday, 20 August 2017 at 19:41:14 UTC, Ali Çehreli wrote: On 08/20/2017 12:27 PM, WhatMeWorry wrote: > // Mixins are for mixing in generated code into the source code. > // The mixed in code may be generated as a template instance > // or a string. Yes, it means that the string

Re: Mixed up over mixins.

2017-08-20 Thread Johnson Jones via Digitalmars-d-learn
On Sunday, 20 August 2017 at 19:27:43 UTC, WhatMeWorry wrote: It's stuff like this which makes me very frustrated. Or depressed because it demonstrates just how poor a programmer I am: string printStatement(string message) { return `writeln("` ~ message ~ `");`; } void main() { //

Re: Mixed up over mixins.

2017-08-20 Thread Ali Çehreli via Digitalmars-d-learn
On 08/20/2017 12:27 PM, WhatMeWorry wrote: > // Mixins are for mixing in generated code into the source code. > // The mixed in code may be generated as a template instance > // or a string. Yes, it means that the string must be legal D code. > mixin(`writeln(` ~ `Hello` ~

Mixed up over mixins.

2017-08-20 Thread WhatMeWorry via Digitalmars-d-learn
It's stuff like this which makes me very frustrated. Or depressed because it demonstrates just how poor a programmer I am: string printStatement(string message) { return `writeln("` ~ message ~ `");`; } void main() { // Mixins are for mixing in generated code into the source code.