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

2022-07-18 Thread frame via Digitalmars-d-learn
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.watch); } ``` This error comes from somewhere else in

Re: null == "" is true?

2022-07-18 Thread Antonio via Digitalmars-d-learn
On Monday, 18 July 2022 at 17:20:04 UTC, Kagamin wrote: ... If you want such difference, use the Nullable wrapper or Algebraic. I do :-) In fact, I use algebraic types supporting Null and Undefined for DTOs representation (and REST APIs). But I discovered some "rare" side effects in librari

Re: null == "" is true?

2022-07-18 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Monday, 18 July 2022 at 17:20:04 UTC, Kagamin wrote: Difference between null and empty is useless. Not really. `null` typically means that the value is missing, irrelevant and not usable, which is quite different from having "" as a usable value.

Re: null == "" is true?

2022-07-18 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 12 July 2022 at 20:36:03 UTC, Antonio wrote: Honestly, it is difficult to understand for newcomers... there is a reason, but there is a reason in javascript for `0 == ''` too People would have different preferences there. Difference between null and empty is useless. D does the ri

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

2022-07-18 Thread Bagomot via Digitalmars-d-learn
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.watch); } ```