On Wednesday, 2 April 2025 at 08:38:32 UTC, Daniel Donnelly, Jr.
wrote:
On Wednesday, 2 April 2025 at 08:33:05 UTC, Inkrementator wrote:
All global variables in D, including static class members, are
thread local by default. You have to explicitly add the
`__gshared` attribute to the static var
On Tuesday, 1 April 2025 at 23:01:23 UTC, Daniel Donnelly, Jr.
wrote:
Say I have a static context stack in my class Context, will
each new thread receive their own copy of the static member or
do I have to account for multiple threads and do it myself?
All global variables in D, including stat
On Thursday, 6 March 2025 at 10:46:20 UTC, tmp wrote:
Do the same rules exist in D? If they do, do workarounds exist?
LDC and GDC offer nonstandard extensions to enable optimizations
regarding non-aliasing pointers with the @restrict
https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gdc/Common-Attr
On Sunday, 2 March 2025 at 19:31:06 UTC, realhet wrote:
Anyone have an idea?
While template mixins have access to the caller scope, the
default values for parameters apparently don't. If you `inline`
the default value, it will work
```
import std.traits;
mixin template T(string def)
{
enum
On Saturday, 15 February 2025 at 19:49:59 UTC, monkyyy wrote:
I think full sumtypes are probably usually overkill and I
rarely use it; but I have some lib ideas that need... something
This PR would probably make sumtypes easier to use in some
scenarios: https://github.com/dlang/phobos/pull/106
On Saturday, 15 February 2025 at 19:21:33 UTC, monkyyy wrote:
On Saturday, 15 February 2025 at 11:47:58 UTC, Inkrementator
wrote:
Would you expect that style change would remove this flavor of
bugs? Do you think this is a compiler bug?
It looks similar to this:
https://github.com/dlang/dmd/issu
On Sunday, 16 February 2025 at 07:38:09 UTC, Anonymouse wrote:
How can I make this work?
As a workaround, you can define a useless symbol and get the
parent of that.
```
module foo;
void bar(string s, int i)
{
assert(__FUNCTION__ == "foo.bar");
alias parentModule = __traits(parent, m
On Saturday, 15 February 2025 at 11:47:58 UTC, Inkrementator
wrote:
Wrapping foo in another delegate seems to at least compile.
Same as splitting out the struct. I don't understand why a struct
outside of a function gets treated differently than a static
struct.
```
auto split(alias F,R)(R
On Thursday, 6 February 2025 at 20:08:36 UTC, monkyyy wrote:
I have template hell code; eventually 5 nested range calls have
dual context-y issues and maybe compiler bugs; adding static
makes those errors go away, adding static to everything makes
new bugs.
Wack-a-mole when the compiler gets
On Monday, 2 December 2024 at 17:03:22 UTC, Basile B. wrote:
Big question is what is the problem if we specify that empty
struct is an error ?
It's pretty useful in combination with `std.sumtype`.
On Friday, 22 November 2024 at 16:36:43 UTC, Andrew wrote:
Error: variable \`i\` cannot be read at compile time
Tuple access seems to be internally coded as a template (with
unusual syntax) for the reasons already said. `i` has to be known
at compile time for this to work, so a template param
On Saturday, 16 March 2024 at 13:09:13 UTC, Adam D Ruppe wrote:
On Thursday, 14 March 2024 at 23:19:37 UTC, Inkrementator wrote:
@(__traits(getAttributes, thingYouWantToForward))
void yourNewThing() {}
Thanks, that should solve my problem.
http://dpldocs.info/this-week-in-d/Blog.Posted_2020_01
On Friday, 15 March 2024 at 19:13:38 UTC, cc wrote:
This is trivially easy if your types are visible at module
level, and mixin is a fine tool for the job. It doesn't work
quite so well with [Voldemort
types](https://wiki.dlang.org/Voldemort_types).
I used the following lines to make it work f
On Friday, 15 March 2024 at 17:48:26 UTC, mw wrote:
```
$ dub build
Could not resolve configuration for package demo
```
Trying to build your dependency msgpack-rpc, it spits out
```
Warning The sub configuration directive "vibe-d" ->
[libevent] references a configuration that does not ex
Hello,
I am trying to derive a struct from another. I want to modify
each field such that type of it goes from some T to Nullable!T,
preserving all fieldnames and UDAs.
I think that fieldnames and UDAs can only be duplicated via
string-mixins. This means that all field-types that aren't
visi
On Monday, 11 March 2024 at 16:10:24 UTC, Andrea wrote:
just trying it out and kinda fits my needs; the main issues are
lack of documentation and the need to explicit loop on array
data structures in the code (using sub-contexts) instead of
having a "foreach" loop statement in the template itse
On Thursday, 25 January 2024 at 18:44:26 UTC, atzensepp wrote:
However this works:
```d
int delegate (int) td = (x) =>
compose!(f,g,g,f,g,g,f,g,g,f)(x);
```
While not a real function pointer, this might already fit your
needs.
```d
alias td = compose!(f,g);
```
On Sunday, 5 November 2023 at 18:58:48 UTC, BoQsc wrote:
When you compile using `dmd` compiler you will often get `.exe`
and `.obj` file.
I would like to only produce `.exe` file:
On linux, gdc automatically cleans up object files by default.
Passing it the -pipe option will prevent their cr
On Sunday, 22 October 2023 at 23:49:40 UTC, Paul Backus wrote:
Nested structs contain a context pointer that needs to be
initialized at runtime. If you don't initialize them, the
pointer gets set to `null`, and the struct will not be able to
access its context.
I see, thanks for the explanati
On Sunday, 22 October 2023 at 21:02:32 UTC, Inkrementator wrote:
Running the code with `rdmd -version=fix app.d` works, but
running `rdmd -version=fix app.d` produces:
`Error: field `member` must be initialized in constructor,
because it is nested struct`
Sorry, obviously it should be:
Running
Consider this almost minimal example:
```
import std.algorithm;
import std.range;
import std.stdio;
struct S(Nested){
Nested member; // = I.init; // Uncommenting this wouldn't help
int g;
this(Nested member){
this.member = member;
}
On Sunday, 7 May 2023 at 21:12:22 UTC, Chris Piker wrote:
On the other hand, your first suggestion of using opCast() does
seem like a reasonable choice to me. Can you provide a short
code snippet using opCast to achieve the same result?
I've never used it, and particularly I know that I don't
On Sunday, 7 May 2023 at 18:19:04 UTC, Ali Çehreli wrote:
alias this is for implicit type conversions, which can be
achieved explicitly as well.
Open question to everybody: What you're opinion on using opCast
for this? Since it's a type conversion, it seems fitting to me.
And another suggest
On Monday, 27 March 2023 at 00:45:28 UTC, Salih Dincer wrote:
Likes **17**
Views **265**
Released on March **8, 2023**
I'm surprised that you can get 300 views in a month on a
primarily D video, but it's nice to see
On Sunday, 26 March 2023 at 18:49:57 UTC, eXodiquas wrote:
On Sunday, 26 March 2023 at 14:09:19 UTC, Inkrementator wrote:
But you said static bindings are the main portion of bindings
we use. So I tried to get static Lua bindings going.
Static Binding != Static Linking. Like I said, the termin
On Friday, 24 March 2023 at 23:45:15 UTC, eXodiquas wrote:
Hello everyone,
once again, I am here for your help. My last questions were
answered really competently so I try again. :P
So, maybe this is a stupid question, but I have read a lot
about Bindings to C and C++ libraries for D. For ex
26 matches
Mail list logo