Re: msghdr and cmsghdr mismatch for alpine musl

2023-11-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On Saturday, 25 November 2023 at 05:04:57 UTC, d007 wrote: `import core.sys.posix.sys.socket : msghdr, cmsghdr, iovec;` `msg_iovlen`, `msg_controllen`, `cmsg_len` is ulong for x86-64 in druntime. in alpine musl, they are int, socklen_t(uint), socklen_t(uint). Is this mismatch can cause

Re: mixin under -betterC

2023-11-26 Thread DLearner via Digitalmars-d-learn
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 g

Re: mixin under -betterC

2023-11-26 Thread Adam D Ruppe via Digitalmars-d-learn
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 funct

Re: Compiling an app to a single binary - possible?

2023-11-26 Thread Dmitry Ponyatov via Digitalmars-d-learn
Theoretically possible but not really expected to and generally does not give you much over simply distributing an archive. I'd even discourage it because it makes impossible to delegate handling of static assets to reverse proxy like nginx (which is likely to do better job at it being speciali

Re: mixin under -betterC

2023-11-26 Thread Basile B. via Digitalmars-d-learn
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

Why this compiles?

2023-11-26 Thread Antonio via Digitalmars-d-learn
In this example, ```a``` and ```b``` vars are not of the same type and don't implement the same interface. **why ```assert(a==b)``` compiles?** ```d interface IOpt(T) { bool opEquals(const IOpt!T) const @safe pure; } class None(T) : IOpt!T { bool opEquals(const IOpt!T other) const @safe

Re: Why this compiles?

2023-11-26 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 26 November 2023 at 21:45:21 UTC, Antonio wrote: In this example, ```a``` and ```b``` vars are not of the same type and don't implement the same interface. **why ```assert(a==b)``` compiles?** They're both subclasses of Object and inherit a generic opEquals from that base.