Re: this pointer

2009-10-21 Thread Zarathustra
Steven Schveighoffer Wrote: On Wed, 21 Oct 2009 16:53:20 -0400, Zarathustra adam.chrapkow...@gmail.com wrote: Why value of pointer to this is different in global function, member function and constructor?

Re: amazing function behavior

2009-10-21 Thread Zarathustra
I resolved my access violation problem by including at the begin of wndProc inside Window class, the following code: // private dword wndProc(ptr o_hwnd, dword o_msg, ... { asm{ push 0x; push [o_hwnd]; call

Re: D and Python Interop

2009-10-21 Thread Steven Schveighoffer
On Wed, 21 Oct 2009 21:22:35 -0400, Sam Hu samhudotsa...@gmail.com wrote: Is there any implementation that D can interop with Python? Regards, Sam pyd? http://dsource.org/projects/pyd -Steve

Error: 4invalid UTF-8 sequence :: How can I catch this?? (or otherwise handle it)

2009-10-21 Thread Charles Hixson
I want to read a bunch of files, and if the aren't UTF, then I want to list their names for conversion, or other processing. How should this be handled?? try..catch..finally blocks just ignore this error.

Re: AA.remove in foreach AA = new vs cleaning

2009-10-21 Thread Steven Schveighoffer
On Wed, 21 Oct 2009 23:06:47 -0400, Saaa em...@needmail.com wrote: Is there anything with removing the current key in a foreach? foreach (K k, ; aa) { .. aa.remove(k); } Yes, behavior is undefined. from http://digitalmars.com/d/2.0/statement.html#ForeachStatement : The aggregate must

Re: AA.remove in foreach AA = new vs cleaning

2009-10-21 Thread Saaa
Steven Schveighoffer wrote: Yes, behavior is undefined. from http://digitalmars.com/d/2.0/statement.html#ForeachStatement : The aggregate must be loop invariant, meaning that elements to the aggregate cannot be added or removed from it in the [loop body] I suspect removing the current key

Re: AA.remove in foreach AA = new vs cleaning

2009-10-21 Thread Steven Schveighoffer
On Thu, 22 Oct 2009 00:45:36 -0400, Saaa em...@needmail.com wrote: Steven Schveighoffer wrote: Yes, behavior is undefined. from http://digitalmars.com/d/2.0/statement.html#ForeachStatement : The aggregate must be loop invariant, meaning that elements to the aggregate cannot be added or

Re: Error: 4invalid UTF-8 sequence :: How can I catch this?? (or otherwise handle it)

2009-10-21 Thread Charles Hixson
Daniel Keep wrote: Charles Hixson wrote: I want to read a bunch of files, and if the aren't UTF, then I want to list their names for conversion, or other processing. How should this be handled?? try..catch..finally blocks just ignore this error. type stuff.d import std.stdio; import