Cross platform Development

2015-01-23 Thread seany via Digitalmars-d-learn
Hello I read this page, but I still have questions : http://forum.dlang.org/thread/fzbaxwcrbztqedqgm...@forum.dlang.org#post-mailman.1142.1332716016.4860.digitalmars-d:40puremagic.com I also read this :

Re: Cross platform Development

2015-01-23 Thread AndyC via Digitalmars-d-learn
On Friday, 23 January 2015 at 17:32:09 UTC, seany wrote: Hello I read this page, but I still have questions : http://forum.dlang.org/thread/fzbaxwcrbztqedqgm...@forum.dlang.org#post-mailman.1142.1332716016.4860.digitalmars-d:40puremagic.com I also read this :

Re: What to do with InvalidMemoryOperationError

2015-01-23 Thread anonymous via Digitalmars-d-learn
On Friday, 23 January 2015 at 21:25:01 UTC, Nordlöw wrote: On Friday, 23 January 2015 at 10:13:43 UTC, Joakim wrote: InvalidMemoryOperationError generally means that you are performing certain disallowed memory operations during a full garbage collection, such as allocating while the gc is

Re: What to do with InvalidMemoryOperationError

2015-01-23 Thread Nordlöw
On Friday, 23 January 2015 at 10:13:43 UTC, Joakim wrote: InvalidMemoryOperationError generally means that you are performing certain disallowed memory operations during a full garbage collection, such as allocating while the gc is running. If my app is single-threaded this cannot happen

Re: What D related (or interesting development based) twitter accounts do you guys follow?

2015-01-23 Thread eles via Digitalmars-d-learn
On Sunday, 28 July 2013 at 16:57:54 UTC, Gary Willoughby wrote: What D related (or interesting development based) twitter accounts do you guys follow? I'm pretty new to twitter and trying to follow accounts that i find interesting. Just remembered when reading this:

Re: for ranges

2015-01-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/23/15 4:44 AM, ixid wrote: On Thursday, 22 January 2015 at 16:41:49 UTC, Russel Winder wrote: Playing with factorial implementations, as you do. I had a D implementation using ulong. Not sensible obviously since overflow is a bit of a problem. But the code worked, as did the tests. Now

Re: why spawn crash?

2015-01-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/22/15 10:20 PM, mzf wrote: i wrote a test code: void worker(int firstNumber) { Thread.sleep(1.msecs); } void main() { foreach (i; 1 .. 1000) { spawn(worker, i ); writeln(i); } thread_joinAll(); writeln(ok); } sometimes it's ok,sometimes

Re: BitArray - incomplete implementation?

2015-01-23 Thread anony via Digitalmars-d-learn
On Saturday, 24 January 2015 at 00:13:34 UTC, Laeeth Isharc wrote: Hi. Should the following code work? Yes, that error is caused by a bug of BitArray(https://issues.dlang.org/show_bug.cgi?id=13806). Having init function broke template constraints of chain(and must break dozen of other

Re: BitArray - incomplete implementation?

2015-01-23 Thread Laeeth Isharc via Digitalmars-d-learn
To avoid confusion, the below is the code that fits the error message: import std.bitmanip; import std.stdio; import std.array; import std.range:chain; void test() { int[] a=[1,2,3,4,5]; int[] b=[5,4,3,2,1]; int[] c = chain(a,b).array; // chain two arrays of int

BitArray - incomplete implementation?

2015-01-23 Thread Laeeth Isharc via Digitalmars-d-learn
Hi. Should the following code work? import std.bitmanip; import std.stdio; import std.array; import std.range:chain; void test() { int[] a=[1,2,3,4,5]; int[] b=[5,4,3,2,1]; int[] c = chain(a,b).array; // chain two arrays of int writefln(%s,c); } void test2() {

Re: why spawn crash?

2015-01-23 Thread mzfhhhh via Digitalmars-d-learn
thanks,you are right. window console show chinese char is not right, so i try to add this code: extern(C) int setlocale(int, char*); static this() { fwide(core.stdc.stdio.stdout, 1); setlocale(LC_CTYPE, cast(char*)china); } it's looks like solve the problem,but caused another problem.

Re: BitArray - incomplete implementation?

2015-01-23 Thread Laeeth Isharc via Digitalmars-d-learn
Yes, that error is caused by a bug of BitArray(https://issues.dlang.org/show_bug.cgi?id=13806). Having init function broke template constraints of chain(and must break dozen of other templates). pragma(msg, ElementType!(BitArray[])) // prints 'pure nothrow void(bool[] ba)' - ElementType uses

Re: for ranges

2015-01-23 Thread ixid via Digitalmars-d-learn
On Thursday, 22 January 2015 at 16:41:49 UTC, Russel Winder wrote: Playing with factorial implementations, as you do. I had a D implementation using ulong. Not sensible obviously since overflow is a bit of a problem. But the code worked, as did the tests. Now converting to BigInt and… The

Re: What to do with InvalidMemoryOperationError

2015-01-23 Thread Joakim via Digitalmars-d-learn
On Wednesday, 21 January 2015 at 12:00:47 UTC, Nordlöw wrote: My executable throws as core.exception.InvalidMemoryOperationError@(0) when compiled with DMD git master. I get no stack trace in GDB. What to do? InvalidMemoryOperationError generally means that you are performing certain

Error: closures are not yet supported in CTFE

2015-01-23 Thread zeljkog via Digitalmars-d-learn
I tried: -- import std.stdio, std.algorithm; auto unique(){ bool[int] c; return (int a){ if (a in c) return false; else{ c[a] = true; return true; } }; } void main() { [1, 5, 5, 2, 1, 5, 6,

Dub subPackage buildType and output file name

2015-01-23 Thread Stefan Frijters via Digitalmars-d-learn
Currently I'm using dub for the first time and I've run into two problems so far. 1) I have defined buildTypes in dub.json, as well as subPackages. However, I want to always build all subPackages in release mode, regardless of the --build option I'm using to build the main program. I'm not