Help needed to extend the core.thread

2018-10-25 Thread Heromyth via Digitalmars-d-learn
I want make some extensions to Thread in core.thread and wan. So I copy the whole of core.thread to another module named myext.thread. Here are two errors occurred: 1)When building this module In function `_D4myext6thread6Thread9termLocksFNiZv': /home/dlang/UnitTest/source/myext/thread.d:1723:

Re: Built-in array opSliceAssign

2018-10-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 25 October 2018 at 19:56:18 UTC, Stanislav Blinov wrote: The current behavior of the compiler is quite the opposite of those "same as" above. Yeah, I guess I am maybe selectively reading the spec in light of the implementation... but I think the examples are just sloppy. Or

Re: Pegged: spaces

2018-10-25 Thread Michelle Long via Digitalmars-d-learn
Ignores spaces: <- Doesn't: < Concatenates results: <~

Re: Built-in array opSliceAssign

2018-10-25 Thread Stanislav Blinov via Digitalmars-d-learn
On Thursday, 25 October 2018 at 13:22:36 UTC, Eduard Staniloiu wrote: The spec doesn't exactly say it uses memset, but it does imply it: https://dlang.org/spec/arrays.html#array-copying talking about "aggressive parallel code optimizations than possible with the serial semantics of C" and

Pegged: spaces

2018-10-25 Thread Michelle Long via Digitalmars-d-learn
Is Pegged suppose to consume white spaces automatically? I have some text like "abvdfs dfddf" and I have made some rules to divide the two parts by a space. The sub-rules are complex but none of them contain a space(' ', they do contain spaces to separate the sub-rules). The parser though

Re: Built-in array opSliceAssign

2018-10-25 Thread Eduard Staniloiu via Digitalmars-d-learn
On Thursday, 25 October 2018 at 12:55:38 UTC, Adam D. Ruppe wrote: On Thursday, 25 October 2018 at 12:25:37 UTC, Eduard Staniloiu wrote: IMHO, this is a bug. The code should lower to calls to opAssing for types that define opAssign. The spec doesn't exactly say it uses memset, but it does

Re: Built-in array opSliceAssign

2018-10-25 Thread Eduard Staniloiu via Digitalmars-d-learn
On Thursday, 25 October 2018 at 13:01:06 UTC, Eduard Staniloiu wrote: On Thursday, 25 October 2018 at 12:38:44 UTC, Paul Backus wrote: On Thursday, 25 October 2018 at 12:25:37 UTC, Eduard Staniloiu wrote: As I wrote in the comments above, I was expecting `a[] = b[]` to iterate the slices and

Re: Built-in array opSliceAssign

2018-10-25 Thread Eduard Staniloiu via Digitalmars-d-learn
On Thursday, 25 October 2018 at 12:38:44 UTC, Paul Backus wrote: On Thursday, 25 October 2018 at 12:25:37 UTC, Eduard Staniloiu wrote: As I wrote in the comments above, I was expecting `a[] = b[]` to iterate the slices and assign the elements of b into a. What really happens is a memcpy: as

Re: Built-in array opSliceAssign

2018-10-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 25 October 2018 at 12:25:37 UTC, Eduard Staniloiu wrote: IMHO, this is a bug. The code should lower to calls to opAssing for types that define opAssign. The spec doesn't exactly say it uses memset, but it does imply it: https://dlang.org/spec/arrays.html#array-copying talking

Re: Built-in array opSliceAssign

2018-10-25 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 25 October 2018 at 12:25:37 UTC, Eduard Staniloiu wrote: As I wrote in the comments above, I was expecting `a[] = b[]` to iterate the slices and assign the elements of b into a. What really happens is a memcpy: as you can see from godblot [0], this gets lowered to a call to

Built-in array opSliceAssign

2018-10-25 Thread Eduard Staniloiu via Digitalmars-d-learn
Hello, everyone! I have a question regarding the expected behaviour of the built-in array's opSliceAssign. Given the following code: ``` import std.stdio; struct A { int x; ref A opAssign(A rhs) { writefln("slice_bug.opAssign: begin"); return this; } }