On Monday, 16 January 2023 at 08:17:24 UTC, Ali Çehreli wrote:
On 1/13/23 18:51, bauss wrote:
That's a good one!
It looks like you liked it four years ago as well. :) I found
where I remembered it from:
https://forum.dlang.org/post/pvdoq2$1e7t$3...@digitalmars.com
Ali
Looks like my me
On 1/13/23 18:51, bauss wrote:
That's a good one!
It looks like you liked it four years ago as well. :) I found where I
remembered it from:
https://forum.dlang.org/post/pvdoq2$1e7t$3...@digitalmars.com
Ali
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 reg
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
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!();
//mixin("wr
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
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 static
On Friday, 13 January 2023 at 16:54:34 UTC, Ali Çehreli wrote:
On 1/13/23 00:48, bauss wrote:
> 1. Change your mixin template to something like this:
There was a technique as a workaround for this template mixin
limitation but I can't find it right now.
> 2. Change the place where you instan
On 1/13/23 00:48, bauss wrote:
> 1. Change your mixin template to something like this:
There was a technique as a workaround for this template mixin limitation
but I can't find it right now.
> 2. Change the place where you instantiate to this:
I think the workaround I am trying to remember w
On Thursday, 12 January 2023 at 08:03:34 UTC, John Chapman wrote:
Why does the commented code work but the mixin not? Thanks for
any pointers.
Why not directly use the mixin template for opDispatch()?
```d
mixin template helper() {
void opDispatch(string name)() {
import std.stdio;
w
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!();
//mixin("wr
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!();
//mixin("wr
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!();
//mixin("writeln(12);");
}
}
void main() {
Foo.init.opDispatch!"bar"();
}
13 matches
Mail list logo