Re: Getting template parameters by its name

2019-01-10 Thread Paul Backus via Digitalmars-d-learn
On Friday, 11 January 2019 at 04:59:50 UTC, Yui Hosaka wrote: I want to do something like this: template S(T) { } void main() { pragma(msg, S!(int).T); // Error: no property `T` for type `void` } You can get the arguments of a template instance as an AliasSeq using

Re: Building Libraries in the face of API and ABI changes [was Understanding SIGSEGV issues]

2019-01-10 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2019-01-10 at 13:09 -0500, Steven Schveighoffer via Digitalmars-d- learn wrote: > […] > That is one problem with linking against C or C++ code -- changes to > certain things (e.g. struct layout) don't change the mangling. I am having nightmares trying to decide what to do with the Rust

Getting template parameters by its name

2019-01-10 Thread Yui Hosaka via Digitalmars-d-learn
I want to do something like this: template S(T) { } void main() { pragma(msg, S!(int).T); // Error: no property `T` for type `void` } Using alias, it is possible to get T by another name: template S(T) { alias t = T; } void main() { pragma(msg, S!(int).t); } But

Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/10/19 5:12 PM, RazvanN wrote: On Thursday, 10 January 2019 at 15:04:25 UTC, Steven Schveighoffer wrote: On 1/8/19 7:54 AM, RazvanN wrote: [...] That is a thread-local static destructor. Are any shared static destructors accessing the array? No, there aren't. Indeed, the problem is as

Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-10 Thread RazvanN via Digitalmars-d-learn
On Thursday, 10 January 2019 at 15:04:25 UTC, Steven Schveighoffer wrote: On 1/8/19 7:54 AM, RazvanN wrote: [...] That is a thread-local static destructor. Are any shared static destructors accessing the array? No, there aren't. Indeed, the problem is as Johan as said: the loadedDSOs

Re: Trouble with receiveOnly and immutable(JSONValue)

2019-01-10 Thread rx via Digitalmars-d-learn
On Thursday, 10 January 2019 at 20:21:04 UTC, Steven Schveighoffer wrote: Thanks Steve. I suppose when the documentation talks about preferring message passing immutable data it means just use plain old receive. I can just use a template I anyway. Would you estimate this Phobos bug to be

Re: Trouble with receiveOnly and immutable(JSONValue)

2019-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/10/19 2:36 PM, rx wrote: On Thursday, 10 January 2019 at 18:25:44 UTC, Steven Schveighoffer wrote: On 1/10/19 1:20 PM, Steven Schveighoffer wrote: I don't know if there's a specific "can't receive immutable data" issue report, but certainly, you can add your issue to the list.

Re: Trouble with receiveOnly and immutable(JSONValue)

2019-01-10 Thread rx via Digitalmars-d-learn
On Thursday, 10 January 2019 at 18:25:44 UTC, Steven Schveighoffer wrote: On 1/10/19 1:20 PM, Steven Schveighoffer wrote: I don't know if there's a specific "can't receive immutable data" issue report, but certainly, you can add your issue to the list. Actually, this one is nearly identical

Re: Understanding SIGSEGV issues

2019-01-10 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 10, 2019 at 01:09:22PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: > On 1/10/19 12:30 PM, Russel Winder wrote: > > On Thu, 2019-01-10 at 10:00 -0500, Steven Schveighoffer via Digitalmars-d- > > learn wrote: > > […] > > > Hm... your description of having the problem

Re: Trouble with receiveOnly and immutable(JSONValue)

2019-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/10/19 1:20 PM, Steven Schveighoffer wrote: I don't know if there's a specific "can't receive immutable data" issue report, but certainly, you can add your issue to the list. Actually, this one is nearly identical and quite new, you can just add to that one:

Re: Trouble with receiveOnly and immutable(JSONValue)

2019-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/10/19 12:15 PM, rx wrote: alias SyncData = immutable(JSONValue); void worker(string filename) {   SyncData data = filename.readText.parseJSON;   send(ownerTid, data); } void main(string[] args) {   spawn(, args[1]);   writeln(receiveOnly!SyncData); } I'm trying to send this

Re: Understanding SIGSEGV issues

2019-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/10/19 12:30 PM, Russel Winder wrote: On Thu, 2019-01-10 at 10:00 -0500, Steven Schveighoffer via Digitalmars-d- learn wrote: […] Hm... your description of having the problem happen at the end of main seems to suggest it has something to do with destruction. It seems that there was a

Re: Understanding SIGSEGV issues

2019-01-10 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2019-01-10 at 10:00 -0500, Steven Schveighoffer via Digitalmars-d- learn wrote: […] > > Hm... your description of having the problem happen at the end of main > seems to suggest it has something to do with destruction. > It seems that there was a change in one file of libdvbv5 1.14.x →

Trouble with receiveOnly and immutable(JSONValue)

2019-01-10 Thread rx via Digitalmars-d-learn
alias SyncData = immutable(JSONValue); void worker(string filename) { SyncData data = filename.readText.parseJSON; send(ownerTid, data); } void main(string[] args) { spawn(, args[1]); writeln(receiveOnly!SyncData); } I'm trying to send this immutable(JSONValue) back to the main thread

Re: Understanding SIGSEGV issues

2019-01-10 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2019-01-10 at 07:36 +, Nicholas Wilson via Digitalmars-d-learn wrote: […] > Hmm, if you think the binding could be the problem you could try > using app as an alternative, see if it makes any difference. I did a proper update of the generated files of the binding, and magically

Re: Generating API documention

2019-01-10 Thread George via Digitalmars-d-learn
On Thursday, 10 January 2019 at 10:33:00 UTC, Seb wrote: On Thursday, 10 January 2019 at 07:04:52 UTC, George wrote: [...] This was actually done with Ddoc (author of the ddoc setup for Mir here) ;-) See: https://github.com/libmir/mir/tree/master/doc It uses the dlang.org Ddoc theme and

Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/8/19 7:54 AM, RazvanN wrote: Hi all, I am working on issue 14650 [1] and I would like to implement a solution where static destructors are destroying global variables. However, I have the following problem in druntime/src/rt/sections_elf_shared: struct ThreadDSO {     DSO* _pdso;    

Re: Understanding SIGSEGV issues

2019-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/9/19 11:39 AM, Russel Winder wrote: On Tue, 2019-01-08 at 09:59 -0500, Steven Schveighoffer via Digitalmars-d- learn wrote: […] Russel, make sure your destructor both checks whether the underlying resource is set, and clears it to invalid when freeing it. Even types that can't be

Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-10 Thread RazvanN via Digitalmars-d-learn
On Tuesday, 8 January 2019 at 14:30:24 UTC, Johan Engelen wrote: On Tuesday, 8 January 2019 at 12:54:11 UTC, RazvanN wrote: [...] Great! (I am _extremely_ surprised that dtors are not called for globals.) [...] Thanks! This is really helpful! RazvanN

Re: Libraries, versions, API changes, and Dub

2019-01-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-01-10 06:44, Russel Winder wrote: It appears that libdvbv5 has undergone an (unnoticed by me till just now) version change. This raises a general question for creators of D bindings. libdvbv5 has versions 1.12.x, 1.14.x, 1.16.x, etc, following the "odd is internal, even is released"

Re: Generating API documention

2019-01-10 Thread Seb via Digitalmars-d-learn
On Thursday, 10 January 2019 at 07:04:52 UTC, George wrote: What do people use to generate nice looking and simple html documentation for their projects? I would be glad (and if possible), someone could share some actual instructions rather than just tell me ddoc. For example I have seen the

Re: Libraries, versions, API changes, and Dub

2019-01-10 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 10 January 2019 at 10:28:55 UTC, Mike Parker wrote: to set up compile-time versions Compile-time *values* else enum dvbvSupport = DVBVSupport.v114; This, of course, should be = DVBVSupport.v112

Re: Libraries, versions, API changes, and Dub

2019-01-10 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 10 January 2019 at 05:44:22 UTC, Russel Winder wrote: It appears that libdvbv5 has undergone an (unnoticed by me till just now) version change. This raises a general question for creators of D bindings. libdvbv5 has versions 1.12.x, 1.14.x, 1.16.x, etc, following the "odd is

Re: Generating API documention

2019-01-10 Thread Anonymouse via Digitalmars-d-learn
On Thursday, 10 January 2019 at 08:50:27 UTC, Anonymouse wrote: Then just dub build -ddox Naturally dub build -b ddox.

Re: Generating API documention

2019-01-10 Thread Anonymouse via Digitalmars-d-learn
On Thursday, 10 January 2019 at 07:04:52 UTC, George wrote: What do people use to generate nice looking and simple html documentation for their projects? I would be glad (and if possible), someone could share some actual instructions rather than just tell me ddoc. For example I have seen the