Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-13 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 13 February 2023 at 07:19:49 UTC, Kagamin wrote: On Friday, 10 February 2023 at 21:52:02 UTC, ProtectAndHide wrote: Well in Swift, there is no problem .. at all. Why is it a problem in D then? (and I mean technically). What about the increment operator `++` ? Remember, that a

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-13 Thread Kagamin via Digitalmars-d-learn
On Monday, 13 February 2023 at 08:22:06 UTC, ProtectAndHide wrote: Chris Lattner outlines the reasons for removing it in Swift 3.0 here: https://github.com/apple/swift-evolution/blob/main/proposals/0004-remove-pre-post-inc-decrement.md So your complaint is that you agree with Chris Lattner

Re: ddbc with Vibe-d

2023-02-13 Thread Steve via Digitalmars-d-learn
On Monday, 13 February 2023 at 01:43:38 UTC, Steven Schveighoffer wrote: I think it needs to be immutable if it's a reference. -Steve I have tested args with isWeaklyIsolated!(typeof(arg)) and it looks like good news ️ Thanks for your help, Steve.

My vibe-d test app is crashing on Windows

2023-02-13 Thread Steve via Digitalmars-d-learn
The app is just a test echo server. JSON sent in the body of a POST request is echoed back to the client. On Pop!_OS it works fine but on Windows it responds, there's a delay of about 10 seconds and then it crashes with the error: ``` Error Program exited with code -1073741819 ``` Here's the

Re: My vibe-d test app is crashing on Windows

2023-02-13 Thread ShadoLight via Digitalmars-d-learn
On Monday, 13 February 2023 at 13:12:23 UTC, Steve wrote: The app is just a test echo server. JSON sent in the body of a POST request is echoed back to the client. On Pop!_OS it works fine but on Windows it responds, there's a delay of about 10 seconds and then it crashes with the error: ```

Re: My vibe-d test app is crashing on Windows

2023-02-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/13/23 8:12 AM, Steve wrote: The app is just a test echo server. JSON sent in the body of a POST request is echoed back to the client. On Pop!_OS it works fine but on Windows it responds, there's a delay of about 10 seconds and then it crashes with the error: ``` Error Program exited

Simplest way to convert an array into a set

2023-02-13 Thread Matt via Digitalmars-d-learn
Obviously, there is no "set" object in D, but I was wondering what the quickest way to remove duplicates from an array would be. I was convinced I'd seen a "unique" method somewhere, but I've looked through the documentation for std.array, std.algorithm AND std.range, and I've either missed

Re: Simplest way to convert an array into a set

2023-02-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/13/23 1:04 PM, Matt wrote: Obviously, there is no "set" object in D, but I was wondering what the quickest way to remove duplicates from an array would be. I was convinced I'd seen a "unique" method somewhere, but I've looked through the documentation for std.array, std.algorithm AND

Re: Simplest way to convert an array into a set

2023-02-13 Thread Christian Köstlin via Digitalmars-d-learn
On 13.02.23 19:04, Matt wrote: Obviously, there is no "set" object in D, but I was wondering what the quickest way to remove duplicates from an array would be. I was convinced I'd seen a "unique" method somewhere, but I've looked through the documentation for std.array, std.algorithm AND

Re: Simplest way to convert an array into a set

2023-02-13 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Feb 13, 2023 at 06:04:40PM +, Matt via Digitalmars-d-learn wrote: > Obviously, there is no "set" object in D, Actually, bool[T] could be used as a set object of sorts. Or even void[0][T], though that's a little more verbose to type. But this can be aliased to something nicer (see

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-13 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 13 February 2023 at 09:14:18 UTC, Kagamin wrote: On Monday, 13 February 2023 at 08:22:06 UTC, ProtectAndHide wrote: Chris Lattner outlines the reasons for removing it in Swift 3.0 here:

Re: Simplest way to convert an array into a set

2023-02-13 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 13 February 2023 at 18:04:40 UTC, Matt wrote: Obviously, there is no "set" object in D, but I was wondering what the quickest way to remove duplicates from an array would be. I was convinced I'd seen a "unique" method somewhere, but I've looked through the documentation for

Re: Simplest way to convert an array into a set

2023-02-13 Thread Salih Dincer via Digitalmars-d-learn
On Monday, 13 February 2023 at 18:04:40 UTC, Matt wrote: Obviously, there is no "set" object in D, but I was wondering what the quickest way to remove duplicates from an array would be... Where did you find out that there is no set() in the D programming language? **Simple example:** ```d