Re: why cannot spawn function defined in unittest block {}?

2020-06-20 Thread mw via Digitalmars-d-learn
On Saturday, 20 June 2020 at 18:08:06 UTC, mw wrote: On Saturday, 20 June 2020 at 18:01:51 UTC, Adam D. Ruppe wrote: On Saturday, 20 June 2020 at 17:43:42 UTC, mw wrote: the function defined in unittest become a delegate? how to work-around this? just add the keyword static to the functions

Re: why cannot spawn function defined in unittest block {}?

2020-06-20 Thread mw via Digitalmars-d-learn
On Saturday, 20 June 2020 at 18:01:51 UTC, Adam D. Ruppe wrote: On Saturday, 20 June 2020 at 17:43:42 UTC, mw wrote: the function defined in unittest become a delegate? how to work-around this? just add the keyword static to the functions

Re: why cannot spawn function defined in unittest block {}?

2020-06-20 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 20 June 2020 at 17:43:42 UTC, mw wrote: the function defined in unittest become a delegate? how to work-around this? just add the keyword static to the functions

why cannot spawn function defined in unittest block {}?

2020-06-20 Thread mw via Digitalmars-d-learn
put the code from: https://tour.dlang.org/tour/en/multithreading/synchronization-sharing in file, and put unittest block from safePrint() to main() as here: https://github.com/mingwugmail/dlang_tour/blob/master/spawn_in_unittest.d#L33 - $ dmd -unittest spawn_in_unittest.d

Re: why cannot spawn function defined in unittest block {}?

2020-06-20 Thread mw via Digitalmars-d-learn
the function defined in unittest become a delegate? how to work-around this?