Re: How to install DMD 64bit on Windows?

2015-10-24 Thread ric maicle via Digitalmars-d-learn
On Thursday, 22 October, 2015 02:50 AM, Adam D. Ruppe wrote: Use the .exe installer and it will offer to download and install visual studio for you as part for its process. Sorry to ask this but could anyone please explain why Visual Studio is required by DMD 64-bit? (I have been away far too

D interface header import file

2015-10-26 Thread ric maicle via Digitalmars-d-learn
I just noticed these multiple terminologies: * from the compiler --help, -H refers to a 'header' file * the compiler online page refers to it as 'D interface' file * The generated .di file first line comment says 'D import file' I know they refer to the same thing but how is this kind of

Compiler doesn't complain with multiple definitions

2015-11-11 Thread ric maicle via Digitalmars-d-learn
I was playing with __traits and tried the code below. Shouldn't the compiler emit a warning that I'm defining isPOD multiple times and/or I'm defining something that is built-in like isPOD? // DMD64 D Compiler v2.069 import std.stdio; struct isPOD { bool status = false; } int main() { byte

writef format specifier error message

2015-11-16 Thread ric maicle via Digitalmars-d-learn
I accidentally typed an extra asterisk in the format specifier. I know that it is wrong but the error isn't clear about what and where the error is. import std.stdio; void main() { writef("%*10s", 100); } and I got the following error message(s): $ dmd -run writef.d

Re: writef format specifier error message

2015-11-16 Thread ric maicle via Digitalmars-d-learn
On Tuesday, 17 November, 2015 03:49 AM, Ali Çehreli wrote: On 11/16/2015 10:56 AM, ric maicle wrote: I accidentally typed an extra asterisk in the format specifier. I know that it is wrong but the error isn't clear about what and where the error is. import std.stdio; void main() {

Re: Compiler doesn't complain with multiple definitions

2015-11-12 Thread ric maicle via Digitalmars-d-learn
On Thursday, 12 November, 2015 07:50 PM, anonymous wrote: __traits has special syntax. The first "argument" must be from a list of special keywords that only have special meaning in that place. You can't put the name of a struct there, and you can't put the special keyword anywhere else. So

DMD Compiler 'switches'

2015-10-12 Thread ric maicle via Digitalmars-d-learn
I'm relearning D. I'm using the reference compiler (DMD) and I am a bit confused with how the compiler 'switches' are supposed to be used. I find some 'switches' that require an equal (=) symbol when a value is required to be passed in. -boundscheck=[on|safeonly|off] -color[=on|off]

Re: DMD Compiler 'switches'

2015-10-12 Thread ric maicle via Digitalmars-d-learn
On Tuesday, 13 October, 2015 01:46 AM, anonymous wrote: On Monday 12 October 2015 17:38, ric maicle wrote: I'm wondering if this small irregularity should be made consistent or maybe I misunderstood something. As far as I know, the difference just happened, and there is point to it. The

Re: DMD Compiler 'switches'

2015-10-12 Thread ric maicle via Digitalmars-d-learn
On Tuesday, 13 October, 2015 02:39 AM, Ali Çehreli wrote: If we accept that = cannot be a part of a file name then we could support -D=ddocdir as well, but I checked and = can be used as part of a name at least on Linux. Which may explain why those switches are not consistent with the rest and

Re: DMD Compiler 'switches'

2015-10-12 Thread ric maicle via Digitalmars-d-learn
On Tuesday, 13 October, 2015 05:43 AM, Ali Çehreli wrote: Perhaps those were introduced after the other ones. I am agreeing with the other posters that we cannot fix the other ones because if anyone used = before, it was the part of the path. (Maybe... Never tried... :) ) So, we cannot change

Re: DMD Compiler 'switches'

2015-10-12 Thread ric maicle via Digitalmars-d-learn
On Tuesday, 13 October, 2015 06:11 AM, ric maicle wrote: Would it be possible to deprecate the old syntax, provide notice to all D users and make it obsolete after a year? Please ignore. There is already a DIP filed regarding this matter. DIP41: dmd/rdmd command line overhaul.

Integer literals

2016-01-04 Thread ric maicle via Digitalmars-d-learn
I was rereading the Integer Literals section and trying out some code when I came across a couple of error messages on integer overflows. I have reproduced the code below for reference. void main() { // The maximum long value is ...807 // The following line produces an error message:

Re: Integer literals

2016-01-04 Thread ric maicle via Digitalmars-d-learn
On Monday, 04 January, 2016 10:58 PM, Adam D. Ruppe wrote: On Monday, 4 January 2016 at 14:54:29 UTC, ric maicle wrote: 0U .. 4_294_967_296U in the table Decimal Literal Types has a typo. Shouldn't the range end with 4_294_967_295U? The x .. y syntax excludes y. So 0..3 covers 0, 1, 2. It

Type properties

2016-01-06 Thread ric maicle via Digitalmars-d-learn
Why is init allowed to be redefined but not sizeof? dmd 2.069 import std.stdio; struct Foo { static int init = 5; static int sizeof = 0; } void main() { writeln(Foo.init); writeln(Foo.sizeof); } Error: variable integer.Foo.sizeof .sizeof property cannot be redefined

Re: Type properties

2016-01-06 Thread ric maicle via Digitalmars-d-learn
On Wednesday, 06 January, 2016 04:01 PM, ric maicle wrote: Why is init allowed to be redefined but not sizeof? dmd 2.069 import std.stdio; struct Foo { static int init = 5; static int sizeof = 0; } void main() { writeln(Foo.init); writeln(Foo.sizeof); } Error: variable

Floating point literal definition

2016-02-29 Thread ric maicle via Digitalmars-d-learn
I'm currently reading about floating point literal and came to this part: FloatLiteral: ... Integer ImaginarySuffix Integer FloatSuffix ImaginarySuffix Integer RealSuffix ImaginarySuffix Going to the Integer link, it is defined as: Integer: ...

No property error message

2016-03-19 Thread ric maicle via Digitalmars-d-learn
I got an error message with the following code saying: Error: no property 'length' for type 'int[string]' Shouldn't the error message say 'length()'? ~~~ import std.stdio; void main() { int[string] a; a["one"] = 1; a["two"] = 2; a["three"] = 3; auto len = a.length(); } ~~~ DMD

typeof(0x123f).stringof

2016-03-02 Thread ric maicle via Digitalmars-d-learn
Shouldn't this print 'float'? writeln(typeof(0x123f).stringof);

Re: typeof(0x123f).stringof

2016-03-02 Thread ric maicle via Digitalmars-d-learn
On Wednesday, 02 March, 2016 10:23 AM, ric maicle wrote: Shouldn't this print 'float'? writeln(typeof(0x123f).stringof); Oh man, I should better sleep!

Shouldn't the following code produce a warning?

2016-04-03 Thread ric maicle via Digitalmars-d-learn
The values of the variables here can be determined during compilation. Should there be some kind of warning like, unsigned integer may not be compared to a value less than zero; or there shouldn't be since the programmer should have known what he's doing? import std.stdio; void f1() {

Custom asset handler messes unit test summary report

2020-02-23 Thread ric maicle via Digitalmars-d-learn
[dmd 2.090.1 linux 64-bit] The following code does not report the correct unit test summary. The report says 1 unit test passed. ~ shared static this() { import core.exception; assertHandler(); } void cah(string file, ulong line, string msg) nothrow { import core.stdc.stdio: