Re: Metaprogramming with D

2020-06-09 Thread tastyminerals via Digitalmars-d-learn
On Monday, 8 June 2020 at 14:41:55 UTC, Jan Hönig wrote: On Sunday, 7 June 2020 at 00:45:37 UTC, Ali Çehreli wrote: dmd -mixin= ... thanks for the tip! writeln(q{ void foo() { } }); What is the name of this `q` thing? How do i find it? Are there any recent tutorials

Re: Metaprogramming with D

2020-06-09 Thread ag0aep6g via Digitalmars-d-learn
On 09.06.20 20:16, Ali Çehreli wrote: I am biased but I like my :) index of the book, where all such syntax items appear:   https://ddili.org/ders/d.en/ix.html Oh yeah. It's how I got the link. You might want to fix some of the URLs, though. Characters like '{' or '[' need to be

Re: Metaprogramming with D

2020-06-09 Thread Ali Çehreli via Digitalmars-d-learn
On 6/8/20 7:50 AM, ag0aep6g wrote: https://ddili.org/ders/d.en/literals.html#ix_literals.q%7B%7D Thank you. I am biased but I like my :) index of the book, where all such syntax items appear: https://ddili.org/ders/d.en/ix.html Ali

Re: Metaprogramming with D

2020-06-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 8 June 2020 at 14:41:55 UTC, Jan Hönig wrote: What is the name of this `q` thing? It is just a string that looks like code.

Re: Metaprogramming with D

2020-06-08 Thread ag0aep6g via Digitalmars-d-learn
On 08.06.20 16:45, ag0aep6g wrote: On 08.06.20 16:41, Jan Hönig wrote: On Sunday, 7 June 2020 at 00:45:37 UTC, Ali Çehreli wrote: [...]   writeln(q{   void foo() {   }     }); What is the name of this `q` thing? How do i find it? Are there any recent tutorials on it?

Re: Metaprogramming with D

2020-06-08 Thread ag0aep6g via Digitalmars-d-learn
On 08.06.20 16:41, Jan Hönig wrote: On Sunday, 7 June 2020 at 00:45:37 UTC, Ali Çehreli wrote: [...]   writeln(q{   void foo() {   }     }); What is the name of this `q` thing? How do i find it? Are there any recent tutorials on it? https://dlang.org/spec/lex.html#token_strings

Re: Metaprogramming with D

2020-06-08 Thread Jan Hönig via Digitalmars-d-learn
On Sunday, 7 June 2020 at 00:45:37 UTC, Ali Çehreli wrote: dmd -mixin= ... thanks for the tip! writeln(q{ void foo() { } }); What is the name of this `q` thing? How do i find it? Are there any recent tutorials on it?

Re: Metaprogramming with D

2020-06-08 Thread FunkyD via Digitalmars-d-learn
On Sunday, 7 June 2020 at 00:45:37 UTC, Ali Çehreli wrote: On 6/6/20 5:03 PM, FunkyD wrote:> On Saturday, 6 June 2020 at 09:57:36 UTC, Jan Hönig wrote: > D is pretty good for meta-programming. For certain other things it is > terrible. I am glad I don't know enough about other technologies to

Re: Metaprogramming with D

2020-06-06 Thread Don via Digitalmars-d-learn
On Sunday, 7 June 2020 at 00:45:37 UTC, Ali Çehreli wrote: False. And again, even if so, that's not because of D, but because of humans. Can you imagine a CTO, say, in Silicon Valley to have guts to bring D instead of C++? With C++, the CTO will never be blamed; but D, he or she can easily be

Re: Metaprogramming with D

2020-06-06 Thread Ali Çehreli via Digitalmars-d-learn
On 6/6/20 5:03 PM, FunkyD wrote:> On Saturday, 6 June 2020 at 09:57:36 UTC, Jan Hönig wrote: > D is pretty good for meta-programming. For certain other things it is > terrible. I am glad I don't know enough about other technologies to feel that way. > String mixins simply mix in D code. It

Re: Metaprogramming with D

2020-06-06 Thread FunkyD via Digitalmars-d-learn
On Saturday, 6 June 2020 at 09:57:36 UTC, Jan Hönig wrote: We have two (little) student projects, which should use D for meta-programming/code generation. More specifically string mixins and templates. I understand (at least I think so :)) string mixins. The task is to create a small

Re: Metaprogramming with D

2020-06-06 Thread mw via Digitalmars-d-learn
On Saturday, 6 June 2020 at 09:57:36 UTC, Jan Hönig wrote: We have two (little) student projects, which should use D for meta-programming/code generation. More specifically string mixins and templates. I found this doc:

Re: Metaprogramming with D.

2013-10-19 Thread TheFlyingFiddle
On Saturday, 19 October 2013 at 15:22:31 UTC, Agustin wrote: I'm trying to implement a template Vector and i would like to know if this is possible. My current vector class is: public class Vector(T, size_t size) { private T components[size]; } And i would like to implement a property as

Re: Metaprogramming with D.

2013-10-19 Thread TheFlyingFiddle
res += components[i]; Should be res += components[i] * components[i];