Re: dmd -o- option meaning changed recently? Now not creating OBJ but also not creating EXE

2016-10-02 Thread A D dev via Digitalmars-d-learn
On Sunday, 2 October 2016 at 20:47:44 UTC, ag0aep6g wrote: I think you may be misremembering things. I've checked versions back to 2.051 (from 2010, oldest I've got lying around). None of them wrote an executable with -o-. 1. Thanks a lot for all that checking and for your reply. 2. I've

Re: dmd -o- option meaning changed recently? Now not creating OBJ but also not creating EXE

2016-10-02 Thread ag0aep6g via Digitalmars-d-learn
On 10/02/2016 10:33 PM, A D dev wrote: When I compile single-file D programs, I don't want to keep the generated object file (.OBJ, on Windows). I had checked the D compiler options for this (using dmd --help), and IIRC, a few weeks ago, I had used the -o- option (do not write object file) with

dmd -o- option meaning changed recently? Now not creating OBJ but also not creating EXE

2016-10-02 Thread A D dev via Digitalmars-d-learn
Hi list, I'm in the beginning stages of learning D. Enjoying it, but get some issues now and then. This is one. When I compile single-file D programs, I don't want to keep the generated object file (.OBJ, on Windows). I had checked the D compiler options for this (using dmd --help), and

Re: Symbol lookup failed in imported module

2016-10-02 Thread Lodovico Giaretta via Digitalmars-d-learn
On Sunday, 2 October 2016 at 20:12:16 UTC, rumbu wrote: [...] I think you'll find the following article really interesting. It talks exactly about what you are experiencing. http://dlang.org/hijack.html

Symbol lookup failed in imported module

2016-10-02 Thread rumbu via Digitalmars-d-learn
module module1; void foo(string s) {} -- module module2; import module1; void foo(int i) { foo("abc"); //error - function foo(int) is not callable using argument types(string) } Ok, this can be easily solved using "alias foo = module1.foo", but according to the

Re: Getting consistent behavour for class properties

2016-10-02 Thread Lodovico Giaretta via Digitalmars-d-learn
On Sunday, 2 October 2016 at 17:10:58 UTC, mikey wrote: There is already a degree of transparency with how properties being handled for example in allowing properties to be an lvalue if they have a setter. t.val = 42; Actually, this is not specific to properties, as it also works on

Implicit casting of int enum members to int

2016-10-02 Thread Mike Bierlee via Digitalmars-d-learn
Consider the following code: enum StringTypeEnumOne : string { bla = "bla" } enum StringTypeEnumTwo : string { bleh = "bleh" } enum IntTypeEnumOne : int { bla = 1 } enum IntTypeEnumTwo : int { bleh = 2 } public void main() { string[] strings =

Re: Class attributes

2016-10-02 Thread Basile B. via Digitalmars-d-learn
On Sunday, 2 October 2016 at 15:54:38 UTC, Satoshi wrote: Hello, why pure @safe nothrow @nogc struct Point { } isn't same as struct Point { pure: @safe: nothrow: @nogc: } ?? This is not specified but attributes aren't applied to the scope created by the declaration. Which is a good thing,

Re: Getting consistent behavour for class properties

2016-10-02 Thread mikey via Digitalmars-d-learn
On Sunday, 2 October 2016 at 14:44:13 UTC, Lodovico Giaretta wrote: Yeah, a property is quite different from a variable. In fact, a property may refer to a computed value, which may not have an address and as such cannot be modified: [...] So it is correct that `+=` doesn't work with

Class attributes

2016-10-02 Thread Satoshi via Digitalmars-d-learn
Hello, why pure @safe nothrow @nogc struct Point { } isn't same as struct Point { pure: @safe: nothrow: @nogc: } ??

Re: Getting consistent behavour for class properties

2016-10-02 Thread Lodovico Giaretta via Digitalmars-d-learn
On Sunday, 2 October 2016 at 14:26:46 UTC, mikey wrote: [...] Yeah, a property is quite different from a variable. In fact, a property may refer to a computed value, which may not have an address and as such cannot be modified: @property auto currentTimeMillis() { return

Re: Explicit casting of enum -- intentional restriction?

2016-10-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, October 02, 2016 12:00:05 rcorre via Digitalmars-d-learn wrote: > Thanks for tracking that down. I think the bug is that a > string-typed enum passes isSomeString but not isInputRange. It > should either be both or neither. I filed > https://issues.dlang.org/show_bug.cgi?id=16573. I

Getting consistent behavour for class properties

2016-10-02 Thread mikey via Digitalmars-d-learn
Hi, I'm experimenting with the behaviour of properties in D, as I am writing some classes that are being used in a mixture of const and non-const functions. I've found a couple of things that I'd just like to check. First perhaps I should say what I would expect from working with

Re: Getting consistent behavour for class properties

2016-10-02 Thread mikey via Digitalmars-d-learn
On Sunday, 2 October 2016 at 14:26:46 UTC, mikey wrote: t.val = t.val + 1; t.val += t.val; Sorry that should have of course read: t.val = t.val + 1; t.val += 1;

Re: Get date at compile time

2016-10-02 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-10-01 17:00, pineapple wrote: Has there been consideration for adding separate integral tokens for day, month, year, etc? I think it would be better to implement a parse function for std.datetime which works at compile time. We need a parse function anyway. -- /Jacob Carlborg

Re: Explicit casting of enum -- intentional restriction?

2016-10-02 Thread Marc Schütz via Digitalmars-d-learn
On Saturday, 1 October 2016 at 20:52:48 UTC, rcorre wrote: I just tried to compile an old project and the following failed: --- enum Paths : string { bitmapDir = "content/image", fontDir = "content/font", soundDir = "content/sound", ... if (Paths.preferences.exists)