Re: rdmd only works with files in current directory on Windows?

2010-08-15 Thread Lars T. Kyllingstad
On Sat, 14 Aug 2010 14:58:05 +0200, simendsjo wrote: c:\temp\src\test.d c:\temprdmd src\test The system cannot find the path specified. c:\temprdmd src/test std.file.FileException: (...)\.rdmd\rdmd-src/test.d-(...): The system cannot find the path specified. Using rdmd 20090902, dmd

Re: __gshared on structs

2010-08-15 Thread Simen kjaeraas
Trass3r u...@known.com wrote: I don't think that this syntax is supported at all. You need to use __gshared with the instance instead: __gshared foo f; Hence my asking 'Why is this not an error?'. However, shared struct foo {} works, so one might expect symmetry to dictate that __gshared

shared libraries in linux

2010-08-15 Thread g g
I have successfully made funtions and structs in shared libraries in linux with dmd, but i have no idea how to do that with classes, and how call the static this() funtion of the linked module, because variables ( even immutable ) are not correctly set without calling it. Thanks. gzkp0s

Compiler bug? Functions as Array Properties doesn't work with nested functions

2010-08-15 Thread simendsjo
The spec doesn't mention anything about nested functions here. This works void foo(int[] a, int x) { }; void main() { int[] array; foo(array, 3); array.foo(3); } But this gives undefined identifier module t.foo void main() { void foo(int[] a, int x) { };

std.range design part of the language..?

2010-08-15 Thread simendsjo
From http://digitalmars.com/d/2.0/statement.html#ForeachStatement, Foreach over Structs and Classes with Ranges. I read this as the Range design is a part of the language now. Is this correct? And is the spec a bit out of date in the examples? It says foreach-/reverse translates to for(

Re: shared libraries in linux

2010-08-15 Thread Jonathan M Davis
On Sunday 15 August 2010 09:40:53 g g wrote: I have successfully made funtions and structs in shared libraries in linux with dmd, but i have no idea how to do that with classes, and how call the static this() funtion of the linked module, because variables ( even immutable ) are not correctly

Re: std.range design part of the language..?

2010-08-15 Thread Jonathan M Davis
On Sunday 15 August 2010 10:12:06 simendsjo wrote: From http://digitalmars.com/d/2.0/statement.html#ForeachStatement, Foreach over Structs and Classes with Ranges. I read this as the Range design is a part of the language now. Is this correct? And is the spec a bit out of date in the

Re: Unit tests and verifying pre/post-conditions and invariants

2010-08-15 Thread Lutger
Jonathan M Davis wrote: Is there a standard and/or acceptable way to make sure that pre-conditions, post-conditions, or invariants _fail_ when running unit tests? That is, lets say I had a function like this void func(int x) in { assert(x 8); } body { //... } and I

Re: std.range design part of the language..?

2010-08-15 Thread simendsjo
On 15.08.2010 23:58, Jonathan M Davis wrote: On Sunday 15 August 2010 10:12:06 simendsjo wrote: From http://digitalmars.com/d/2.0/statement.html#ForeachStatement, Foreach over Structs and Classes with Ranges. I read this as the Range design is a part of the language now. Is this correct?

Template with equivalent function names

2010-08-15 Thread Andrej Mitrovic
This isn't a question but more of an observation. Here's an interesting template from the docs: template Foo(T, R...) { void Foo(T t, R r) { writeln(t); static if (r.length)// if more arguments Foo(r); // do the rest of the arguments } }

Re: Template with equivalent function names

2010-08-15 Thread Jonathan M Davis
On Sunday 15 August 2010 20:18:27 Andrej Mitrovic wrote: This isn't a question but more of an observation. Here's an interesting template from the docs: template Foo(T, R...) { void Foo(T t, R r) { writeln(t); static if (r.length)// if more arguments