On Wednesday, 4 October 2023 at 01:46:42 UTC, Joel wrote:
I think the if without static is still static, since it's part
of the function name part, or so (outside of the curly bracket
scope).
You can't have regular if-statements inside templates. Regular
if-statements are checked at runtime
On Monday, 2 October 2023 at 21:37:56 UTC, bachmeier wrote:
On Monday, 2 October 2023 at 19:28:32 UTC, BoQsc wrote:
I'm unable to see how the operator overloading would allow to
define a new custom operator.
And I don't expect that to change. This has come up many times.
With a parameter
On Tuesday, 15 August 2023 at 17:36:13 UTC, Steven Schveighoffer
wrote:
On 8/12/23 5:55 AM, IchorDev wrote:
On Thursday, 10 August 2023 at 15:20:28 UTC, Steven
Schveighoffer wrote:
That shouldn't matter.
Well, it does here. The AA is mutated during the loop, so
perhaps this is an
On Sunday, 13 August 2023 at 16:00:51 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Yeah you're right Ternary should probably be replaced, although
amazingly it has never caused problems so far.
But I cannot agree about RAII. Its a valid tool for managing
lifetimes of memory allocators.
I'm trying to implement a custom exception system in BetterC.
Does anyone know how I'd go about getting a stack trace so that I
can print it to stdout? :)
I was thinking of utilising UDAs & `__LINE__` but it turns out
that UDAs don't let you inject code, which is a shame!
On Thursday, 18 August 2022 at 11:25:22 UTC, Paul Backus wrote:
I think the closest way to approximate this in D is to use a
zero-length static array:
```d
struct ArenaChunk {
size_t size;
ArenaChunk* next;
char[0] memory;
}
```
Would Nullable be a good option as well?
On Monday, 5 September 2022 at 12:35:10 UTC, Paul Backus wrote:
Digging in a little deeper, it looks like the druntime
implementation ultimately depends on the C++ exception handling
ABI, via its platform-independent library interface. Bindings
are defined in `core.internal.backtrace.unwind`
On Sunday, 4 September 2022 at 18:49:37 UTC, Paul Backus wrote:
You can use `libunwind` for this:
https://www.nongnu.org/libunwind/
It's a C library, but it should work for D too.
Ah, I'm actually trying to create my own implementation of this,
so the goal would be to not rely on a
On Thursday, 9 March 2023 at 00:21:02 UTC, WhatMeWorry wrote:
my small dub.sdl project uses:
dependency "bindbc-glfw" version="~>1.0.1"
versions "GLFW_33"
and returns
Building bindbc-glfw 1.0.1: building configuration [dynamic]
`std.socket` is missing a `SocketOption`-equivalent to
`SO_PRIORITY`. Is this an intentional omission (and if so, why?),
or should I try to submit a PR to add it?
On Thursday, 13 April 2023 at 07:05:10 UTC, Chris Katko wrote:
I'm trying to figure out how to return a reference to something
that may not be a reference type.
```D
struct stats
{
float[string] data=0;
float ref opIndex(string key)
{
return data[key]; // want a ref to a specific element
Can anyone point me to a part of the D spec that says what
`static` means when applied to functions that are declared at
module scope? (Other than module constructors, obviously)
I used to assume the property would do something, so I actually
used it in a lot of my code when I was first
On Friday, 7 July 2023 at 03:18:53 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Yes, static on a free-function does not do anything.
Good to know. I think the D spec should definitely be amended to
explicitly mention that static *can* be applied to them, but
doesn't do anything.
On Friday, 7 July 2023 at 10:01:41 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Static does do something on functions when they are not
free-functions.
https://dlang.org/spec/attribute.html#static
Well yes, I even mentioned that in the OP. It's just that I'd
expect using `static`
On Thursday, 13 July 2023 at 10:53:49 UTC, Dennis wrote:
On Thursday, 13 July 2023 at 08:03:02 UTC, IchorDev wrote:
I've noticed that `__traits(getOverloads)` always returns the
overloads in lexical order across DMD, LDC, and GDC. Is this
reliable at all?
No. It depends on the order the
I've noticed that `__traits(getOverloads)` always returns the
overloads in lexical order across DMD, LDC, and GDC. Is this
reliable at all?
On Wednesday, 19 July 2023 at 08:27:18 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Its not as simple as porting to the API unfortunately.
We don't have barriers of any kind, so that removes most GC
designs you would want to use today. We are very close to
maxing out what we can do as a
On Wednesday, 19 July 2023 at 11:27:14 UTC, Richard (Rikki)
Andrew Cattermole wrote:
druntime supports registering of GC's not compiled with
druntime.
But because some of the machinery isn't available to you, you
would have to recreate it.
Oh right, so it's more of a matter of making
On Sunday, 9 July 2023 at 14:49:39 UTC, Steven Schveighoffer
wrote:
This is probably a bug somewhere, 4 seconds is too much. A
reduced test case would be helpful.
But I wanted to note, inside a struct template, the template
name (by itself) is equivalent to the current instantiation. So
While working on some new bindings, I've discovered that if
`opAssign` in a struct template "`BindingTempl(T)`" has the
return type "`BindingTempl!T` then it adds about 4 seconds to the
compile time per instantiation of `BindingTempl`. The added
compile time is much lower if a function other
On Friday, 7 July 2023 at 13:31:59 UTC, Steven Schveighoffer
wrote:
D allows no-op attributes in many cases because you can
possibly apply attributes to a group via `attribute:` or
`attribute { ... }`, and you may not want to fine-tune which
things can get the attribute to avoid errors.
On Monday, 26 June 2023 at 01:35:07 UTC, Soulsbane wrote:
Yeah, each folder under libs is a package and it's own git
repository. I think I'll just use the add-local approach. Kind
of a pain but getting spammed with a page of warnings every
compile is getting tiring :). Thanks a lot for the
On Sunday, 9 July 2023 at 20:24:24 UTC, Cecil Ward wrote:
Before I posted a question about avoiding unnecessary
allocs/reallocs when adding entries to an array like so
uint[ dstring ] arr;
when I build it up from nothing with successive insertions.
The array is accessed by a key that is
On Wednesday, 19 July 2023 at 10:50:07 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Copying out the conservative GC, register it under a different
name and getting that to compile and link without recompiling
druntime would be a good place to begin without having to
understand how GC's
On Wednesday, 28 June 2023 at 10:20:44 UTC, Dennis wrote:
It's now fixed: https://github.com/dlang/dmd/pull/15335
Yesss! You're a hero indeed!
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote:
So, I've gotten the itch to have a go at game development in D,
after doing a bit of it in Java last year. I've previously used
LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and
some other useful libs.
The problem is,
On Friday, 28 July 2023 at 17:04:33 UTC, bachmeier wrote:
[The
DIP](https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1030.md) was approved long ago. It was waiting for an implementation.
No shit, it felt like an eternity. But it's still not in the
spec...?
I've been getting a lot of segfaults from using associative
arrays recently. The faults happen seemingly at random, and from
pretty mundane stuff like `if(auto x = y in z)` that run very
often:
```
Segmentation fault.
#0 0x55670f4a in rt.aaA.Impl.findSlotLookup(ulong, scope
I'm not aware of any way to do that exact thing. Measuring what
column a line is on would be quite subjective. How wide is a tab
space? Technically, it could be any number of columns depending
on the display configuration used.
On Sunday, 23 July 2023 at 15:01:51 UTC, realhet wrote:
Why is
On Thursday, 27 July 2023 at 21:31:02 UTC, Jonathan M Davis wrote:
Now, as to what's happening in your code that's causing
segfaults, the most likely culprit would be that you're
accessing the AA without actually having done anything to
prevent other threads from accessing it at the same
On Monday, 24 July 2023 at 13:30:27 UTC, cc wrote:
Is there any list of known significant "gotchas" with moving to
LDC from DMD? Any unexpected surprises to watch out for or be
careful for? I'm thinking of all the "features" of DMD that
are now considered verboten by many users (e.g.
On Friday, 28 July 2023 at 04:13:13 UTC, Kagamin wrote:
The difference between them is purely formal if you're not on
an old gdc, where shared was synchronized like C# volatile.
I'm not sure that's correct. Also I always use the latest
compiler versions where possible.
start many threads
On Friday, 28 July 2023 at 11:15:31 UTC, Steven Schveighoffer
wrote:
All `__gshared` does is give you storage that is accessible
from all threads,
"All __gshared does is give you [a live bomb, ready to go off at
any moment]"
!!
On Friday, 28 July 2023 at 14:10:16 UTC, Kagamin wrote:
Your
On Tuesday, 11 July 2023 at 17:43:43 UTC, Steven Schveighoffer
wrote:
On 7/11/23 11:22 AM, Ki Rill wrote:
On Tuesday, 11 July 2023 at 15:16:54 UTC, Ki Rill wrote:
apply(Appearance(color: BLACK, strokeWidth: 4)); // other
fields are default initialized: strokeOpacity, fillOpacity,
Yes, I was
On Thursday, 27 July 2023 at 21:31:02 UTC, Jonathan M Davis wrote:
What should normally be happening is that you use shared, and
then when you've protected the object so that you know that it
can only be accessed on the current thread by the section of
code that you're in (e.g. by locking a
On Sunday, 18 June 2023 at 10:04:14 UTC, FeepingCreature wrote:
On Sunday, 18 June 2023 at 09:48:40 UTC, IchorDev wrote:
Does anyone understand why this happens?
Is there any way to subvert this behaviour, or is it actually
a bug?
Yes, see also my bug report,
`source/mod/submod.d:`
```d
module mod.submod;
enum T1{ x }
```
`source/mod/package.d`:
```d
module mod;
import mod.submod;
enum T2{ y }
enum T3{ z }
static foreach(member; __traits(allMembers, mod)){
pragma(msg, member);
}
/**Prints:
object
T1
**/
```
I get the members of `mod.submod`
I feel like I can't possibly be the first to ask, but I couldn't
find any prior discussion of this:
When is `std.experimental.allocator` going to be moved out of
`experimental`? Is there any roadmap for it? Is it just in limbo?
On Wednesday, 8 November 2023 at 11:48:58 UTC, BoQsc wrote:
I would like to export some functionality as external shared
dynamically linked D library.
Is it possible to do that in D Language
Yes, as long as the symbols you want to use externally are
`public`, which is the default.
When it
On Thursday, 4 April 2024 at 14:29:56 UTC, WhatMeWorry wrote:
Error: Unresolvable dependencies to package bindbc-loader:
bindbc-opengl 0.13.0 depends on bindbc-loader ~>0.3.0
bindbc-sdl 1.4.7 depends on bindbc-loader ~>1.1.0
Please update `bindbc-opengl` to `1.1.0`. I think it's
On Thursday, 4 April 2024 at 18:14:54 UTC, BoQsc wrote:
I'm looking for more readable standard function to add a
**character** literal to a **string**.
Concatenate is the verb you're looking for, not add. 'Adding' a
`char` to a `string` sounds like you want `myString[] +=
myChar;`, which
41 matches
Mail list logo