VisualD solution configuration

2012-12-02 Thread Zhenya
Hi! I'm sorry,maybe it is a little bit stupid question,but how to configure VisualD project to get it compile not only main.d but all files in project?

default implemented opAssign purity

2012-12-02 Thread Dan
Is the default implemented opAssign really pure and therefore should be considered such. The code below works. If you turn off the static if, it will fail with: Error: pure function 'opAssign.foo' cannot call impure function 'opAssign.S.opAssign'. Also, in case the answer is no and

Re: get address of object if opCast is overridden

2012-12-02 Thread js.mdnq
On Saturday, 1 December 2012 at 23:57:27 UTC, Artur Skawina wrote: On 12/01/12 20:26, Jonathan M Davis wrote: On Saturday, December 01, 2012 18:43:22 Timon Gehr wrote: On 12/01/2012 06:23 PM, Jonathan M Davis wrote: On Saturday, December 01, 2012 12:05:49 Artur Skawina wrote: So, unless

Re: get address of object if opCast is overridden

2012-12-02 Thread Artur Skawina
On 12/02/12 14:25, js.mdnq wrote: On Saturday, 1 December 2012 at 23:57:27 UTC, Artur Skawina wrote: On 12/01/12 20:26, Jonathan M Davis wrote: On Saturday, December 01, 2012 18:43:22 Timon Gehr wrote: On 12/01/2012 06:23 PM, Jonathan M Davis wrote: On Saturday, December 01, 2012 12:05:49

Re: default implemented opAssign purity

2012-12-02 Thread Maxim Fomin
On Sunday, 2 December 2012 at 13:07:42 UTC, Dan wrote: Is the default implemented opAssign really pure and therefore should be considered such. The code below works. If you turn off the static if, it will fail with: Error: pure function 'opAssign.foo' cannot call impure function

Re: VisualD solution configuration

2012-12-02 Thread Lubos Pintes
Not sure if I understand what you ask here, but you probably need to add all files you want to compile to the project. Thus not only the main.d, but all modules. Dňa 2. 12. 2012 11:56 Zhenya wrote / napísal(a): Hi! I'm sorry,maybe it is a little bit stupid question,but how to configure

Initialize multi dimensional associative dynamic array

2012-12-02 Thread js.mdnq
How does one initialize an array defined as A[B][C] arr; dynamically? (A,B,C are types, for example, int[int][string]) I want to store an array, indexed by strings, of ints, indexed by ints. For example, What I want is a hash map that maps integers to integers so I can do something like

Re: VisualD solution configuration

2012-12-02 Thread Zhenya
On Sunday, 2 December 2012 at 14:52:24 UTC, Lubos Pintes wrote: Not sure if I understand what you ask here, but you probably need to add all files you want to compile to the project. Thus not only the main.d, but all modules. Dňa 2. 12. 2012 11:56 Zhenya wrote / napísal(a): Hi! I'm

Re: VisualD solution configuration

2012-12-02 Thread Zhenya
On Sunday, 2 December 2012 at 14:58:24 UTC, Zhenya wrote: On Sunday, 2 December 2012 at 14:52:24 UTC, Lubos Pintes wrote: Not sure if I understand what you ask here, but you probably need to add all files you want to compile to the project. Thus not only the main.d, but all modules. Dňa 2.

Re: VisualD solution configuration

2012-12-02 Thread Zhenya
On Sunday, 2 December 2012 at 15:03:26 UTC, Zhenya wrote: On Sunday, 2 December 2012 at 14:58:24 UTC, Zhenya wrote: On Sunday, 2 December 2012 at 14:52:24 UTC, Lubos Pintes wrote: Not sure if I understand what you ask here, but you probably need to add all files you want to compile to the

Aliases to mutable thread-local data not allowed when using spawn()

2012-12-02 Thread D_Beginner
Hi there, I'm quite new do D, but from what I've seen so far, I really like it. I tried to implement a very basic chatclient that I've written in Go before, and put the logics to send messages in a send() function, looking like this: void send(TcpSocket sock) { while(true) {

Re: default implemented opAssign purity

2012-12-02 Thread Dan
On Sunday, 2 December 2012 at 14:13:34 UTC, Maxim Fomin wrote: On Sunday, 2 December 2012 at 13:07:42 UTC, Dan wrote: Default opAssign function is described here: http://dlang.org/struct.html. It calls dtor and postblit (if any) which are impure. Even if you mark them pure, you still

Re: Initialize multi dimensional associative dynamic array

2012-12-02 Thread bearophile
js.mdnq: myval1 = arr[Group1][3243]; // has O(1) lookup myval2 = arr[Group2][3243]; // has O(1) lookup Another option is to use an associative array where the keys are Tuple!(string, int): alias Tuple!(string, int) Tkey; int[Tkey] arr; myval1 = arr[Tkey(Group1, 3243)]; myval2 =

Re: Initialize multi dimensional associative dynamic array

