Re: ggplotd - curve colour

2016-05-08 Thread brocolis via Digitalmars-d-learn
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. Full source: import ggplotd.ggplotd; import ggplotd.geom; import ggplotd.aes; import ggplotd.axes; void main() {

Re: Compiler silently ignores some method overloads

2016-05-08 Thread Peter Häggman via Digitalmars-d-learn
On Sunday, 8 May 2016 at 13:28:47 UTC, pineapple wrote: [...] I get a compiler error like so: E:\Dropbox\Projects\d\mach\sdl\surface.d(434): Error: none of the overloads of 'opIndexAssign' are callable using argument types (GLColor!float, int, int), candidates are:

Re: parameter pack to inputRange

2016-05-08 Thread Erik Smith via Digitalmars-d-learn
On Sunday, 8 May 2016 at 23:49:40 UTC, Ali Çehreli wrote: On 05/08/2016 04:48 PM, Erik Smith wrote: On Sunday, 8 May 2016 at 22:37:44 UTC, Dicebot wrote: On Sunday, 8 May 2016 at 14:11:31 UTC, Ali Çehreli wrote: E front() { final switch (index) { /* static

Re: parameter pack to inputRange

2016-05-08 Thread Ali Çehreli via Digitalmars-d-learn
On 05/08/2016 04:48 PM, Erik Smith wrote: On Sunday, 8 May 2016 at 22:37:44 UTC, Dicebot wrote: On Sunday, 8 May 2016 at 14:11:31 UTC, Ali Çehreli wrote: E front() { final switch (index) { /* static */ foreach (i, arg; Args) { case i:

Re: parameter pack to inputRange

2016-05-08 Thread Erik Smith via Digitalmars-d-learn
On Sunday, 8 May 2016 at 22:37:44 UTC, Dicebot wrote: On Sunday, 8 May 2016 at 14:11:31 UTC, Ali Çehreli wrote: E front() { final switch (index) { /* static */ foreach (i, arg; Args) { case i: return arg;

Re: parameter pack to inputRange

2016-05-08 Thread Dicebot via Digitalmars-d-learn
On Sunday, 8 May 2016 at 14:11:31 UTC, Ali Çehreli wrote: E front() { final switch (index) { /* static */ foreach (i, arg; Args) { case i: return arg; } } } AFAIK, this will do

Re: parameter pack to inputRange

2016-05-08 Thread Dicebot via Digitalmars-d-learn
On Sunday, 8 May 2016 at 14:11:31 UTC, Ali Çehreli wrote: On 05/05/2016 11:08 PM, Dicebot wrote: > Unless parameter list is very (very!) long, I'd suggest to simply copy > it into a stack struct. Something like this: > > auto toInputRange (T...) (T args) > { > struct Range > { >

Re: parameter pack to inputRange

2016-05-08 Thread Erik Smith via Digitalmars-d-learn
On Sunday, 8 May 2016 at 14:11:31 UTC, Ali Çehreli wrote: On 05/05/2016 11:08 PM, Dicebot wrote: > Unless parameter list is very (very!) long, I'd suggest to simply copy > it into a stack struct. Something like this: > > auto toInputRange (T...) (T args) > { > struct Range > { >

Re: Small C wrapper in your DUB package?

2016-05-08 Thread cy via Digitalmars-d-learn
Well, just messing with it myself, the solution seems to be to make a .a library, link with /lib/libc.a since unlike .o, .a breaks shared linkage, and then refer to it in libs as "$PACKAGE_DIR/libmywrapper.a" ... "preBuildCommands": ["make -C $PACKAGE_DIR"], "libs":

Small C wrapper in your DUB package?

2016-05-08 Thread cy via Digitalmars-d-learn
I'm tiring of making extern (C) signatures for a million library calls and counting out the offset of members of C structures, to produce analagous D structures. Couldn't I just make a .c file that had my own specialized, opaque, D friendly interface? I don't really know how to do that.

Re: parameter pack to inputRange

2016-05-08 Thread Ali Çehreli via Digitalmars-d-learn
On 05/05/2016 11:08 PM, Dicebot wrote: > Unless parameter list is very (very!) long, I'd suggest to simply copy > it into a stack struct. Something like this: > > auto toInputRange (T...) (T args) > { > struct Range > { > T args; > size_t index; > > T[0] front

Compiler silently ignores some method overloads

2016-05-08 Thread pineapple via Digitalmars-d-learn
In my struct I have some methods with these signatures: void opIndexAssign(T)(in GLColor!T color, in int x, in int y) void opIndexAssign(T1, T2)(in GLColor!T1 color, in Vector2!T2 vector) void opIndexAssign(in uint value, in int x, in int y) And when I try to do this:

Re: ggplotd - curve colour

2016-05-08 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Sunday, 8 May 2016 at 01:50:38 UTC, brocolis wrote: How do I set the color of a curve with ggplotd? Thanks. Also see the below example on how to merge Colour with an existing range of points using mergeRange: (Copied from http://blackedder.github.io/ggplotd/stat.html) void main() {

Re: ggplotd - curve colour

2016-05-08 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Sunday, 8 May 2016 at 01:50:38 UTC, brocolis wrote: How do I set the color of a curve with ggplotd? Thanks. You can set colours by name: https://github.com/BlackEdder/ggplotd/blob/master/source/ggplotd/colour.d#L20 Alternatively you can pass through the RGB value (see the link above for

Re: template auto instantiation when parameters empty

2016-05-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, May 05, 2016 19:09:01 Steven Schveighoffer via Digitalmars-d- learn wrote: > On 5/5/16 6:50 PM, Erik Smith wrote: > > Alias works at the cost of adding a 2nd type name: > > > > alias Res = Resource!(); > > auto res = Res.create > > > > The other problem is that the alias definition

Re: How can I save a class use the RedBlackTree?

2016-05-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, May 03, 2016 13:26:22 Meta via Digitalmars-d-learn wrote: > On Tuesday, 3 May 2016 at 12:12:04 UTC, Jonathan M Davis wrote: > > On Tue, 3 May 2016 11:37:13 +0200 > > Steven Schveighoffer via Digitalmars-d-learn > > > > wrote: > >> bleh, Object.opCmp