Function definition in multiple modules

2012-03-29 Thread Martin Drasar
Hi, I have a class that implements a lot of interfaces and I would like to separate the definition into different files, i.e. implementation of one interface in one file. Something akin to this C++ code: a.cpp: class A { void b(); void c(); }; b.cpp: void A::b() {} c.cpp: void A::c() {}

Re: Installing Modules

2012-03-29 Thread Johannes Pfau
Am Thu, 29 Mar 2012 06:15:07 +0200 schrieb TJB broug...@gmail.com: Thank you for your patience with me. I now have the following simple test code: import scid.matrix; void main() {} Then I run and get the following error: $ dmd -I/usr/local/src main.d The command Jesse posted

Re: Does D have a Verbatim String Literal?

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 11:15:21 +0200, Bennie Copeland mugen.kano...@gmail.com wrote: For example in C# I can write @Hello \t World; and it will print Hello \t World exactly without requiring me to escape the \t. Does D have a similar feature? There are two ways: import std.stdio; void

Re: Function definition in multiple modules

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 10:33:03 +0200, Martin Drasar dra...@ics.muni.cz wrote: Hi, I have a class that implements a lot of interfaces and I would like to separate the definition into different files, i.e. implementation of one interface in one file. Something akin to this C++ code: a.cpp:

Does D have a Verbatim String Literal?

2012-03-29 Thread Bennie Copeland
For example in C# I can write @Hello \t World; and it will print Hello \t World exactly without requiring me to escape the \t. Does D have a similar feature?

Re: Function definition in multiple modules

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 11:31:57 +0200, Martin Drasar dra...@ics.muni.cz wrote: On 29.3.2012 11:16, simendsjo wrote: D has interface files, .di. These can be automatically generated by the compiler using the -H switch. (snip) I would like to split the X class definition into two files. One

Re: Does D have a Verbatim String Literal?

2012-03-29 Thread Bennie Copeland
On Thursday, 29 March 2012 at 09:18:38 UTC, simendsjo wrote: On Thu, 29 Mar 2012 11:15:21 +0200, Bennie Copeland mugen.kano...@gmail.com wrote: For example in C# I can write @Hello \t World; and it will print Hello \t World exactly without requiring me to escape the \t. Does D have a similar

Re: Function definition in multiple modules

2012-03-29 Thread Martin Drasar
On 29.3.2012 12:02, simendsjo wrote: Your looking for partial classes? D doesn't have this as far as I know. alias this should work for more than one value in the future, and then (I think) you should be able to do something like this: class XIB : IB {} class XIA : IA {} class X : IA, IB

Re: Function definition in multiple modules

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 12:58:56 +0200, Martin Drasar dra...@ics.muni.cz wrote: On 29.3.2012 12:02, simendsjo wrote: Your looking for partial classes? D doesn't have this as far as I know. alias this should work for more than one value in the future, and then (I think) you should be able to do

Re: Function definition in multiple modules

2012-03-29 Thread Martin Drasar
On 29.3.2012 13:05, simendsjo wrote: It's not string mixins: mixin template XIA() { void a() { ... } // regular function } class X : IA { mixin XIA!() } XIA is injected into X, so X now looks like class X : IA { void a() { ... } } I should have thought and experiment more

Re: GC collecting too much..

2012-03-29 Thread simendsjo
On Mon, 26 Mar 2012 20:15:40 +0200, simendsjo simend...@gmail.com wrote: On Mon, 26 Mar 2012 17:10:34 +0200, Timon Gehr timon.g...@gmx.ch wrote: On 03/26/2012 11:55 AM, simendsjo wrote: It seems threads created in the c library is totally unknown to D. How can I make D aware of these threads

don't know how to make 'src\unittest.d' error while rebuilding Phobos

2012-03-29 Thread Gleb
Hi folks! I'm trying to recompile Phobos to work with curl under Win7 as described here: digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.Darticle_id=161483 As far as I understand, I need to build druntime before building phobos, because phobos depends on druntime's libraries.

Re: GC collecting too much..

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 14:14:10 +0200, simendsjo simend...@gmail.com wrote: On Mon, 26 Mar 2012 20:15:40 +0200, simendsjo simend...@gmail.com wrote: On Mon, 26 Mar 2012 17:10:34 +0200, Timon Gehr timon.g...@gmx.ch wrote: On 03/26/2012 11:55 AM, simendsjo wrote: It seems threads created in

Re: don't know how to make 'src\unittest.d' error while rebuilding Phobos

2012-03-29 Thread Dmitry Olshansky
On 29.03.2012 17:51, Gleb wrote: Hi folks! I'm trying to recompile Phobos to work with curl under Win7 as described here: digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.Darticle_id=161483 As far as I understand, I need to build druntime before building phobos, because phobos

Stack traces in 2.059HEAD?

2012-03-29 Thread simendsjo
My stacktraces have changed a bit... t.d: vaid main() { assert(false); } 2.058: core.exception.AssertError@t(2): Assertion failure t(_d_assertm+0x2a) [0x4144be] t() [0x414492] t(_Dmain+0xe) [0x414476] t(extern (C) int rt.dmain2.main(int, char**).void runMain()+0x17)

Re: Printing stacktrace on segfault

