Re: Why D isn't the next "big thing" already

2016-07-31 Thread Gorge Jingale via Digitalmars-d-learn
On Sunday, 31 July 2016 at 10:11:46 UTC, LaTeigne wrote: On Saturday, 30 July 2016 at 12:24:55 UTC, ketmar wrote: On Saturday, 30 July 2016 at 12:18:08 UTC, LaTeigne wrote: it you think that you know the things better than somebody who actually *lived* there in those times... well, keep thinki

Template Inheritance

2016-07-30 Thread Gorge Jingale via Digitalmars-d-learn
I like to build structures using template mixins because one can pick and choose functionality at compile time, but still have a relationship between different types. It would be really nice if one could sort of test if a template mixin was "mixed" in(or ideally, struct S : SomeTemplate (temp

Re: Why D isn't the next "big thing" already

2016-07-28 Thread Gorge Jingale via Digitalmars-d-learn
On Wednesday, 27 July 2016 at 10:41:54 UTC, ketmar wrote: On Wednesday, 27 July 2016 at 10:39:52 UTC, NX wrote: Lack of production quality tools like? no, "refactoring" and other crap is not "production quality tools", they are only useful to pretend that you are doing something useful, so y

Re: Remove stuff from a template mixin

2016-07-26 Thread Gorge Jingale via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 22:23:37 UTC, Jerry wrote: On Tuesday, 26 July 2016 at 19:02:32 UTC, Gorge Jingale wrote: I might want to actually use Add internally in B so I can add some elements behind the scenes, I do not want to expose it to the outside world though. There are no way to remo

Re: Why D isn't the next "big thing" already

2016-07-26 Thread Gorge Jingale via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 15:11:00 UTC, llaine wrote: Hi guys, I'm using D since a few month now and I was wondering why people don't jump onto it that much and why it isn't the "big thing" already. Everybody is into javascript nowadays, but IMO even for doing web I found Vibe.d more inte

Re: Check of point inside/outside polygon

2016-07-26 Thread Gorge Jingale via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 19:08:09 UTC, H. S. Teoh wrote: On Tue, Jul 26, 2016 at 06:39:58PM +, Gorge Jingale via Digitalmars-d-learn wrote: On Tuesday, 26 July 2016 at 17:38:43 UTC, Suliman wrote: > I have arbitrary polygon. I need any solution. Performance > is does not mat

Re: Remove stuff from a template mixin

2016-07-26 Thread Gorge Jingale via Digitalmars-d-learn
I might want to actually use Add internally in B so I can add some elements behind the scenes, I do not want to expose it to the outside world though.

Remove stuff from a template mixin

2016-07-26 Thread Gorge Jingale via Digitalmars-d-learn
Is there a way to remove functions and fields that a mixin template adds? I use mixin templates to create other types contents, like struct A { mixin Stuff(); } But Sometimes I only want some of the stuff. struct B { mixin Stuff(); @disable Add(); } B is like an A but doesn't have the abilit

Re: Check of point inside/outside polygon

2016-07-26 Thread Gorge Jingale via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 17:38:43 UTC, Suliman wrote: I have arbitrary polygon. I need any solution. Performance is does not matter at current moment. A polygon is made up of lines. For a point to be inside a convex polygon, it must be to the "right" of all the lines with clockwise orienta

Re: Static ternary if

2016-07-25 Thread Gorge Jingale via Digitalmars-d-learn
On Monday, 25 July 2016 at 22:27:11 UTC, Cauterite wrote: On Monday, 25 July 2016 at 02:15:12 UTC, Gorge Jingale wrote: Is there a static ternary if? (A == B) ? C : D; for compile type that works like static if. You can pretty easily make your own; template staticIf(bool cond, alias a, al

debug public release private

2016-07-24 Thread Gorge Jingale via Digitalmars-d-learn
debug mixin("public"); else mixin("private"); Doesn't work. It's nice to have public members when debugging because they show up in the debugger and one can access internals for checking. One can enable per line using debug but it requires lots of duplicate code. Is there any easy way to d

Re: Randomized unittests

2016-07-24 Thread Gorge Jingale via Digitalmars-d-learn
On Monday, 25 July 2016 at 02:36:04 UTC, Chris Wright wrote: On Mon, 25 Jul 2016 01:49:25 +, Gorge Jingale wrote: [...] http://code.dlang.org/packages/unit-threaded @Values() annotation on a unittest takes a range. Base that on a range that yields random values and Bob's your uncle. T

Static ternary if

2016-07-24 Thread Gorge Jingale via Digitalmars-d-learn
Is there a static ternary if? (A == B) ? C : D; for compile type that works like static if.

Randomized unittests

2016-07-24 Thread Gorge Jingale via Digitalmars-d-learn
Is there any leverage in the D library for doing randomized unit testing? Testing things with a range of possibilities instead of fixed. Each time the test is ran a different version is executed. This provides more coverage. How does one create a random number at compile time? Is this the onl

Confused about referencing in D

2016-07-13 Thread Gorge Jingale via Digitalmars-d-learn
I'm pretty confused why the following code doesn't work as expected. GetValue is a struct. auto value = GetValue(); memcpy(&value, &val, Val.sizeof); But if I plug in value direct to memset it works!! memcpy(&GetValue(), &val, Val.sizeof); GetValue returns memory to stick a value in an