Re: Setting up a final switch from a list

2023-08-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, August 2, 2023 12:19:55 PM MDT Cecil Ward via Digitalmars-d- learn wrote: > Am I right in thinking that final switch can be used to check > that all the elements in an enum are handled in cases? Thinking > that this is a worthwhile safety check, I’d like to convert an > existing list

Re: Why is GC.collect `pure`

2023-08-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, August 2, 2023 12:02:35 PM MDT Nick Treleaven via Digitalmars-d- learn wrote: > On Wednesday, 2 August 2023 at 17:55:12 UTC, Nick Treleaven wrote: > > On Wednesday, 2 August 2023 at 17:52:00 UTC, Nick Treleaven > > > > wrote: > >> Now I'm wondering why those functions are marked

Setting up a final switch from a list

2023-08-02 Thread Cecil Ward via Digitalmars-d-learn
Am I right in thinking that final switch can be used to check that all the elements in an enum are handled in cases? Thinking that this is a worthwhile safety check, I’d like to convert an existing list into an enum for use in a final switch. I have an existing list which I use elsewhere,

Re: Why is GC.collect `pure`

2023-08-02 Thread Nick Treleaven via Digitalmars-d-learn
On Wednesday, 2 August 2023 at 17:55:12 UTC, Nick Treleaven wrote: On Wednesday, 2 August 2023 at 17:52:00 UTC, Nick Treleaven wrote: Now I'm wondering why those functions are marked `pure` - they must affect the GC's bookkeeping state. I guess it was because the GC's internal state is not

Re: Why is GC.collect `pure`

2023-08-02 Thread Nick Treleaven via Digitalmars-d-learn
On Wednesday, 2 August 2023 at 17:52:00 UTC, Nick Treleaven wrote: Now I'm wondering why those functions are marked `pure` - they must affect the GC's bookkeeping state. Here's the pull that added it: https://github.com/dlang/druntime/pull/3561

Re: Why is GC.collect not @safe?

2023-08-02 Thread Nick Treleaven via Digitalmars-d-learn
On Wednesday, 2 August 2023 at 13:27:50 UTC, Steven Schveighoffer wrote: On 8/2/23 7:40 AM, Nick Treleaven wrote: Presumably an allocation like `new T` (for a type with a @safe constructor) can be made anywhere a call to `GC.collect` can be made, which may trigger a collection. So why isn't

Re: Why is GC.collect not @safe?

2023-08-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/2/23 7:40 AM, Nick Treleaven wrote: Presumably an allocation like `new T` (for a type with a @safe constructor) can be made anywhere a call to `GC.collect` can be made, which may trigger a collection. So why isn't `GC.collect` marked @safe? It should be. Maybe historical reasons? One

Re: openssl 1.1 vs. 3.0 for vibe.d:tls on Ubuntu 22.04

2023-08-02 Thread Mathias LANG via Digitalmars-d-learn
On Friday, 28 July 2023 at 08:56:17 UTC, Guillaume Lathoud wrote: Hello, some context first: I recently updated a server to Ubuntu 22.04 which appears to have only openssl 3.0.2 installed. Dub could compile my project, but could not link it anymore, as the D code seemed to be expecting