Re: Real implicitly converts to float?

2016-06-24 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Friday, 24 June 2016 at 20:10:16 UTC, Tofu Ninja wrote: I am glad I was not the only one who thought that sounded a little crazy... I thought D was supposed to be type safe. I think I will make a bug report and see where that goes. It is one of those cases where it made sense in C because i

Re: Is there a dmd.exe x86_64 out there?

2016-06-24 Thread rikki cattermole via Digitalmars-d-learn
On 25/06/2016 5:57 AM, Dlangofile wrote: Hi all, I'm building a Docker Alpine linux image with wine, for being able to forge Windows executable from my laptop, without having to dual boot. With my disappointment, I'm not able to run 32bit executable from the container right now, so the easy way

Re: Error: module ctype is in file 'std/ctype.d' which cannot be read - when running dmd

2016-06-24 Thread Roman via Digitalmars-d-learn
On Friday, 24 June 2016 at 21:06:30 UTC, cym13 wrote: On Friday, 24 June 2016 at 21:01:11 UTC, Roman wrote: I should probably add that only importing std.ctype causes the error. I have a bunch of other imports: import std.stdio, std.string, std.algorithm, std.conv, std.ctype, std.regex, s

Re: Error: module ctype is in file 'std/ctype.d' which cannot be read - when running dmd

2016-06-24 Thread Roman via Digitalmars-d-learn
I should probably add that only importing std.ctype causes the error. I have a bunch of other imports: import std.stdio, std.string, std.algorithm, std.conv, std.ctype, std.regex, std.range; If I remove std.ctype, it compiles just fine.

Re: Error: module ctype is in file 'std/ctype.d' which cannot be read - when running dmd

2016-06-24 Thread cym13 via Digitalmars-d-learn
On Friday, 24 June 2016 at 21:01:11 UTC, Roman wrote: I should probably add that only importing std.ctype causes the error. I have a bunch of other imports: import std.stdio, std.string, std.algorithm, std.conv, std.ctype, std.regex, std.range; If I remove std.ctype, it compiles just fin

Error: module ctype is in file 'std/ctype.d' which cannot be read - when running dmd

2016-06-24 Thread Roman via Digitalmars-d-learn
I've just tried to compile a program with `rdmd`, but get the following error: count_words.d(1): Error: module ctype is in file 'std/ctype.d' which cannot be read import path[0] = . import path[1] = /home/roman/dlang/dmd-2.071.0/linux/bin64/../../src/phobos import path[2] = /

Re: Real implicitly converts to float?

2016-06-24 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 24 June 2016 at 20:10:16 UTC, Tofu Ninja wrote: I am glad I was not the only one who thought that sounded a little crazy... I thought D was supposed to be type safe. I think I will make a bug report and see where that goes. https://issues.dlang.org/show_bug.cgi?id=16202

Re: Real implicitly converts to float?

2016-06-24 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 24 June 2016 at 08:52:48 UTC, Ola Fosheim Grøstad wrote: This is so wrong. _especially_ when you have parameter overloading/templates. It means that you accidentally can trash a computation by getting the wrong function. That is not type-safe in my book. Jonathan's max-value exampl

Re: GTKD - CSS class color "flash" delay

2016-06-24 Thread TheDGuy via Digitalmars-d-learn
On Friday, 24 June 2016 at 16:44:59 UTC, Gerald wrote: Other then the obvious multi-threaded, using glib.Timeout to trigger the reversion of the color change could be an option. http://api.gtkd.org/src/glib/Timeout.html Thanks! I tried this so far: private void letButtonsFlash(){

Re: Get calling this, if exists

2016-06-24 Thread Ali Çehreli via Digitalmars-d-learn
On 06/24/2016 10:19 AM, Smoke Adams wrote: > We have __FUNCTION__ so, __THIS__ seems somewhat natural. Null for > outside of objects is fine. Would the following work, where you check the first argument? import std.stdio; void Log(string filename = __FILE__, T...)(T args) { static if (is (

Is there a dmd.exe x86_64 out there?

2016-06-24 Thread Dlangofile via Digitalmars-d-learn
Hi all, I'm building a Docker Alpine linux image with wine, for being able to forge Windows executable from my laptop, without having to dual boot. With my disappointment, I'm not able to run 32bit executable from the container right now, so the easy way is running a win64 dmd.exe: someone

Re: Get calling this, if exists

2016-06-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/24/16 1:19 PM, Smoke Adams wrote: The problem with UFCS is that I am using variadic parameters. The logging function isn't designed to accept the first parameter as this. Then you would need to change it? It would be much easier to simply have the compiler "insert" it using __THIS__. Ju

Re: Get calling this, if exists

2016-06-24 Thread Smoke Adams via Digitalmars-d-learn
On Friday, 24 June 2016 at 15:35:57 UTC, Steven Schveighoffer wrote: On 6/24/16 11:15 AM, Smoke Adams wrote: On Friday, 24 June 2016 at 03:16:58 UTC, Meta wrote: On Friday, 24 June 2016 at 03:10:51 UTC, Mike Parker wrote: Oh, perhaps I misunderstood your question. Do you meant this: class Foo

Re: GTKD - CSS class color "flash" delay

2016-06-24 Thread Gerald via Digitalmars-d-learn
On Friday, 24 June 2016 at 12:38:37 UTC, TheDGuy wrote: The color changing part works fine but if i use some kind of delay the program just starts delayed but no color changing happens. I am wondering why, because everything is executed in one thread, so the execution order looks like this to m

Re: Get calling this, if exists

2016-06-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/24/16 11:15 AM, Smoke Adams wrote: On Friday, 24 June 2016 at 03:16:58 UTC, Meta wrote: On Friday, 24 June 2016 at 03:10:51 UTC, Mike Parker wrote: Oh, perhaps I misunderstood your question. Do you meant this: class Foo() { void bar() { Log(); } // Pass reference to Foo instance } vo

Re: Get calling this, if exists

2016-06-24 Thread Smoke Adams via Digitalmars-d-learn
On Friday, 24 June 2016 at 03:16:58 UTC, Meta wrote: On Friday, 24 June 2016 at 03:10:51 UTC, Mike Parker wrote: Oh, perhaps I misunderstood your question. Do you meant this: class Foo() { void bar() { Log(); } // Pass reference to Foo instance } void doSomething() { Log(); } // Null refer

GTKD - CSS class color "flash" delay

2016-06-24 Thread TheDGuy via Digitalmars-d-learn
Hello, i would like to flash some buttons with CSS. My current approach: for(int i = 0; i < level; i++){ Button currentButton = bArr[rndButtonBlink[i]]; ListG list = currentButton.getStyleContext().listClasses(); string CSSClassName = to!string(cast(

Re: Real implicitly converts to float?

2016-06-24 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Thursday, 23 June 2016 at 15:25:49 UTC, Steven Schveighoffer wrote: On 6/23/16 11:16 AM, Tofu Ninja wrote: On Thursday, 23 June 2016 at 13:57:57 UTC, Steven Schveighoffer wrote: Whenever you work with floating point, the loss of precision must be expected -- a finite type cannot represent an