Re: std.signals: Error: static assert: "Aliases to mutable thread-local data not allowed."

2022-07-21 Thread Bagomot via Digitalmars-d-learn
On Tuesday, 19 July 2022 at 05:24:55 UTC, frame wrote: On Monday, 18 July 2022 at 10:22:16 UTC, Bagomot wrote: Why can't I do it with `std.signals`? How the to do it if I can't create static event listeners? ```d public void addEventListener(T : EventListener)(T listener) { connect(&listener

Re: Background thread, async and GUI (dlangui)

2022-07-21 Thread Bagomot via Digitalmars-d-learn
I had this question: how can I get the value from the `task`, like how I can get from the `spawnLinked`(`ownerTid.send` and `receive`)? I'm using a `taskPool` through `arr.parallel`, but it became necessary to collect the progress from all tasks into one variable. In this case, I can't use

Re: Working with arrays (flatten, transpose, verfify rectangular)

2022-07-21 Thread anonymouse via Digitalmars-d-learn
On Wednesday, 20 July 2022 at 20:47:28 UTC, ag0aep6g wrote: (Aside: You don't need that many backticks to mark code fragments.) Thought I was following the instructions but it looks like I got a bit carried away. lol. You've got a bug there. This should pass, but fails with your version:

Re: Background thread, async and GUI (dlangui)

2022-07-21 Thread frame via Digitalmars-d-learn
On Thursday, 21 July 2022 at 13:27:49 UTC, Bagomot wrote: I had this question: how can I get the value from the `task`, like how I can get from the `spawnLinked`(`ownerTid.send` and `receive`)? I'm using a `taskPool` through `arr.parallel`, but it became necessary to collect the progress from

Re: Background thread, async and GUI (dlangui)

2022-07-21 Thread Bagomot via Digitalmars-d-learn
On Thursday, 21 July 2022 at 17:26:07 UTC, frame wrote: The module creators want you to prevent from non-threadsafe actions. Merging into one variable can be such a non-threadsafe action, but it has not to be. For example, if you have an array of fixed length or an already allocated one and e

Re: Working with arrays (flatten, transpose, verfify rectangular)

2022-07-21 Thread anonymouse via Digitalmars-d-learn
On Wednesday, 20 July 2022 at 16:15:33 UTC, Salih Dincer wrote: On Wednesday, 20 July 2022 at 09:18:29 UTC, anonymouse wrote: Given an array of arbitrary dimensions, I would like to accomplish three things: 1) verify that it is rectangular (e.g. all elements have the same length, al

Re: Working with arrays (flatten, transpose, verfify rectangular)

2022-07-21 Thread anonymouse via Digitalmars-d-learn
On Wednesday, 20 July 2022 at 09:18:29 UTC, anonymouse wrote: As for task 3, while I understand the concept of transposing a matrix, I'm not sure how to even begin. By not knowing how to begin, I mean that I don't know how to generalize the algorithm so that it applies to an array of arbi