Cryptic Error message with scope(failure) and AA

2013-06-29 Thread Anthony Goins
Is this known? I've heard there are many problems with associative arrays. dmd 2.063 --- module scopefailtest; int[char] AAarray; void main(string[] args) { AAarray = ['a':1, 'b':2, 'c':3]; foreach(aa; AAarray) { scope(failure)continue; aa = 32; } } ---

Re: Cryptic Error message with scope(failure) and AA

2013-06-29 Thread Anthony Goins
Seems like there are several levels of "wrong" actually: What do you expect "scope(failure)continue" to do exactly? I was reading an array of files (Document[string]). Stuck the scope(failure)continue in late at night apparently to skip reading files that no longer exist. Forgot about it

Re: Windows parameter

2013-06-30 Thread Anthony Goins
On Sunday, 30 June 2013 at 19:03:13 UTC, shuji wrote: this code is in a .cpp file //funcs.lib //windows includes... HWND hwnd; int setHWND(HWND extHwnd){ hwnd = extHwnd; return 0; } So im trying to import from D like this. I dont think I can implement this line in C++ extern (C

Re: Handling different types gracefully

2013-07-01 Thread Anthony Goins
On Monday, 1 July 2013 at 12:03:25 UTC, Roderick Gibson wrote: I'm asking because I'm doing some game development in D and I've come upon the entity component architecture, and it looks like a good way to handle the complexity and interdependency that games seem to have. The components wind u

Re: interacting with a process with redirected stdin/stdout/stderr

2013-07-16 Thread Anthony Goins
On Monday, 15 July 2013 at 06:46:52 UTC, timotheecour wrote: On Monday, 15 July 2013 at 03:49:10 UTC, Timothee Cour wrote: I'm trying to interact with a process using std.process and redirected stdin/stdout/stderr. What would be the recommended way? For example: auto pipes=pipeShell("mypro

Re: Linux Dynamic Loading of shared libraries

2014-03-09 Thread Anthony Goins
On Sunday, 9 March 2014 at 12:07:22 UTC, Steve Teale wrote: Martin Nowak's Gihub druntime Page has module main; import core.runtime, core.thread; void main() { auto lib = Runtime.loadLibrary("./liba.so"); auto thr = new Thread({ auto lib = Runtime.loadLibrary("./liba.so");

Re: Linux Dynamic Loading of shared libraries

2014-03-10 Thread Anthony Goins
On Monday, 10 March 2014 at 06:38:35 UTC, Steve Teale wrote: On Sunday, 9 March 2014 at 14:09:28 UTC, Tolga Cakiroglu wrote: For this, you create an "Interface" that matches to the method declaration of your class. But notice that instead of defining methods, you will define attributes those

Re: undefined identifier doesn't make sense

2013-05-20 Thread Anthony Goins
?? ProjectFile.ProjectFile.loadLastProjectOrNew() ?? maybe.

Re: Failed to sort range

2013-05-28 Thread Anthony Goins
On Tuesday, 28 May 2013 at 12:57:12 UTC, Sergei Nosov wrote: Hi! I'm trying to implement an array, which uses malloc to allocate memory. Also, I want to implement a random access range interface for it. That went pretty well, until I tried to sort it. Sorting function asserted "Failed to so

Re: how to use shared keyword in 2.063 version?

2013-05-31 Thread Anthony Goins
On Friday, 31 May 2013 at 21:01:49 UTC, Andrey wrote: Hello! I'm trying to use following code: <==> //... class A { private { int m_someVar = 10; } public { this() {

Re: Segfault on simple program?

2013-05-31 Thread Anthony Goins
On Friday, 31 May 2013 at 17:14:46 UTC, Shriramana Sharma wrote: import std.stdio ; void foo ( int[] array ) { foreach ( i ; array ) { writeln ( i ) ; } } void main () { foo ( [ 1, 2, 3 ] ) ; } On both DMD 2.062 and 2.063 this compiles OK but causes a segfault. I'm running Ku

Re: Segfault on simple program?

2013-06-01 Thread Anthony Goins
On Saturday, 1 June 2013 at 11:43:15 UTC, Shriramana Sharma wrote: On Jun 1, 2013 3:46 PM, "Ali Çehreli" wrote: If so, I would remove GDC and try installing only dmd 2.063 again. Tried that in all sorts of combinations. Still no use. Would there be some config files conflicting? But such co

-profile

2013-06-07 Thread Anthony Goins
Compiling with -profile and without -release Gives the following error (not exactly but the best I can recall) balancedParens is not nothrow safe pure With -release and -profile all is fine. Builds fine without -profile. Simple question is why?

Re: -profile

2013-06-07 Thread Anthony Goins
On Friday, 7 June 2013 at 21:39:26 UTC, bearophile wrote: Anthony Goins: Simple question is why? I am compiling this code with -profile, and I don't see errors: import std.string: balancedParens; void main() { assert(balancedParens("[[]]", '[', ']')

Re: -profile

2013-06-07 Thread Anthony Goins
On Friday, 7 June 2013 at 23:42:58 UTC, Anthony Goins wrote: On Friday, 7 June 2013 at 21:39:26 UTC, bearophile wrote: Anthony Goins: Simple question is why? I am compiling this code with -profile, and I don't see errors: import std.string: balancedParens; void main() { a

Re: -profile

2013-06-07 Thread Anthony Goins
On Friday, 7 June 2013 at 23:57:37 UTC, bearophile wrote: Anthony Goins: Is this even worth a bug report? Yes, it's worth a bug report in Bugzilla, it's a (small) Phobos Bug. I confirmed its presence. Bye, bearophile Thank you for all your help. Not just here but throughout t

Re: Conditional compilation

2013-06-07 Thread Anthony Goins
On Friday, 7 June 2013 at 12:20:23 UTC, finalpatch wrote: string mixins and template mixins don't work either. On Friday, 7 June 2013 at 12:14:45 UTC, finalpatch wrote: Hi folks, I need to apply different calling conventions to the same interfaces when compiling for different platform. It's

Re: indexing a tuple containing a struct strange result

2013-06-23 Thread Anthony Goins
On Monday, 24 June 2013 at 01:22:12 UTC, cal wrote: What is going on here? import std.stdio, std.typecons; struct S { int x; Tuple!(S) foo() { return tuple(this); } } void main() { S s; s.x = 8; writeln((s.foo())); //output: Tuple!(S)(S(8)) writeln((s.foo())[0]); /