Re: Problem Linking Phobos git master

2014-07-05 Thread Nordlöw
On Saturday, 5 July 2014 at 02:13:39 UTC, Kapps wrote: Possibly something related to: https://github.com/D-Programming-Language/dmd/pull/3715 Have you tried updating to git master today? Yes, unfortunately with the same problem (with ld.bfd). With ld.gold I get a huge amount of errors:

Re: Problem Linking Phobos git master

2014-07-05 Thread Nordlöw
On Saturday, 5 July 2014 at 09:54:21 UTC, Nordlöw wrote: On Saturday, 5 July 2014 at 02:13:39 UTC, Kapps wrote: Possibly something related to: https://github.com/D-Programming-Language/dmd/pull/3715 Have you tried updating to git master today? Yes, unfortunately with the same problem (with

Re: Problem Linking Phobos git master

2014-07-05 Thread Mike Wey via Digitalmars-d-learn
On 07/05/2014 12:13 AM, Nordlöw wrote: On Ubuntu 14.04 my git master build script for phobos now fails as below. Why? Help please. /usr/bin/ld points to /usr/bin/ld.bfd on my system Terminal echo and error message follows: ../dmd/src/dmd

Slow compilation using a lib with template methods

2014-07-05 Thread ParticlePeter via Digitalmars-d-learn
Hello community, here is a post with multiple questions regarding compile times, or rather the optimization of the compile and link process. I work with VisualD and am interested in optimizing my projects with this utility, hence there will be a similar topic linking here, where I explain my

Visual D: Settings to Improve compil and link process

2014-07-05 Thread ParticlePeter via Digitalmars-d-learn
Hello Community, I thought there's a separate forum for VisualD. It did exist when VisualD was on DSource, so why not add it here as well? Or am I to blind to see? Anyway, this thread is an addition to my previous one in this forum:

Re: break on assertion in GDB?

2014-07-05 Thread Vlad Levenfeld via Digitalmars-d-learn
The reason it worked one time and not the other was because the other time was an exception, not an assertion. How do I break on exceptions? (ps. is there a guide anywhere to using GDB with D?)

std.algorithm.map with multiple lambdas (2.066.0-b1) (does not compile)

