Re: Shared with synchronized

2019-03-03 Thread r-const-dev via Digitalmars-d-learn
On Sunday, 3 March 2019 at 22:35:54 UTC, r-const-dev wrote: I'm trying to implement a thread safe class, guarding data access with synchronized and atomicOp. Inside the class I'm using non-shared fields, such as Nullable, but I guarantee the thread safety using synchronized. How can I tell

Shared with synchronized

2019-03-03 Thread r-const-dev via Digitalmars-d-learn
I'm trying to implement a thread safe class, guarding data access with synchronized and atomicOp. Inside the class I'm using non-shared fields, such as Nullable, but I guarantee the thread safety using synchronized. How can I tell the compiler to allow using non-shared fields/methods inside

Re: Setting immutable static data inside a struct in a module constructor?

2019-03-03 Thread aliak via Digitalmars-d-learn
On Sunday, 3 March 2019 at 20:41:36 UTC, Alex wrote: On Sunday, 3 March 2019 at 20:10:14 UTC, aliak wrote: Is it possible to initialize static immutable members of a struct like you could do for a global immutable one? immutable string a; struct Test { static immutable string b; } shared

Re: Setting immutable static data inside a struct in a module constructor?

2019-03-03 Thread Alex via Digitalmars-d-learn
On Sunday, 3 March 2019 at 20:10:14 UTC, aliak wrote: Is it possible to initialize static immutable members of a struct like you could do for a global immutable one? immutable string a; struct Test { static immutable string b; } shared static this() { a = "foo"; Test.b = "bar"; }

Setting immutable static data inside a struct in a module constructor?

2019-03-03 Thread aliak via Digitalmars-d-learn
Is it possible to initialize static immutable members of a struct like you could do for a global immutable one? immutable string a; struct Test { static immutable string b; } shared static this() { a = "foo"; Test.b = "bar"; } Error: cannot modify immutable expression b

Re: Help with Regular Expressions (std.regex)

2019-03-03 Thread user1234 via Digitalmars-d-learn
On Sunday, 3 March 2019 at 18:32:14 UTC, user1234 wrote: On Sunday, 3 March 2019 at 18:07:57 UTC, Samir wrote: or // sorry i don't have the regex API in mind import std.array: array; import std.alogrithm.iteration : map; auto allMatches = matchAll(line, pattern).map(a => a.hit).array;

static if, compiler bug?

2019-03-03 Thread Andre Pany via Digitalmars-d-learn
Hi, in druntime https://github.com/dlang/druntime/blob/master/src/core/sys/posix/sys/types.d#L113 there is following definiton: else version (CRuntime_Musl) { alias long blksize_t; alias ulong nlink_t; alias long dev_t; alias long blkcnt_t; alias ulong

Re: Help with Regular Expressions (std.regex)

2019-03-03 Thread user1234 via Digitalmars-d-learn
On Sunday, 3 March 2019 at 18:07:57 UTC, Samir wrote: I am belatedly working my way through the 2018 edition of the Advent of Code[1] programming challenges using D and am stumped on Problem 3[2]. The challenge requires you to parse a set of lines in the format: #99 @ 652,39: 24x23 #100 @

Help with Regular Expressions (std.regex)

2019-03-03 Thread Samir via Digitalmars-d-learn
I am belatedly working my way through the 2018 edition of the Advent of Code[1] programming challenges using D and am stumped on Problem 3[2]. The challenge requires you to parse a set of lines in the format: #99 @ 652,39: 24x23 #100 @ 61,13: 15x24 #101 @ 31,646: 16x28 I would like to store

Re: Concatenating compile time sequences

2019-03-03 Thread aliak via Digitalmars-d-learn
On Saturday, 2 March 2019 at 02:38:09 UTC, H. S. Teoh wrote: On Sat, Mar 02, 2019 at 02:16:22AM +, Victor Porton via Digitalmars-d-learn wrote: [...] Keep in mind that sequences produced by AliasSeq are auto-expanding, meaning the above construct will automatically flatten into a flat

Re: How can I build dynamic library with ldc in termux?

2019-03-03 Thread Domain via Digitalmars-d-learn
On Sunday, 3 March 2019 at 01:51:49 UTC, Domain wrote: [...] Sorry, my mistake. I can build dynamic library now.

Re: How can I build dynamic library with ldc in termux?

2019-03-03 Thread Domain via Digitalmars-d-learn
On Sunday, 3 March 2019 at 12:25:28 UTC, kinke wrote: On Sunday, 3 March 2019 at 01:47:50 UTC, Domain wrote: /data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: cannot find -lphobos2-ldc-shared /data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: cannot find

Re: How can I build dynamic library with ldc in termux?

2019-03-03 Thread kinke via Digitalmars-d-learn
On Sunday, 3 March 2019 at 01:47:50 UTC, Domain wrote: /data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: cannot find -lphobos2-ldc-shared /data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: cannot find -ldruntime-ldc-shared Looks like that package isn't set-up 100%

Re: How can I build dynamic library with ldc in termux?

2019-03-03 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 3 March 2019 at 01:51:49 UTC, Domain wrote: On Sunday, 3 March 2019 at 01:47:50 UTC, Domain wrote: /data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: cannot find -lphobos2-ldc-shared /data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: cannot find