Re: Why does D language do not support BigDecimal type?

2019-03-12 Thread Cym13 via Digitalmars-d-learn
On Monday, 11 March 2019 at 15:23:34 UTC, BoQsc wrote: There is Money datatype that can be provided by using a third party package: https://code.dlang.org/packages/money But that's only for money, what about math? Why such fundamental as BigDecimal is still not included into the D language

Re: Why a template with Nullable does not compile?

2019-03-12 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 05:14:21 UTC, Victor Porton wrote: Why does this not compile? import std.typecons; template FieldInfo(T, Nullable!T default_) { } /usr/lib/ldc/x86_64-linux-gnu/include/d/std/typecons.d(2570,17): Error: `alias T = T;` cannot alias itself, use a qualified name to

Re: Why does D language do not support BigDecimal type?

2019-03-12 Thread Kagamin via Digitalmars-d-learn
On Monday, 11 March 2019 at 15:23:34 UTC, BoQsc wrote: If it is unavoidable to use Floating point, how can I quickly and simply understand the rules of using float to make the least error, or should I just find a third party package for that as well? It's taught in a computational

Re: Setting the GtkD Include Path in dexed?

2019-03-12 Thread Ron Tarrant via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 21:54:36 UTC, JN wrote: On Tuesday, 12 March 2019 at 17:39:06 UTC, Ron Tarrant wrote: Another way of asking this, I suppose, would be: How do I pass command line arguments to dmd from within dexed? How about Project -> Project editor -> Categories -> Other ->

Re: Easiest way to display images

