Re: Background thread, async and GUI (dlangui)

2022-07-08 Thread Ali Çehreli via Digitalmars-d-learn
On 7/8/22 06:32, Bagomot wrote: > I do as in Ali's example, but > the GUI is still blocked: I don't know exactly why but something looks suspicious. > ```d > auto btn = new Button("Run"d); > btn.click = delegate(Widget src) { > auto request = Request("dlang.org"); That is a local variable

Is there any implementation of a 128bit integer?

2022-07-08 Thread Rob T via Digitalmars-d-learn
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

Re: Background thread, async and GUI (dlangui)

2022-07-08 Thread Bagomot via Digitalmars-d-learn
On Friday, 8 July 2022 at 08:04:45 UTC, Bagomot wrote: On Thursday, 7 July 2022 at 18:26:15 UTC, Ali Çehreli wrote: Summing up your help and GrimMaple, I understood how to make the file download progress bar beautifully. Thank you! I only have a question with how I can work with the GUI from

Re: Cannot copy void[] to void[] in @safe code?

2022-07-08 Thread wjoe via Digitalmars-d-learn
On Friday, 8 July 2022 at 12:26:03 UTC, ag0aep6g wrote: You're allowed to copy from `ubyte[]` to `ubyte[]`. But you're not allowed to copy from `ubyte[]` to `int*[]`, because reinterpreting a bunch of bytes as pointers is not safe. The thing about `void[]` is that it can point to memory that

Re: Unwrap variadic template into vararg of pointers of the same types

2022-07-08 Thread wjoe via Digitalmars-d-learn
Corrections: On Friday, 8 July 2022 at 12:40:52 UTC, wjoe wrote: alias Recurse = AliasSeq!(Arg[0]*, Recurse!(Arg[0..$]); ```d alias Recurse = AliasSeq!(Arg[0]*, Recurse!(Arg[1..$]); ``` void view_it(Args...)(void function(entity_t, Includes!(Args) ) ```d void view_it(Args..

Re: Unwrap variadic template into vararg of pointers of the same types

2022-07-08 Thread Paul Backus via Digitalmars-d-learn
On Friday, 8 July 2022 at 12:20:13 UTC, ryuukk_ wrote: The problem when i try to introduce variadic template, is i can't seem to understand how to unwrap the parameter as pointer type T -> T* ```D struct Includes(Args...) { alias args = Args; } void view_it(Includes)(void function(entity_t,

Re: Unwrap variadic template into vararg of pointers of the same types

2022-07-08 Thread wjoe via Digitalmars-d-learn
On Friday, 8 July 2022 at 12:20:13 UTC, ryuukk_ wrote: I'm not sure how to phrase it so it'll try with code I have this piece of code that i would like to improve, right now i have to create bunch of duplicates ```D void view_it(A, B)(void function(entity_t, A*, B*) cb) { fore

Re: Cannot copy void[] to void[] in @safe code?

2022-07-08 Thread ag0aep6g via Digitalmars-d-learn
On Friday, 8 July 2022 at 10:58:24 UTC, wjoe wrote: My understanding is that a void[] doesn't have a distinct type but since the length is bytes and not elements this makes me believe that under the hood they are byte arrays - or, rather, managed chunks of memory. How's copying memory without a

Unwrap variadic template into vararg of pointers of the same types

2022-07-08 Thread ryuukk_ via Digitalmars-d-learn
I'm not sure how to phrase it so it'll try with code I have this piece of code that i would like to improve, right now i have to create bunch of duplicates ```D void view_it(A, B)(void function(entity_t, A*, B*) cb) { foreach(it, e; view!(Includes!(A, B))) {

Cannot copy void[] to void[] in @safe code?

2022-07-08 Thread wjoe via Digitalmars-d-learn
Why is that ? My understanding is that a void[] doesn't have a distinct type but since the length is bytes and not elements this makes me believe that under the hood they are byte arrays - or, rather, managed chunks of memory. How's copying memory without a distinct type different from copying

Re: How to call a function from a dll created with d ?

2022-07-08 Thread frame via Digitalmars-d-learn
On Thursday, 7 July 2022 at 17:29:42 UTC, cc wrote: Does importing dimedll into app.d properly NOT link in the functions that are exported to the DLL? When I tried something similar with dmd, I had to create a .di file containing just stubs, otherwise it looked like it was ignoring the DLL an

Re: Background thread, async and GUI (dlangui)

2022-07-08 Thread Bagomot via Digitalmars-d-learn
On Thursday, 7 July 2022 at 18:26:15 UTC, Ali Çehreli wrote: Summing up your help and GrimMaple, I understood how to make the file download progress bar beautifully. Thank you! I only have a question with how I can work with the GUI from other threads. For example, in my application I have a