Re: Coding Challenges - Dlang or Generic

2023-01-14 Thread TheZipCreator via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 00:17:18 UTC, Paul wrote: Greetings Dlang-ers I was wondering if anyone knew of any coding challenges available where the input and output are specified and its left to the programmer to find a solution? Free would be nice but even paid services would be worth

Re: Mixin helper help

2023-01-14 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 14 January 2023 at 02:51:56 UTC, bauss wrote: Ali That's a good one! also very very good, it's clever! SDB@79

Re: Mixin helper help

2023-01-14 Thread John Chapman via Digitalmars-d-learn
On Friday, 13 January 2023 at 14:32:44 UTC, Salih Dincer wrote: Why not directly use the mixin template for opDispatch()? My opDispatch generates code based on the arguments passed, interpolating variable names and functions based on the type. I wanted to remove the double braces in my

Re: Mixin helper help

2023-01-14 Thread TheZipCreator via Digitalmars-d-learn
On Thursday, 12 January 2023 at 08:03:34 UTC, John Chapman wrote: I'm obviously doing something wrong, but don't quite understand. ```d mixin template helper() { mixin("writeln(12);"); } struct Foo { void opDispatch(string name)() { import std.stdio; mixin helper!();

Re: Why does the importC example not compile?

2023-01-14 Thread Gavin Ray via Digitalmars-d-learn
On Friday, 13 January 2023 at 12:46:33 UTC, Dennis wrote: On Friday, 13 January 2023 at 12:33:28 UTC, kdevel wrote: What must be added or changed in order to test every example which is intended to produce an executable? Support for separate compilation / ImportC would need to be added to

Re: Mixin helper help

2023-01-14 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 14 January 2023 at 18:57:21 UTC, John Chapman wrote: I wanted to remove the double braces in my static foreach (needed as I declared some aliases inside but since it creates a scope those new variables can't be referred to outside of it). Inside a function, you can often just use

Re: Mixin helper help

2023-01-14 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 14 January 2023 at 23:07:13 UTC, TheZipCreator wrote: This is not the purpose mixin templates are meant to serve. They're for copying declarations into scopes (and as such only support declarations in them). Instead, I think what you want is I'm trying to understand you. But I