2019-03-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 02:21:51 UTC, Murilo wrote: Hi Adam, how do I set the color of the SimpleWindow background? You have to draw a rectangle on the window to make your own background. Set both outlineColor and fillColor to the same thing, then do painter.drawRectangle(Point(0, 0),

Re: Why does D language do not support BigDecimal type?

2019-03-12 Thread Seb via Digitalmars-d-learn
On Monday, 11 March 2019 at 15:23:34 UTC, BoQsc wrote: There is Money datatype that can be provided by using a third party package: https://code.dlang.org/packages/money But that's only for money, what about math? Why such fundamental as BigDecimal is still not included into the D language

Re: Why does D language do not support BigDecimal type?

2019-03-12 Thread Boqsc via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 08:48:33 UTC, Cym13 wrote: On Monday, 11 March 2019 at 15:23:34 UTC, BoQsc wrote: There is Money datatype that can be provided by using a third party package: https://code.dlang.org/packages/money But that's only for money, what about math? Why such fundamental as

Re: am I using version right?

2019-03-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 17:07:11 UTC, DFTW wrote: In that code, the static assert() will run if and only if neither version condition is true, i.e, the OS is neither Windows nor linux. Correct? yes, that's right.

Re: inout auto ref escaping a reference to parameter, only errors with vibe Json type, or if inout is there.

2019-03-12 Thread aliak via Digitalmars-d-learn
On Monday, 11 March 2019 at 22:29:05 UTC, aliak wrote: [...] Here's a much reduces test case: struct W(T) {} struct S { int* data; } template match1(alias handler) { auto ref match1(T)(inout auto ref W!T w) { return handler(); } } template match2(alias handler) {

Re: Setting the GtkD Include Path in dexed?

2019-03-12 Thread Ron Tarrant via Digitalmars-d-learn
Another way of asking this, I suppose, would be: How do I pass command line arguments to dmd from within dexed?

Re: Why a template with Nullable does not compile?

2019-03-12 Thread Victor Porton via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 15:26:05 UTC, Victor Porton wrote: template FieldInfo(T, Nullable!T default_) { } On Tuesday, 12 March 2019 at 09:05:36 UTC, Nicholas Wilson wrote: It seems to be getting confused between the two types of Nullable, namely: Nullable(T), and Nullable(T, T

am I using version right?

2019-03-12 Thread DFTW via Digitalmars-d-learn
version(Windows) { writeln("Hello from Windows system!"); } else version(linux) { writeln("hello from linux!"); } else static assert(0, "unknow system!"); In that code, the static assert() will run if and

Re: How are (Static) Libraries with Templates Compiled?

2019-03-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-03-11 21:59, jmh530 wrote: Ah, so you need the .lib files and the .di files to get it work. You need the .di or .d files regardless if it's a template or not. Because you need to know which declarations are available. In addition to that, for templates the source (and not just the

Re: Why a template with Nullable does not compile?

2019-03-12 Thread Victor Porton via Digitalmars-d-learn
template FieldInfo(T, Nullable!T default_) { } On Tuesday, 12 March 2019 at 09:05:36 UTC, Nicholas Wilson wrote: It seems to be getting confused between the two types of Nullable, namely: Nullable(T), and Nullable(T, T defaultVal) I don't understand why exactly it is getting confused. How

Re: inout auto ref escaping a reference to parameter, only errors with vibe Json type, or if inout is there.

2019-03-12 Thread aliak via Digitalmars-d-learn
On Monday, 11 March 2019 at 22:29:05 UTC, aliak wrote: Hi, I have an error that says "Error: returning `match1(opt)` escapes a reference to parameter `opt`, perhaps annotate with `return`". [...] Ok, I've found out something else. It only happens when you're returning a type that has an

Re: Why a template with Nullable does not compile?

2019-03-12 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Mar 12, 2019 at 03:26:05PM +, Victor Porton via Digitalmars-d-learn wrote: [...] > On Tuesday, 12 March 2019 at 09:05:36 UTC, Nicholas Wilson wrote: [...] > > template FieldInfo(T) { > > template FieldInfo(Nullable!(T) default_) > > { > > enum FieldInfo = 0; > > }

Re: ggplotd Fixed ratio between x and y axes

2019-03-12 Thread jmh530 via Digitalmars-d-learn
On Monday, 11 March 2019 at 23:34:06 UTC, kerdemdemir wrote: How can I configure a fixed ratio between x and y axes in ggplotd ? I easily found what I am looking for in ggplot which ggplotd inspires a lot. http://www.cookbook-r.com/Graphs/Axes_(ggplot2)/ But ggplotd documentation does not

Re: Another Tuesday (Friday?), Another GtkDcoding Blog Post

2019-03-12 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 15:35:03 UTC, Ron Tarrant wrote: [snip] It's a learning resource, so wouldn't that go here? Or am I misinterpreting the intention of the Learn sub-forum? If you a moderator believes it should move, please feel free. It's a learning resource, sure, but you're

Re: Why a template with Nullable does not compile?

2019-03-12 Thread Victor Porton via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 16:20:11 UTC, H. S. Teoh wrote: On Tue, Mar 12, 2019 at 03:26:05PM +, Victor Porton via Digitalmars-d-learn wrote: [...] On Tuesday, 12 March 2019 at 09:05:36 UTC, Nicholas Wilson wrote: [...] > template FieldInfo(T) { > template FieldInfo(Nullable!(T)

Re: Why a template with Nullable does not compile?

2019-03-12 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Mar 12, 2019 at 04:23:29PM +, Victor Porton via Digitalmars-d-learn wrote: [...] > I know what is eponymous template. But how it behaves when the > eponymous member inside itself is also a template? How to instantiate > it? (provide please an example how to instantiate) You need to

Re: Why does D language do not support BigDecimal type?

2019-03-12 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 09:31:53 UTC, Boqsc wrote: [snip] Please attach quick working examples for every sentence you write or it's just a waste of time. People want to see the results and direct actions first before anything else, it's more efficient communication. We are in the

Re: Another Tuesday (Friday?), Another GtkDcoding Blog Post

2019-03-12 Thread Ron Tarrant via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 15:15:00 UTC, jmh530 wrote: I thought the suggestion was one thread in the Announce forum, rather than multiple threads in the Announce forum...rather than one thread in the Learn forum. It's a learning resource, so wouldn't that go here? Or am I misinterpreting

Setting the GtkD Include Path in dexed?

2019-03-12 Thread Ron Tarrant via Digitalmars-d-learn
I managed to get dexed to compile a single-file dub project, but for completeness sake, I'm also trying to configure it to use dmd (non-dub) to compile GtkD projects using Compilation (menu) > Compile File and Run. To that end, I have two questions... Should I be supplying dexed with the

Re: Another Tuesday (Friday?), Another GtkDcoding Blog Post

2019-03-12 Thread Ron Tarrant via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 16:08:46 UTC, jmh530 wrote: Tricky. My thinking exactly. (I would have replied with a simple, "Yup," but I did that once before and the forum software made me do a Capcha.)

Another Tuesday (Friday?), Another GtkDcoding Blog Post

2019-03-12 Thread Ron Tarrant via Digitalmars-d-learn
It was suggested that I do all these posts in one thread, so this is the thread where that'll happen. With that said... It's Tuesday! (and that used to be a Theatresports game when Keith Johnstone still ran things) OR... It's Friday! And that (the Tuesday OR Friday part) means it's time

Re: Why does D language do not support BigDecimal type?

2019-03-12 Thread spir via Digitalmars-d-learn
On 12/03/2019 10:31, Boqsc via Digitalmars-d-learn wrote: Please attach quick working examples for every sentence you write or it's just a waste of time. People want to see the results and direct actions first before anything else, it's more efficient communication. We are in the subforum of

Re: Another Tuesday (Friday?), Another GtkDcoding Blog Post

2019-03-12 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 14:44:59 UTC, Ron Tarrant wrote: It was suggested that I do all these posts in one thread, so this is the thread where that'll happen. With that said... [snip] I thought the suggestion was one thread in the Announce forum, rather than multiple threads in the

Re: Setting the GtkD Include Path in dexed?

2019-03-12 Thread JN via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 17:39:06 UTC, Ron Tarrant wrote: Another way of asking this, I suppose, would be: How do I pass command line arguments to dmd from within dexed? How about Project -> Project editor -> Categories -> Other -> dmdOtherOptions ?