Re: Assigning Interface to Object

2011-01-15 Thread Christopher Nicholson-Sauls
On 01/15/11 10:34, Simen kjaeraas wrote: > Mandeep Singh Brar wrote: > >> Hi, >> >> I am not able to assign an interface to object. The following code >> does not compile. >> >> module testObj; >> >> public interface testInterface { >> void someMethod(); >> } >> public class testObj >> { >>

Re: __traits(getMember, ...) on instance member

2011-01-15 Thread %u
Sorry, I just noticed a typo. The line saying pragma(msg, __traits(getMember, S, m)); should've said: pragma(msg, __traits(getMember, S, "m"));

__traits(getMember, ...) on instance member

2011-01-15 Thread %u
Hi, Something has been confusing me, regarding passing around aliases of instance members. If I can say: struct S { int m; } pragma(msg, (S).m); How come I can't say: struct S { int m; } pragma(msg, __traits(getMember, S, m)); ? What's the difference, and what does each one mean? (I'

Re: std.container.Array/RefCounted(T) leaking memory?

2011-01-15 Thread Jonathan M Davis
On Saturday 15 January 2011 20:27:26 %u wrote: > > Tracking memory in a modern OS is not easy, and this is probably why no > > one > > wanted to make a statement on what was really happening. > > The issue is that the memory *is* leaking -- it's because the struct > destructor is simply not getti

Re: std.container.Array/RefCounted(T) leaking memory?

2011-01-15 Thread %u
> Tracking memory in a modern OS is not easy, and this is probably why no one wanted to make a statement on what was really happening. The issue is that the memory *is* leaking -- it's because the struct destructor is simply not getting called. If I call free() manually, the memory usage decrease

Re: Assigning Interface to Object

2011-01-15 Thread Stewart Gordon
On 15/01/2011 17:44, Steven Schveighoffer wrote: Which unnecessarily complicates things. For example, you can't compare two interfaces (try it!). ?

Re: (coff)-Implib lib from dll

2011-01-15 Thread Nrgyzer
This solved the problems, thanks - but, when the line "mysql = mysql_init(null);" produces an access violation.

Re: (coff)-Implib lib from dll

2011-01-15 Thread Jimmy Cao
Try this: implib /s libmysql.lib libmysql.dll Then change extern(Windows) to extern(C). (That's how I usually have it set up)

Re: Assigning Interface to Object

2011-01-15 Thread Steven Schveighoffer
On Sat, 15 Jan 2011 11:34:05 -0500, Simen kjaeraas wrote: Mandeep Singh Brar wrote: Hi, I am not able to assign an interface to object. The following code does not compile. module testObj; public interface testInterface { void someMethod(); } public class testObj { Objec

Re: (coff)-Implib lib from dll

2011-01-15 Thread Nrgyzer
Thanks, but didn't help to change to "implib /system libmysql.lib libmysql.dll" - some errors.

Re: (coff)-Implib lib from dll

2011-01-15 Thread Mafi
Am 15.01.2011 17:46, schrieb nrgyzer: I just used "implib libmysql.lib libmysql.dll /system" but it produces the same errors. In the implib help it says: "implib [switches] libfile [ dllfile | deffile ]" I'm not sure but implib could be picky about where the switches are. Mafi

Re: (coff)-Implib lib from dll

2011-01-15 Thread nrgyzer
I just used "implib libmysql.lib libmysql.dll /system" but it produces the same errors.

Re: Assigning Interface to Object

2011-01-15 Thread Simen kjaeraas
Trass3r wrote: module testObj; public interface testInterface { void someMethod(); } public class testObj { Object someCaller; this(Object caller) { someCaller = caller; } this(testInterface tI, bool xyz) { someCaller = tI

Re: (coff)-Implib lib from dll

2011-01-15 Thread Mafi
Am 15.01.2011 17:07, schrieb %u: Hey guys, I'm trying to connect to my mysql-server on windows. I'm using the mysql binding from http://www.steinmole.de/d/ because as I know the DDBI project doesn't support D2. I followed the instructions on the site and first created the lib file with implib

Re: Assigning Interface to Object

2011-01-15 Thread Simen kjaeraas
Mandeep Singh Brar wrote: Hi, I am not able to assign an interface to object. The following code does not compile. module testObj; public interface testInterface { void someMethod(); } public class testObj { Object someCaller; this(Object caller) { som

(coff)-Implib lib from dll

2011-01-15 Thread %u
Hey guys, I'm trying to connect to my mysql-server on windows. I'm using the mysql binding from http://www.steinmole.de/d/ because as I know the DDBI project doesn't support D2. I followed the instructions on the site and first created the lib file with implib with the following command: "implib

Re: Assigning Interface to Object

2011-01-15 Thread Mandeep Singh Brar
But it is for only storage purposes. I can cast it back to the Interface later when required. Thanks Mandeep

Re: Assigning Interface to Object

2011-01-15 Thread Trass3r
module testObj; public interface testInterface { void someMethod(); } public class testObj { Object someCaller; this(Object caller) { someCaller = caller; } this(testInterface tI, bool xyz) { someCaller = tI; } } Sho

Re: How to get 'import' clauses from d file?

2011-01-15 Thread Trass3r
I'm trying to make some home-grown d build system, but and one of my tasks is to get module dependencies. Yes, I know about -deps DMD switch, but it works when all needed modules are given to compiler. But if some dependencies absent compiler just aborts with error "module foo is in file "foo