2012-03-29 Thread simendsjo
On Tue, 27 Mar 2012 16:30:01 +0200, David d...@dav1d.de wrote: Am 27.03.2012 12:04, schrieb simendsjo: Is there a way to print a stacktrace on segfaults on linux? I haven't found one, but you can use gdb, the only thing you've to do is to compile with -g and -gc (or you use gdc) Thanks.

Re: Installing Modules

2012-03-29 Thread Jesse Phillips
On Thursday, 29 March 2012 at 08:55:41 UTC, Johannes Pfau wrote: The command Jesse posted is missing a -L-lscid and you'll probably also need -L-L/usr/local/lib So the complete command should be: Ah, you are right, though I selected /usr/local/lib as it is already part of LD's search path.

Re: don't know how to make 'src\unittest.d' error while rebuilding Phobos

2012-03-29 Thread Gleb
Dmitry, thank you for your answer! On Thursday, 29 March 2012 at 13:57:05 UTC, Dmitry Olshansky wrote: This should work: make -f win32.mak I've already gave this a try. I managed to get phobos built without unittests but I can't built my program with new phobos.lib. An error message is as

Re: don't know how to make 'src\unittest.d' error while rebuilding Phobos

2012-03-29 Thread Jesse Phillips
On Thursday, 29 March 2012 at 16:51:24 UTC, Gleb wrote: OPTLINK (R) for Win32 Release 8.00.12 Copyright (C) Digital Mars 1989-2010 All rights reserved. http://www.digitalmars.com/ctg/optlink.html D:\UserFiles\D\dmd2\windows\bin\..\lib\phobos.lib(file) Error 42: Symbol Undefined

Re: std.conv length=0

2012-03-29 Thread Jesse Phillips
On Thursday, 29 March 2012 at 04:25:54 UTC, James Miller wrote: I find the distaste of reviving a thread strange. It would be like removing the reopened feature of bug tracking software (who wants to transpose all that information). I have no problem with it, if I did, I would have said so.

Re: don't know how to make 'src\unittest.d' error while rebuilding Phobos

2012-03-29 Thread Dmitry Olshansky
On 29.03.2012 20:51, Gleb wrote: Dmitry, thank you for your answer! On Thursday, 29 March 2012 at 13:57:05 UTC, Dmitry Olshansky wrote: This should work: make -f win32.mak I've already gave this a try. I managed to get phobos built without unittests but I can't built my program with new

Re: don't know how to make 'src\unittest.d' error while rebuilding Phobos

2012-03-29 Thread Gleb
Thank you for the answers. Unfortunately, the program compiles correctly with the original phobos.lib in dmd2\windows\lib, but does not compile with the new one in the same directory.

Problem interacting with the console

2012-03-29 Thread Jacob Carlborg
I'm trying to port a C application to D. The problem I have is interacting with the console. I'm using the POSIX read function, the problem is that in the D version the read function seems to never return. The C version works fine and prints ** after I press a key. I've created a small

Where does U in Rebindable.Rebindable come from?

2012-03-29 Thread simendsjo
If you look at the struct, it uses the type U in, among others, the union. The only place I could see U referenced is in the first static if, but I cannot recreate this behavior: void main() { static if(is(int X == const(U), U)) { } else { static

Re: Where does U in Rebindable.Rebindable come from?

2012-03-29 Thread Tove
On Thursday, 29 March 2012 at 20:15:43 UTC, simendsjo wrote: If you look at the struct, it uses the type U in, among others, the union. The only place I could see U referenced is in the first static if, but I cannot recreate this behavior: void main() { static if(is(int X == const(U),

Re: Where does U in Rebindable.Rebindable come from?

2012-03-29 Thread Ali Çehreli
On 03/29/2012 01:51 PM, Tove wrote: On Thursday, 29 March 2012 at 20:15:43 UTC, simendsjo wrote: If you look at the struct, it uses the type U in, among others, the union. The only place I could see U referenced is in the first static if, but I cannot recreate this behavior: void main() {

Re: Where does U in Rebindable.Rebindable come from?

2012-03-29 Thread Simen Kjærås
On Thu, 29 Mar 2012 22:15:41 +0200, simendsjo simend...@gmail.com wrote: If you look at the struct, it uses the type U in, among others, the union. The only place I could see U referenced is in the first static if, but I cannot recreate this behavior: void main() { static if(is(int X

Re: Installing Modules

2012-03-29 Thread TJB
On Thursday, 29 March 2012 at 15:15:35 UTC, Jesse Phillips wrote: On Thursday, 29 March 2012 at 08:55:41 UTC, Johannes Pfau wrote: The command Jesse posted is missing a -L-lscid and you'll probably also need -L-L/usr/local/lib So the complete command should be: Ah, you are right, though I

Compiling DMD's source code in Mac OSX

2012-03-29 Thread Ary Manzana
Hi, Does anyone have a build script or something similar for compiling DMD under Mac? I cloned the repo but all I can see is a win32.mak file. I renamed it to Makefile and tried make but no luck. I don't have much experience with make or makefiles. Thanks, Ary

Re: Compiling DMD's source code in Mac OSX

2012-03-29 Thread Jonathan M Davis
On Friday, March 30, 2012 09:15:11 Ary Manzana wrote: Hi, Does anyone have a build script or something similar for compiling DMD under Mac? I cloned the repo but all I can see is a win32.mak file. I renamed it to Makefile and tried make but no luck. I don't have much experience with make