On Sunday, 26 November 2023 at 15:35:39 UTC, Adam D Ruppe wrote:
On Thursday, 23 November 2023 at 16:33:52 UTC, DLearner wrote:
string mxnTest(string strVar1, string strVar2) {
return `(int Var1, int Var2) {
if (Var1 > Var2) {
return true;
} else {
return false;
On Thursday, 23 November 2023 at 16:33:52 UTC, DLearner wrote:
Code below is intended to test simple mixin with lambda
function under -betterC.
Works with full-D, but fails with 'needs GC' errors under
-betterC.
Why is this so, bearing in mind the concatenations are executed
at
compile, not
On Thursday, 23 November 2023 at 16:33:52 UTC, DLearner wrote:
string mxnTest(string strVar1, string strVar2) {
return `(int Var1, int Var2) {
if (Var1 > Var2) {
return true;
} else {
return false;
}
}(` ~ strVar1 ~ `,` ~ strVar2 ~ `)`;
}
```
This
On Thursday, 23 November 2023 at 17:02:58 UTC, Paul Backus wrote:
[...]
This is a known limitation:
https://issues.dlang.org/show_bug.cgi?id=23637
[...]
Sorry to come back to this, but the reference above suggests
_not_ a bug in the compiler.
If not a bug in the compiler, please, what is
On Thursday, 23 November 2023 at 18:54:09 UTC, Julian Fondren
wrote:
[...]
The `enum` answer?
[...]
No, the 'template' answer.
To me, if the 'template' suggestion worked (as it did), then my
simple mixin (as in my original post) should also work.
On Thursday, 23 November 2023 at 17:46:55 UTC, DLearner wrote:
I just find it surprising that your suggestion worked, but the
(slightly simpler) earlier version did not.
The `enum` answer? That also works, but you have to make a change
at the callsite as well, to `mixin(mxnTest!("Var_A",
On Thursday, 23 November 2023 at 17:03:29 UTC, Julian Fondren
wrote:
On Thursday, 23 November 2023 at 16:33:52 UTC, DLearner wrote:
Why is this so, bearing in mind the concatenations are
executed at
compile, not run, time?
If you compile without -betterC, it'll work, but if you examine
the
On Thursday, 23 November 2023 at 16:33:52 UTC, DLearner wrote:
Why is this so, bearing in mind the concatenations are executed
at
compile, not run, time?
If you compile without -betterC, it'll work, but if you examine
the result you'll find that the mxnTest function is still
compiled into
On Thursday, 23 November 2023 at 16:33:52 UTC, DLearner wrote:
Code below is intended to test simple mixin with lambda
function under -betterC.
Works with full-D, but fails with 'needs GC' errors under
-betterC.
Why is this so, bearing in mind the concatenations are executed
at
compile, not
Code below is intended to test simple mixin with lambda function
under -betterC.
Works with full-D, but fails with 'needs GC' errors under
-betterC.
Why is this so, bearing in mind the concatenations are executed at
compile, not run, time?
```
// Test harness
extern(C) void main() {
10 matches
Mail list logo