Re: Unable to convert a MapResult to an InputRange.

2016-09-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, September 19, 2016 01:13:19 Jake Pittis via Digitalmars-d-learn wrote: > > import std.stdio; > import std.array; > import std.algorithm; > import std.range; > > InputRange!string keys(int[string] foo) { >return foo.byPair.map!(p => p[0]); > } > > void main() { >int[string]

Unable to convert a MapResult to an InputRange.

2016-09-18 Thread Jake Pittis via Digitalmars-d-learn
import std.stdio; import std.array; import std.algorithm; import std.range; InputRange!string keys(int[string] foo) { return foo.byPair.map!(p => p[0]); } void main() { int[string] foo; foo["lol"] = 1; foo["wat?"] = 2; keys(foo).each!(p => writeln(p)); } The above code

Re: polar coordinates with ggplotd

2016-09-18 Thread brocolis via Digitalmars-d-learn
On Sunday, 18 September 2016 at 22:07:31 UTC, brocolis wrote: I've tried this code. import ggplotd.ggplotd; import ggplotd.geom; import ggplotd.aes; import ggplotd.axes; import std.math; auto r(double theta) { return 2 * sin(6*theta); } auto getX(double theta) { return

polar coordinates with ggplotd

2016-09-18 Thread brocolis via Digitalmars-d-learn
I've tried this code. import ggplotd.ggplotd; import ggplotd.geom; import ggplotd.aes; import ggplotd.axes; import std.math; auto r(double theta) { return 2 * sin(6*theta); } auto getX(double theta) { return r(theta) * cos(theta); } auto getY(double theta) { return

Re: Getting Data Members of an Aggregate

2016-09-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, September 18, 2016 21:49:58 Nordlöw via Digitalmars-d-learn wrote: > How do I extract only the *data* members of an aggregate type `T`. > > Simpliy `__traits(allMembers, T)` is not enough since it all > returns function, type and alias members along side the data > members. > > I need

Getting Data Members of an Aggregate

2016-09-18 Thread Nordlöw via Digitalmars-d-learn
How do I extract only the *data* members of an aggregate type `T`. Simpliy `__traits(allMembers, T)` is not enough since it all returns function, type and alias members along side the data members. I need this when serializing an instance of the element type to be inserted into a radix tree

Re: Getting GtkD working with OpenGL

2016-09-18 Thread Mike Wey via Digitalmars-d-learn
On 09/18/2016 09:36 PM, Chalix wrote: Hi All! This weekend I explored Dlang and I think it's very promising. So I wanted to create some projects I've created with C++ already - for the sake of comparison. I wanted to create a new class which inherits from DrawingArea (from the Gtk library).

Re: traits help

2016-09-18 Thread Bauss via Digitalmars-d-learn
On Sunday, 18 September 2016 at 13:28:15 UTC, ketmar wrote: https://issues.dlang.org/show_bug.cgi?id=11595 https://issues.dlang.org/show_bug.cgi?id=16044 Thanks that clarifies my issues... Do you if there are any statuses on that?

Re: Getting GtkD working with OpenGL

2016-09-18 Thread Chalix via Digitalmars-d-learn
Here the code I actually wanted to compile (SimpleGL.d): /* * This file is part of gtkD. * * dui is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the

Getting GtkD working with OpenGL

2016-09-18 Thread Chalix via Digitalmars-d-learn
Hi All! This weekend I explored Dlang and I think it's very promising. So I wanted to create some projects I've created with C++ already - for the sake of comparison. I wanted to create a new class which inherits from DrawingArea (from the Gtk library). This will be my OpenGL-Widget with

Re: Draw math formulas with ggplotd

2016-09-18 Thread brocolis via Digitalmars-d-learn
On Saturday, 17 September 2016 at 11:45:07 UTC, Edwin van Leeuwen wrote: On Saturday, 17 September 2016 at 11:22:04 UTC, John Colvin wrote: On Saturday, 17 September 2016 at 02:41:15 UTC, brocolis wrote: How do I draw math formulas programmatically? I want to do on screen what latex does on

Re: GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 September 2016 at 15:40:09 UTC, Basile B. wrote: Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on linux x86_64, GDB 7.8 If I send to GDB "break _d_assert" it will break correctly on "assert(false);" so I can jump over. But the

Re: GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 September 2016 at 15:48:27 UTC, Basile B. wrote: On Sunday, 18 September 2016 at 15:40:55 UTC, Guillaume Piolat wrote: On Sunday, 18 September 2016 at 15:40:09 UTC, Basile B. wrote: Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on

Re: GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 September 2016 at 15:48:27 UTC, Basile B. wrote: On Sunday, 18 September 2016 at 15:40:55 UTC, Guillaume Piolat wrote: On Sunday, 18 September 2016 at 15:40:09 UTC, Basile B. wrote: Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on

Re: GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 September 2016 at 15:40:55 UTC, Guillaume Piolat wrote: On Sunday, 18 September 2016 at 15:40:09 UTC, Basile B. wrote: Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on linux x86_64, GDB 7.8 If I send to GDB "break _d_assert" it

Re: GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 18 September 2016 at 15:40:09 UTC, Basile B. wrote: Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on linux x86_64, GDB 7.8 If I send to GDB "break _d_assert" it will break correctly on "assert(false);" so I can jump over. But the

GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on linux x86_64, GDB 7.8 If I send to GDB "break _d_assert" it will break correctly on "assert(false);" so I can jump over. But the equivalent for _d_throwc doesn't work anymore ! Any idea ?

Re: construct range from tuple?

2016-09-18 Thread Lutger via Digitalmars-d-learn
On Sunday, 18 September 2016 at 09:36:13 UTC, e-y-e wrote: On Sunday, 18 September 2016 at 08:06:54 UTC, Lutger wrote: [...] Use std.range's 'only' function [1], it takes variadic arguments of the same type and constructs a range consisting of them. Example: import std.meta :

Re: traits help

2016-09-18 Thread ketmar via Digitalmars-d-learn
https://issues.dlang.org/show_bug.cgi?id=11595 https://issues.dlang.org/show_bug.cgi?id=16044

Re: construct range from tuple?

2016-09-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, September 18, 2016 09:36:13 e-y-e via Digitalmars-d-learn wrote: > Use std.range's 'only' function [1], it takes variadic arguments > of the same type and constructs a range consisting of them. > > Example: > > import std.meta : AliasSeq; > import std.range : only; >

Re: construct range from tuple?

2016-09-18 Thread e-y-e via Digitalmars-d-learn
On Sunday, 18 September 2016 at 09:36:13 UTC, e-y-e wrote: On Sunday, 18 September 2016 at 08:06:54 UTC, Lutger wrote: [...] Use std.range's 'only' function [1], it takes variadic arguments of the same type and constructs a range consisting of them. Example: import std.meta :

Re: construct range from tuple?

2016-09-18 Thread e-y-e via Digitalmars-d-learn
On Sunday, 18 September 2016 at 08:06:54 UTC, Lutger wrote: I have a tuple of strings generated at compile time, for example: alias names = AliasSeq!("Alice", "Bob"); How is it possible to construct a range of strings from this, in order to use it at runtime with other range algorithms?

Re: construct range from tuple?

2016-09-18 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 18 September 2016 at 08:06:54 UTC, Lutger wrote: I have a tuple of strings generated at compile time, for example: alias names = AliasSeq!("Alice", "Bob"); How is it possible to construct a range of strings from this, in order to use it at runtime with other range algorithms?

Re: Can vibe d leverage existing web technologies?

2016-09-18 Thread Lutger via Digitalmars-d-learn
On Thursday, 15 September 2016 at 20:56:19 UTC, Intersteller wrote: On Thursday, 15 September 2016 at 14:31:28 UTC, Martin Tschierschke wrote: On Tuesday, 13 September 2016 at 23:45:18 UTC, Intersteller wrote: vibe.d does not have much lateral support as the most commons web technologies do.

construct range from tuple?

2016-09-18 Thread Lutger via Digitalmars-d-learn
I have a tuple of strings generated at compile time, for example: alias names = AliasSeq!("Alice", "Bob"); How is it possible to construct a range of strings from this, in order to use it at runtime with other range algorithms? For example, this chain(names, ["Chuck"]) doesn't work as

traits help

2016-09-18 Thread Bauss via Digitalmars-d-learn
I'm trying to retrieve all functions with a certain attribute. I know how to go about it and I can get it working with functions in the same module as the traits expression, but as soon as I nest modules in packages and import those packages then I don't get any functions. Is there a way to