Re: Iterating chars by Word

2020-11-12 Thread evilrat via Digitalmars-d-learn
On Friday, 13 November 2020 at 05:14:08 UTC, Виталий Фадеев wrote: Is: wchar[] chars; // like a: "import core.sys.windows.windows;\nimport std.conv : to;\n" Goal: foreach ( word; chars.byWord ) { // ... } You can make your own range, however look at this function first (second

Re: Iterating chars by Word

2020-11-12 Thread Ali Çehreli via Digitalmars-d-learn
On 11/12/20 9:14 PM, Виталий Фадеев wrote: Is: wchar[] chars;  // like a: "import core.sys.windows.windows;\nimport std.conv  : to;\n" Goal: foreach ( word; chars.byWord ) {     // ... } Iterating chars by Word... How to ? ( simple, fast, low memory, beauty, perfect ) import

Re: Iterating chars by Word

2020-11-12 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 13 November 2020 at 06:42:24 UTC, evilrat wrote: On Friday, 13 November 2020 at 05:14:08 UTC, Виталий Фадеев wrote: [...] You can make your own range, however look at this function first (second example) https://dlang.org/phobos/std_algorithm_iteration.html#.splitter // 1)

Windows DLL Exception catching status?

2020-11-12 Thread frame via Digitalmars-d-learn
Is there still no way to catch an exception thrown from own DLL in main runtime?

Iterating chars by Word

2020-11-12 Thread Виталий Фадеев via Digitalmars-d-learn
Is: wchar[] chars; // like a: "import core.sys.windows.windows;\nimport std.conv : to;\n" Goal: foreach ( word; chars.byWord ) { // ... } Iterating chars by Word... How to ? ( simple, fast, low memory, beauty, perfect )

Re: Iterating chars by Word

2020-11-12 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 13 November 2020 at 07:23:13 UTC, Виталий Фадеев wrote: On Friday, 13 November 2020 at 06:52:38 UTC, Виталий Фадеев wrote: On Friday, 13 November 2020 at 06:42:24 UTC, evilrat wrote: [...] Thanks, Ali. Thanks, Evilrat. I taste it now: https://run.dlang.io/is/HlSFVY Latest:

Re: Iterating chars by Word

2020-11-12 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 13 November 2020 at 06:52:38 UTC, Виталий Фадеев wrote: On Friday, 13 November 2020 at 06:42:24 UTC, evilrat wrote: [...] Thanks, Ali. Thanks, Evilrat. I taste it now: https://run.dlang.io/is/HlSFVY Latest: https://run.dlang.io/is/dfrcYj

Re: C++ or D?

2020-11-12 Thread hgriffin via Digitalmars-d-learn
C++ is a really overloaded with features language. The burden of backward compatibility and source compatibility with C doesn't make it any better. But right now it's the only right choice for development. There are plenty of libraries for many common tasks, a big community and the most

Missing stacktrace on memory allocation failure

2020-11-12 Thread Per Nordlöw via Digitalmars-d-learn
Why don't I get a stack trace on Memory allocation exceptions? In my case I only get: src/core/exception.d(647): [unittest] Memory allocation failed core.exception.OutOfMemoryError@src/core/exception.d(647): Memory allocation failed

Re: DMD: invalid UTF character `\U0000d800`

2020-11-12 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 9 November 2020 at 16:39:49 UTC, Boris Carvajal wrote: There's also: dchar(0xd8000) Thanks

Re: Missing stacktrace on memory allocation failure

2020-11-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/12/20 4:22 AM, Per Nordlöw wrote: Why don't I get a stack trace on Memory allocation exceptions? In my case I only get: src/core/exception.d(647): [unittest] Memory allocation failed core.exception.OutOfMemoryError@src/core/exception.d(647): Memory allocation failed Certain errors

Task when used on a function that takes parameters doesnt work.

2020-11-12 Thread Ruby The Roobster via Digitalmars-d-learn
Here is a test that I did: void func(int i) { Thread.sleep(i.seconds); } void main() { auto test = Task!func(3); test.executeInNewThread(); test.yeildForce(); } This gives the following errors(I'm using Code::Blocks as an IDE by the way, so this is what the IDE outputted):

Re: Missing stacktrace on memory allocation failure

2020-11-12 Thread Per Nordlöw via Digitalmars-d-learn
On Thursday, 12 November 2020 at 09:22:10 UTC, Per Nordlöw wrote: Why don't I get a stack trace on Memory allocation exceptions? Is it because the stack may be corrupted?

Re: Task when used on a function that takes parameters doesnt work.

2020-11-12 Thread Daniel Kozak via Digitalmars-d-learn
On Thu, Nov 12, 2020 at 4:05 PM Ruby The Roobster via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > Here is a test that I did: > > void func(int i) > { > Thread.sleep(i.seconds); > } > void main() { > auto test = Task!func(3); > test.executeInNewThread(); > test.yeildForce();

Re: Task when used on a function that takes parameters doesnt work.

2020-11-12 Thread Ruby The Roobster via Digitalmars-d-learn
On Thursday, 12 November 2020 at 15:12:55 UTC, Daniel Kozak wrote: [...] Thanks.

Re: Task when used on a function that takes parameters doesnt work.

2020-11-12 Thread Daniel Kozak via Digitalmars-d-learn
On Thu, Nov 12, 2020 at 4:12 PM Daniel Kozak wrote: > On Thu, Nov 12, 2020 at 4:05 PM Ruby The Roobster via Digitalmars-d-learn < > digitalmars-d-learn@puremagic.com> wrote: > >> Here is a test that I did: >> >> void func(int i) >> { >> Thread.sleep(i.seconds); >> } >> void main() { >> auto test