On 4/1/25 10:08 AM, Mike Parker wrote:
> ```
> scope ctx = new Context;
> ```
>
> This will allocate the class instance on the stack so the destructor
> will be called when the scope exits.
Another option is to call the destructor explicitly through destroy():
import std.stdio;
class C {
~t
I thought the destructor might automatically be called after with
(new Context()) {} but it's not. Is there some sort of
entry/exit functions like in Python?
On Tuesday, 1 April 2025 at 17:33:02 UTC, Ali Çehreli wrote:
On 4/1/25 10:08 AM, Mike Parker wrote:
> ```
> scope ctx = new Context;
> ```
>
> This will allocate the class instance on the stack so the
destructor
> will be called when the scope exits.
Another option is to call the destructor expl
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?
On Tuesday, 1 April 2025 at 17:08:27 UTC, Mike Parker wrote:
On Tuesday, 1 April 2025 at 16:54:50 UTC, Daniel Donnelly, Jr.
wrote:
[...]
You've used `new`, which means it's allocated with the GC. In
that case, your destructor is a finalizer and may or may not be
called at any point during th
On Tuesday, 1 April 2025 at 16:54:50 UTC, Daniel Donnelly, Jr.
wrote:
I thought the destructor might automatically be called after
with (new Context()) {} but it's not. Is there some sort of
entry/exit functions like in Python?
You've used `new`, which means it's allocated with the GC. In
th
On Tuesday, 1 April 2025 at 09:21:25 UTC, Daniel Donnelly, Jr.
wrote:
It's a major bottleneck to my coding performance.
I don't see a good reason to use a random address or some content
of a string for hashing. I'm also amazed that a user might be
allowed to change values at will; values
On Tuesday, 1 April 2025 at 09:21:25 UTC, Daniel Donnelly, Jr.
wrote:
Something like this. I know I could very well hash latex
member, but what if the user redefines toString() ? So I would
like to call toString(), but DMD compiler bitches:
```
Error: @safe function def.Def.toHash cannot cal