2012-12-02 Thread bearophile
(Maybe this will arrive duplicated, thanks to the forum software) js.mdnq: myval1 = arr[Group1][3243]; // has O(1) lookup myval2 = arr[Group2][3243]; // has O(1) lookup Another option is to use an associative array where the keys are Tuple!(string, int): alias Tuple!(string, int) Tkey;

Re: Aliases to mutable thread-local data not allowed when using spawn()

2012-12-02 Thread D_Beginner
On Sunday, 2 December 2012 at 15:47:36 UTC, D_Beginner wrote: Hi there, I'm quite new do D, but from what I've seen so far, I really like it. I tried to implement a very basic chatclient that I've written in Go before, and put the logics to send messages in a send() function, looking like

Re: Aliases to mutable thread-local data not allowed when using spawn()

2012-12-02 Thread Jonathan M Davis
On Sunday, December 02, 2012 16:47:35 D_Beginner wrote: Hi there, I'm quite new do D, but from what I've seen so far, I really like it. I tried to implement a very basic chatclient that I've written in Go before, and put the logics to send messages in a send() function, looking like

Re: default implemented opAssign purity

2012-12-02 Thread Ali Çehreli
On 12/02/2012 07:50 AM, Dan wrote: On Sunday, 2 December 2012 at 14:13:34 UTC, Maxim Fomin wrote: Are you looking for this http://dpaste.dzfl.pl/7ee27db2 ? I did not know you could call __postblit - that's cool. I did not know either. :) I was going to ask Is __postblit a part of the

Re: Initialize multi dimensional associative dynamic array

2012-12-02 Thread Ali Çehreli
On 12/02/2012 11:27 AM, Ali Çehreli wrote: int[int][string] arr; arr[hello] = [ 1 : 100, 2 : 200 ]; Of course, more dynamically: int[int][string] arr; int[int] a; a[1] = 100; a[2] = 200; arr[hello] = a; Ali

Re: default implemented opAssign purity

2012-12-02 Thread Jonathan M Davis
On Sunday, December 02, 2012 11:12:45 Ali Çehreli wrote: On 12/02/2012 07:50 AM, Dan wrote: On Sunday, 2 December 2012 at 14:13:34 UTC, Maxim Fomin wrote: Are you looking for this http://dpaste.dzfl.pl/7ee27db2 ? I did not know you could call __postblit - that's cool. I did not

Re: VisualD solution configuration

2012-12-02 Thread Regan Heath
On Sun, 02 Dec 2012 15:08:51 -, Zhenya zh...@list.ru wrote: On Sunday, 2 December 2012 at 15:03:26 UTC, Zhenya wrote: On Sunday, 2 December 2012 at 14:58:24 UTC, Zhenya wrote: On Sunday, 2 December 2012 at 14:52:24 UTC, Lubos Pintes wrote: Not sure if I understand what you ask here, but

Re: VisualD solution configuration

2012-12-02 Thread Zhenya
On Sunday, 2 December 2012 at 20:12:08 UTC, Regan Heath wrote: On Sun, 02 Dec 2012 15:08:51 -, Zhenya zh...@list.ru wrote: On Sunday, 2 December 2012 at 15:03:26 UTC, Zhenya wrote: On Sunday, 2 December 2012 at 14:58:24 UTC, Zhenya wrote: On Sunday, 2 December 2012 at 14:52:24 UTC, Lubos

Re: default implemented opAssign purity

2012-12-02 Thread Dan
On Sunday, 2 December 2012 at 19:12:46 UTC, Ali Çehreli wrote: On 12/02/2012 07:50 AM, Dan wrote: I was going to ask Is __postblit a part of the language spec but then I found TypeInfo.postblit: http://dlang.org/phobos/object.html#postblit I hoped the following might work:

Re: default implemented opAssign purity

2012-12-02 Thread Dan
On Sunday, 2 December 2012 at 19:34:46 UTC, Jonathan M Davis wrote: Pretty much none of the built-in stuff like that is pure or nothrow right now. It needs to be fixed. Maybe I'm naive, but problems with lax specification of pure, const and immutable should be low hanging fruit - relatively

Re: default implemented opAssign purity

2012-12-02 Thread Jonathan M Davis
On Sunday, December 02, 2012 23:04:29 Dan wrote: On Sunday, 2 December 2012 at 19:34:46 UTC, Jonathan M Davis wrote: Pretty much none of the built-in stuff like that is pure or nothrow right now. It needs to be fixed. Maybe I'm naive, but problems with lax specification of pure,

Re: default implemented opAssign purity

2012-12-02 Thread Dan
On Sunday, 2 December 2012 at 22:19:18 UTC, Jonathan M Davis wrote: On Sunday, December 02, 2012 23:04:29 Dan wrote: What about the specification is lax? pure, const, and immutable are quite well defined. Sorry - by specification I was not thinking D Language Specification but more API or

Re: DLL Injection

2012-12-02 Thread s0beit
On Sunday, 2 December 2012 at 22:30:56 UTC, maarten van damme wrote: Thanks, interesting blog :) 2012/12/2 s0beit s0b...@myg0t.com: Alright, I was finally able to give it a try: http://s0beit.me/d/d-module-injector/ I released the source code as well as the binary here if anyone wants to