Re: 'version'-based code selection

2019-06-02 Thread Yatheendra via Digitalmars-d-learn
On Saturday, 1 June 2019 at 07:46:40 UTC, Jonathan M Davis wrote: Like static ifs, version statements are completely a compile-time construct and having nothing to do with runtime beyond how they affect the code that's generated. ... - Jonathan M Davis Thanks for taking the time. That's

'version'-based code selection

2019-05-31 Thread Yatheendra via Digitalmars-d-learn
Hi people. The 'version' keyword sounds like a fantastic capability, but how far does DMD take it (and does GDC take it equally far)? This is not a "D Improvement Proposal", I am just asking how it is now. Can code of multiple versions be compiled into the same executable or library, and

Re: OT (Was: Re: is(ElementType!(char[2]) == dchar - why?)

2019-06-14 Thread Yatheendra via Digitalmars-d-learn
Could this be rendered an aside for newbies, by way of documentation, specifically the Unicode portion of the Dlang tour? Just never bring up auto-decoding at all, point out UTF8/16/32 and point out the fast correct primitive (byCodeUnit) that lets you iterate over a string's contents

Re: Component based programming in D

2019-06-18 Thread Yatheendra via Digitalmars-d-learn
I guess design patterns are independent of implementation language. Anyway, I suspect OO is incidental in components. D probably can do it better than C++ at least. Do search for the video of a talk Walter Bright gave on component programming in D.

Re: Best practices of using const

2019-06-21 Thread Yatheendra via Digitalmars-d-learn
Am I mistaken in saying that we are conflating: "anything that is logically const should be declared const" // makes perfect sense // e.g. the lowest 2, and some branches of the 3rd and 4th, levels // of members (and a subset of the overall methods) in a 5-deep type hierarchy are

Re: Best practices of using const

2019-06-21 Thread Yatheendra via Digitalmars-d-learn
That is a comprehensive reply. No pointers to other material required :-) On Friday, 21 June 2019 at 16:35:50 UTC, H. S. Teoh wrote: On Fri, Jun 21, 2019 at 06:07:59AM +, Yatheendra via Digitalmars-d-learn wrote: Actually, optimizers work best when there is minimal mutation

Re: Best practices of using const

2019-06-21 Thread Yatheendra via Digitalmars-d-learn
It feels disingenous to want to call a caching object even "logically" const. There has to be a scaffolding-based but hopefully generic compromise. I haven't yet tested this belief, but I believe "physical" const is of good use wherever it can be applied. On Friday, 21 June 2019 at 23:39:20

Re: Best practices of using const

2019-06-22 Thread Yatheendra via Digitalmars-d-learn
On Saturday, 22 June 2019 at 05:10:14 UTC, Yatheendra wrote: It feels disingenous to want to call a caching object even "logically" const. There has to be a scaffolding-based but hopefully generic compromise. I haven't yet tested this belief, but I believe "physical" const is of good use

System requirements for compiling/linking big D codebases

2019-06-17 Thread Yatheendra via Digitalmars-d-learn
Hi, For the sake of people habituated to compiling compilers from source, is it possible to add to the dmd_linux page the 64-bit hardware resource requirements for compiling DMD/Phobos from source? Ideally, with the defaults and also with 2.086's -lowmem switch? Maybe an ever-green link, to