Re: Conditional compilation of array of structs initializer

2017-11-09 Thread Tony via Digitalmars-d-learn
Thanks Mike!

Re: Distinct "static" parent property contents for children

2017-11-09 Thread Timoses via Digitalmars-d-learn
On Thursday, 9 November 2017 at 14:34:10 UTC, Steven Schveighoffer wrote: On 11/9/17 7:34 AM, Timoses wrote: I suppose this is what Adam suggested, correct? Yes, more or less. It's just an actual implementation vs. a description in case it wasn't clear. [...] It's not much different

Re: Conditional compilation of array of structs initializer

2017-11-09 Thread Michael V. Franklin via Digitalmars-d-learn
On Friday, 10 November 2017 at 06:22:51 UTC, Tony wrote: Doing a port of some C code that has an #ifdef in the middle of an initialization for an array of structs. I am getting a compile error trying to get equivalent behavior with "static if" or "version". Is there a way to achieve this other

Conditional compilation of array of structs initializer

2017-11-09 Thread Tony via Digitalmars-d-learn
Doing a port of some C code that has an #ifdef in the middle of an initialization for an array of structs. I am getting a compile error trying to get equivalent behavior with "static if" or "version". Is there a way to achieve this other than making two separate array initialization sections?

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread rikki cattermole via Digitalmars-d-learn
On 09/11/2017 4:00 PM, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 13:00:15 UTC, ParticlePeter wrote: On Thursday, 9 November 2017 at 12:19:00 UTC, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote: Any experience reports or

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-11-09 17:52, Petar Kirov [ZombineDev] wrote: Thanks for reminding me, I keep forgetting that it should just work (minus initialization?). What do you mean "initialization"? Any type that can be used in C in TLS should work in D as well (except for macOS 32bit, if anyone cares). --

Re: Any book recommendation for writing a compiler?

2017-11-09 Thread Jim Hewes via Digitalmars-d-learn
Thanks for those references! I'm also interested in looking through those. I had computation theory in college a long time ago but never took a compiler course. On 11/7/2017 5:26 AM, Tony wrote: Author Allen Holub has made his out-of-print book, Compiler Design in C, available as a free

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread Petar via Digitalmars-d-learn
On Thursday, 9 November 2017 at 16:08:20 UTC, Jacob Carlborg wrote: On 2017-11-09 13:19, Petar Kirov [ZombineDev] wrote: Though you need to be extra careful not to use thread-local storage I think TLS should work, it's the OS that handles TLS, not druntime. Thanks for reminding me, I keep

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-11-09 13:19, Petar Kirov [ZombineDev] wrote: Though you need to be extra careful not to use thread-local storage I think TLS should work, it's the OS that handles TLS, not druntime. -- /Jacob Carlborg

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread Petar via Digitalmars-d-learn
On Thursday, 9 November 2017 at 13:00:15 UTC, ParticlePeter wrote: On Thursday, 9 November 2017 at 12:19:00 UTC, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote: Any experience reports or general suggestions? I've used only D threads so far.

Re: Distinct "static" parent property contents for children

2017-11-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/9/17 7:34 AM, Timoses wrote: I suppose this is what Adam suggested, correct? Yes, more or less. It's just an actual implementation vs. a description in case it wasn't clear. This is a more general question: Why is it not possible to implement/override static methods? Static

Re: ddox empty public methods/interfaces etc

2017-11-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/8/17 10:45 PM, Andrey wrote: I just added to dub.json this: "-ddoxFilterArgs": [     "--min-protection=Public" ] i.e. without --only-documented option, in this way ddox will generate documentation for all public methods, even if there is no docstring. Interesting. I misunderstood

Re: Cannot reduce an empty iterable w/o an explicit seed value

2017-11-09 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 9 November 2017 at 12:40:49 UTC, Vino wrote: Hi All, Request your help, when i execute the below line of code i am getting an error message as "Cannot reduce an empty iterable w/o an explicit seed value" , The below lie of code will iterate several file system and will report

Re: Cannot reduce an empty iterable w/o an explicit seed value

2017-11-09 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 9 November 2017 at 12:40:49 UTC, Vino wrote: Hi All, Request your help, when i execute the below line of code i am getting an error message as "Cannot reduce an empty iterable w/o an explicit seed value" , The below lie of code will iterate several file system and will report

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread ParticlePeter via Digitalmars-d-learn
On Thursday, 9 November 2017 at 12:19:00 UTC, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote: Any experience reports or general suggestions? I've used only D threads so far. It would be far easier if you use druntime + @nogc and/or

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread ParticlePeter via Digitalmars-d-learn
On Thursday, 9 November 2017 at 12:43:54 UTC, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 12:30:49 UTC, rikki cattermole wrote: On 09/11/2017 12:19 PM, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote: Any experience reports

Cannot reduce an empty iterable w/o an explicit seed value

2017-11-09 Thread Vino via Digitalmars-d-learn
Hi All, Request your help, when i execute the below line of code i am getting an error message as "Cannot reduce an empty iterable w/o an explicit seed value" , The below lie of code will iterate several file system and will report the size of the folder (level 1) which is greater than

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread Petar via Digitalmars-d-learn
On Thursday, 9 November 2017 at 12:30:49 UTC, rikki cattermole wrote: On 09/11/2017 12:19 PM, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote: Any experience reports or general suggestions? I've used only D threads so far. It would be far

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread rikki cattermole via Digitalmars-d-learn
On 09/11/2017 12:19 PM, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote: Any experience reports or general suggestions? I've used only D threads so far. It would be far easier if you use druntime + @nogc and/or de-register latency-sensitive

Re: Distinct "static" parent property contents for children

2017-11-09 Thread Timoses via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 18:33:15 UTC, Steven Schveighoffer wrote: On 11/8/17 12:38 PM, Timoses wrote: Hey, wrapping my head around this atm.. [snip] so what you want is a static variable per subclass, but that the base class can access. What I would recommend is this: abstract

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread Petar via Digitalmars-d-learn
On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote: Any experience reports or general suggestions? I've used only D threads so far. It would be far easier if you use druntime + @nogc and/or de-register latency-sensitive threads from druntime [1], so they're not interrupted

How you guys go about -BetterC Multithreading?

2017-11-09 Thread ParticlePeter via Digitalmars-d-learn
Any experience reports or general suggestions? I've used only D threads so far.

Re: Distinct "static" parent property contents for children

2017-11-09 Thread Timoses via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 17:46:42 UTC, Adam D. Ruppe wrote: On Wednesday, 8 November 2017 at 17:38:27 UTC, Timoses wrote: Are there better options/ways of achieving this? What are you actually trying to achieve? What are you using these variables for? Well, I have the following