What is up with building DMD (et al.) on Windows?

2016-05-09 Thread Jeremy DeHaan via Digitalmars-d-learn
I went to build DMD on Windows for the first time tonight and I have to say that it was a terrible experience when compared with Linux. First issue I ran into was having HOST_DC not being set. I'm not sure if the DMD installer is supposed to do this or if I needed to take care of it, but it w

Re: ggplotd - curve colour

2016-05-09 Thread brocolis via Digitalmars-d-learn
On Monday, 9 May 2016 at 06:24:22 UTC, Edwin van Leeuwen wrote: On Monday, 9 May 2016 at 02:29:47 UTC, brocolis wrote: Is this correct usage? auto gg = GGPlotD().put( geomLine( Aes!(typeof(xs), "x", typeof(ysfit), "y", string, "colour")( xs, ysfit, "red") ) ); The output is a blank png file.

Re: Chaining opIndex

2016-05-09 Thread John Colvin via Digitalmars-d-learn
On Monday, 9 May 2016 at 20:14:25 UTC, deed wrote: struct Foo { Bars bars; ... } struct Foos { Foo[] arr; Foo opIndex (size_t idx) { return arr[idx]; } ... } struct Bar { // No Car[] cars; ... } struct Bars { Bar[] arr; Bar opIndex (size_t idx) { return arr[

Chaining opIndex

2016-05-09 Thread deed via Digitalmars-d-learn
struct Foo { Bars bars; ... } struct Foos { Foo[] arr; Foo opIndex (size_t idx) { return arr[idx]; } ... } struct Bar { // No Car[] cars; ... } struct Bars { Bar[] arr; Bar opIndex (size_t idx) { return arr[idx]; } ... } struct Car { ... } Foos foos

Re: Compiler silently ignores some method overloads

2016-05-09 Thread Peter Häggman via Digitalmars-d-learn
On Monday, 9 May 2016 at 11:22:37 UTC, pineapple wrote: On Monday, 9 May 2016 at 00:27:17 UTC, Peter Häggman wrote: Can you show your GLColor struct ? Maybe it contains an alias this or something else that mess the overload resolution. My GLColor struct: http://pastebin.com/mUcA6G85 No probl

foreach(i,ref val; ndim_arr)??

2016-05-09 Thread Jay Norwood via Digitalmars-d-learn
I noticed some discussion of Cartesian indexes in Julia, where the index is a tuple, along with some discussion of optimizing the index created for cache efficiency. I could find foreach(ref val, m.byElement()), but didn't find an example that returned a tuple index. Is that supported? htt

Re: Querying Function Template Restrictions

2016-05-09 Thread Meta via Digitalmars-d-learn
On Monday, 9 May 2016 at 11:57:11 UTC, Nordlöw wrote: In what ways can I compile-time introspect the template restrictions of a specific function overload set in D? In other words if I have, for instance, T f(T)(T x) if (isFloat!T) {} T f(T)(T x) if (isInteger!T) {} T g(T)(T x) if (isFloat!T

Re: parameter pack to inputRange

2016-05-09 Thread Alex Parrill via Digitalmars-d-learn
On Sunday, 8 May 2016 at 14:11:31 UTC, Ali Çehreli wrote: I like Alex Parrill's only() solution but it allocates a dynamic array as well by doing the equivalent of [args] in the guts of its implementation. No it does not. The constructor does `this.data = [values];`, but `this.data` is a fix

Re: parameter pack to inputRange

2016-05-09 Thread Dicebot via Digitalmars-d-learn
On Monday, 9 May 2016 at 12:36:00 UTC, Ali Çehreli wrote: On 05/09/2016 03:44 AM, Dicebot wrote: > Ali version generates a compile-time switch for index I think it's a run-time switch, generated by a compile-time foreach: E front() { final switch (index) {// <-- RUNTI

Re: parameter pack to inputRange

2016-05-09 Thread Ali Çehreli via Digitalmars-d-learn
On 05/09/2016 03:44 AM, Dicebot wrote: > Ali version generates a compile-time switch for index I think it's a run-time switch, generated by a compile-time foreach: E front() { final switch (index) {// <-- RUNTIME /* static */ foreach (i, arg; Args) { // <-- COMPI

Querying Function Template Restrictions

2016-05-09 Thread Nordlöw via Digitalmars-d-learn
In what ways can I compile-time introspect the template restrictions of a specific function overload set in D? In other words if I have, for instance, T f(T)(T x) if (isFloat!T) {} T f(T)(T x) if (isInteger!T) {} T g(T)(T x) if (isFloat!T && isInteger!T) {} can I somehow at compile-time query

Re: Compiler silently ignores some method overloads

2016-05-09 Thread pineapple via Digitalmars-d-learn
On Monday, 9 May 2016 at 00:27:17 UTC, Peter Häggman wrote: Can you show your GLColor struct ? Maybe it contains an alias this or something else that mess the overload resolution. My GLColor struct: http://pastebin.com/mUcA6G85

Re: parameter pack to inputRange

2016-05-09 Thread Dicebot via Digitalmars-d-learn
On Sunday, 8 May 2016 at 23:48:01 UTC, Erik Smith wrote: Thanks! The static array version works for me too. It would be good to understand more about what is going on. It looks like the cost of the static array is an extra copy for each element. Maybe there is still a way to avoid that. T

Re: Async or event library

2016-05-09 Thread chmike via Digitalmars-d-learn
It seam that the scope of the event loop we are talking should be clarified to avoid confusions. There is the GUI event loop which is generally single threaded for efficient access to the data structure representing the GUI content. Single thread also simplifies synchronization and make deadl