Re: How to obtain Variant underlying type?

2022-07-10 Thread jfondren via Digitalmars-d-learn
On Monday, 11 July 2022 at 03:17:33 UTC, anonymouse wrote: On Sunday, 10 July 2022 at 18:31:46 UTC, drug007 wrote: I'd like to say that using of exception to break loop is really bad. Exception is exceptional thing but in the case above the exception is ordinary completion of the loop

Re: How to obtain Variant underlying type?

2022-07-10 Thread anonymouse via Digitalmars-d-learn
On Sunday, 10 July 2022 at 18:31:46 UTC, drug007 wrote: I'd like to say that using of exception to break loop is really bad. Exception is exceptional thing but in the case above the exception is ordinary completion of the loop happens on regular basis. Don't do that. Thanks for the advice.

Re: Is there any implementation of a 128bit integer?

2022-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/22 8:19 PM, Era Scarecrow wrote: On Friday, 8 July 2022 at 15:32:44 UTC, Rob T wrote: https://forum.dlang.org/post/mailman.10914.1566237225.29801.digitalmars-d-le...@puremagic.com In case someone comes across this old thread https://dlang.org/phobos/core_int128.html There was a

Re: Is there any implementation of a 128bit integer?

2022-07-10 Thread max haughton via Digitalmars-d-learn
On Monday, 11 July 2022 at 00:19:23 UTC, Era Scarecrow wrote: On Friday, 8 July 2022 at 15:32:44 UTC, Rob T wrote: [...] There was a discussion on this not long ago. Walter tried implementing it recently too, though I'm guessing he gave up. [...] Note that you're replying to a message

Re: Is there any implementation of a 128bit integer?

2022-07-10 Thread Era Scarecrow via Digitalmars-d-learn
On Friday, 8 July 2022 at 15:32:44 UTC, Rob T wrote: https://forum.dlang.org/post/mailman.10914.1566237225.29801.digitalmars-d-le...@puremagic.com In case someone comes across this old thread https://dlang.org/phobos/core_int128.html There was a discussion on this not long ago. Walter tried

Re: How to debug thread code

2022-07-10 Thread z via Digitalmars-d-learn
On Sunday, 10 July 2022 at 21:27:08 UTC, Hipreme wrote: I'm stuck in a racing condition right now and I'm unable to run a debugger on the code. Usually I was using Visual Studio 2019 for debugging my code, but it shows the following message: "Your app has entered a break state, but there is

How to debug thread code

2022-07-10 Thread Hipreme via Digitalmars-d-learn
I'm stuck in a racing condition right now and I'm unable to run a debugger on the code. Usually I was using Visual Studio 2019 for debugging my code, but it shows the following message: "Your app has entered a break state, but there is no code to show because all threads were executing

Re: How to obtain Variant underlying type?

2022-07-10 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 10 July 2022 at 18:31:46 UTC, drug007 wrote: On 7/10/22 20:26, anonymouse wrote: On Sunday, 10 July 2022 at 06:26:37 UTC, jfondren wrote: ```d import std.variant : Variant; size_t[] shape(Variant v) {     import std.variant : VariantException;     size_t[] s;     try {    

Re: How to obtain Variant underlying type?

2022-07-10 Thread anonymouse via Digitalmars-d-learn
On Sunday, 10 July 2022 at 06:26:37 UTC, jfondren wrote: ```d import std.variant : Variant; size_t[] shape(Variant v) { import std.variant : VariantException; size_t[] s; try { while (true) { Variant elem = v[0]; s ~= v.length; v = elem;

Re: Background thread, async and GUI (dlangui)

2022-07-10 Thread Bagomot via Digitalmars-d-learn
Based on Thread, I managed to do what I intended. I have not yet been able to figure out how to do the same through the Task. Here in the example, when you click on the Start button, a worker is launched that updates the progress bar. ```d import dlangui; import core.thread; import std.conv;

Re: How to obtain Variant underlying type?

2022-07-10 Thread jfondren via Digitalmars-d-learn
On Saturday, 9 July 2022 at 23:04:20 UTC, anonymouse wrote: On Saturday, 9 July 2022 at 14:46:36 UTC, Adam D Ruppe wrote: Impossible; Variant's type is only known at runtime, and this would require compile time knowledge. Hmmm. Okay, thanks. What I really need to know is how many