2014-07-05 Thread klasbo via Digitalmars-d-learn
void main(){ import std.algorithm, std.stdio; auto arr = [1,2,3]; arr.map!(a + a, a * a).writeln; //compiles arr.map!(a = a + a, a = a * a).writeln; //does not } If I define two functions outside main, it works: void main(){ import std.algorithm,

What exactly module in D means?

2014-07-05 Thread Andre Tampubolon via Digitalmars-d-learn
I've been reading the newsgroup for a while, and it seems that one of the reason folks like D is because it supports module. My question is: what does module mean? A quick google pointed my this page: http://dlang.org/module.html. Still cannot understand it, though :) How does it differ from

Trouble initializing a templated class

2014-07-05 Thread quakkels via Digitalmars-d-learn
I'm going through Adam Wilson's talk 'C# to D' and I've gotten hung up by one of his examples regarding generic programming in D. Specifically, I'm trying to implement the code example found here: http://youtu.be/6_xdfSVRrKo?t=16m44s. I created a templateExp.d file that looks like this:

Re: Trouble initializing a templated class

2014-07-05 Thread quakkels via Digitalmars-d-learn
When I run the dmd compiler, I get this error: dmd templateExp.d teamplteExp.d(12): Error: class teamplteExp.SomeClass(T : BaseClass) is used as a type This is actually: templateExp.d(12): Error: class templateExp.SomeClass(T : BaseClass) is used as a type

Re: Trouble initializing a templated class

2014-07-05 Thread Vlad Levenfeld via Digitalmars-d-learn
On Saturday, 5 July 2014 at 16:47:32 UTC, quakkels wrote: I'm going through Adam Wilson's talk 'C# to D' and I've gotten hung up by one of his examples regarding generic programming in D. Specifically, I'm trying to implement the code example found here: http://youtu.be/6_xdfSVRrKo?t=16m44s.

Re: What exactly module in D means?

2014-07-05 Thread Olivier Pisano via Digitalmars-d-learn
No, import is different from include. It does not stupidly copy and paste its content but tells the compiler to take the module into account for name resolution. The result may seem similar, but is much more efficient. A D module is also a unit of encapsulation (a private declaration in a module

Re: Trouble initializing a templated class

2014-07-05 Thread Vlad Levenfeld via Digitalmars-d-learn
On Saturday, 5 July 2014 at 17:17:03 UTC, quakkels wrote: try SomeClass (T): BaseClass Not sure which line you want me to change. I don't want SomeClass to inherit from BaseClass. Rather, I want T to be restricted to classes that inherit from BaseClass. When I change `class SomeClass(T :

Re: Trouble initializing a templated class

2014-07-05 Thread quakkels via Digitalmars-d-learn
try SomeClass (T): BaseClass Not sure which line you want me to change. I don't want SomeClass to inherit from BaseClass. Rather, I want T to be restricted to classes that inherit from BaseClass. When I change `class SomeClass(T : BaseClass)` to `class SomeClass(T) : BaseClass` I still get

Re: std.algorithm.map with multiple lambdas (2.066.0-b1) (does not compile)

2014-07-05 Thread via Digitalmars-d-learn
This is an instance of these bugs: https://issues.dlang.org/show_bug.cgi?id=5710 https://issues.dlang.org/show_bug.cgi?id=11946 But seeing that `map` works with a single lambda/local function, it should be possible to make it work with several ones too. For the time being, a simple

Re: What exactly module in D means?

2014-07-05 Thread Francesco Cattoglio via Digitalmars-d-learn
On Saturday, 5 July 2014 at 17:08:01 UTC, Olivier Pisano wrote: No, import is different from include. It does not stupidly copy and paste its content but tells the compiler to take the module into account for name resolution. The result may seem similar, but is much more efficient. In fact,

Re: Trouble initializing a templated class

2014-07-05 Thread quakkels via Digitalmars-d-learn
ah, sorry, I misunderstood. It looks like you need to change the lin auto sc = new SomeClass (); to auto sc = new SomeClass!BaseClass (); The compiler complains because SomeClass is a template when you call SomeClass() without !() template parameters. It only becomes a type once

File needs to be closed on Windows but not on Posix, bug?

2014-07-05 Thread Joakim via Digitalmars-d-learn
I ran into this when trying to fix the Phobos unit tests and have reduced it down to this test file: import std.stdio, std.file; void main() { auto f = File(test.txt, w); //f.close(); std.file.remove(test.txt); } This compiles and runs fine on linux and the autotester shows that

Re: What exactly module in D means?

2014-07-05 Thread Joakim via Digitalmars-d-learn
On Saturday, 5 July 2014 at 16:35:31 UTC, Andre Tampubolon wrote: I've been reading the newsgroup for a while, and it seems that one of the reason folks like D is because it supports module. My question is: what does module mean? A quick google pointed my this page:

Re: File needs to be closed on Windows but not on Posix, bug?

2014-07-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 5 July 2014 at 20:23:03 UTC, Joakim wrote: This seems like inconsistent behavior: should I file a bug? This is because the operating systems do it differently; I think D is doing the right thing by being a pretty thin wrapper around that functionality. If anything, I'd just

Re: std.algorithm.map with multiple lambdas (2.066.0-b1) (does not compile)

2014-07-05 Thread klasbo via Digitalmars-d-learn
On Saturday, 5 July 2014 at 19:31:24 UTC, Marc Schütz wrote: This is an instance of these bugs: https://issues.dlang.org/show_bug.cgi?id=5710 https://issues.dlang.org/show_bug.cgi?id=11946 But seeing that `map` works with a single lambda/local function, it should be possible to make it work

Re: implib and system dlls, oh my

2014-07-05 Thread Joakim via Digitalmars-d-learn
On Tuesday, 24 June 2014 at 12:56:28 UTC, Jason King wrote: I don't know enough about implib to explain it. But another method that I believe should work is to use linker definition files. It'll allow optlink to work. Just add it to dmd, actually I believe it needs to be passed to Optlink

Compile time definitions

2014-07-05 Thread Brenton via Digitalmars-d-learn
Is there a way to define a compile time constant/enum with dmd? For example, inserting the svn revision number into my code? In C... #include stdio.h #ifndef SOMETHING #define SOMETHING bar #endif int main() { printf(hello world: SOMETHING \n); return 0; } gcc main.c

Re: Compile time definitions

2014-07-05 Thread bearophile via Digitalmars-d-learn
Brenton: How would you recommend I do something like this with D? In D compile-time constants are introduced using the enum keyword. You can also use the -version=... compiler switch to compile your D code according to some version, that can be a number or identifier. In D there isn't

Re: Using a delegate when interfacing with C

2014-07-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 5 July 2014 at 22:18:56 UTC, Marco Cosentino wrote: auto client = *(cast(ClientImplementation*) data); Try just auto client = cast(ClientImplementation) data; and this.setProcessCallback(callback, cast(void *) this); setProcessCallback(callback, cast(void*) this);

Re: Using a delegate when interfacing with C

2014-07-05 Thread Marco Cosentino via Digitalmars-d-learn
On Saturday, 5 July 2014 at 22:28:48 UTC, Adam D. Ruppe wrote: In general, remember any class reference in D is already equivalent to a pointer in C or C++ and can be casted straight to void* without needing to take its address. Thanks Adam, you're a life saver ;). It works like a charme.

Re: Compile time definitions

2014-07-05 Thread Brenton via Digitalmars-d-learn
On Saturday, 5 July 2014 at 22:08:52 UTC, bearophile wrote: Brenton: How would you recommend I do something like this with D? In D compile-time constants are introduced using the enum keyword. You can also use the -version=... compiler switch to compile your D code according to some

Re: How to test templates for equality?

2014-07-05 Thread Uranuz via Digitalmars-d-learn
I have another question about testing if given symbol is instance of the given template and geting it's template arguments. I'm talking about raw template symbols, but not struct or class templates. For case with struct or class template std.traits.isInstanceOf is working well. But using *raw*

Re: How to test templates for equality?

2014-07-05 Thread Uranuz via Digitalmars-d-learn
Suddenly posted. I don't know why it's happened)) template isMyInstanceOf(alias Templ, alias Inst) { alias Args = ???; //I don't have idea how to get it enum bool isMyInstanceOf = __traits(isSame, Templ!(Args), Inst); } Do you have any idea how to solve this? May be standad library