Re: DUB help plz

2014-07-03 Thread ponce via Digitalmars-d-learn
On Thursday, 3 July 2014 at 04:46:02 UTC, K.K. wrote: Is the only thing I'm missing the .dll's? Thanks! Yes, everything went fine, and you find the missing DLL here: https://www.libsdl.org/download-2.0.php

Re: DUB help plz

2014-07-03 Thread FreeSlave via Digitalmars-d-learn
Derelict contains bindings to other libraries, not these libraries themselves. dub downloads only these bindings, not original libraries (since they are written in C, not D, and not included in dub repositories). You should manually get necessary libraries and put them in folder where .exe

Source transformation for D

2014-07-03 Thread Kashyap via Digitalmars-d-learn
Hi, Is there a source transformation for D available? Could someone please point me to it? If not, I'd like to work on one - I'd appreciate any pointers on getting started. I am considering writing the whole thing in D and not relying the lexer/parser in C that is already there. Regards,

integer out of range

2014-07-03 Thread pgtkda via Digitalmars-d-learn
why is this possible? int count = 50_000_000;

Re: Source transformation for D

2014-07-03 Thread ponce via Digitalmars-d-learn
On Thursday, 3 July 2014 at 10:17:59 UTC, Kashyap wrote: Hi, Is there a source transformation for D available? Could someone please point me to it? If not, I'd like to work on one - I'd appreciate any pointers on getting started. I am considering writing the whole thing in D and not relying

Re: integer out of range

2014-07-03 Thread pgtkda via Digitalmars-d-learn
On Thursday, 3 July 2014 at 10:22:14 UTC, ponce wrote: On Thursday, 3 July 2014 at 10:15:25 UTC, pgtkda wrote: why is this possible? int count = 50_000_000; int is always 4 bytes, it can contains from -2_147_483_648 to 2_147_483_647. oh, ok. I thought it only contains numbers to

Re: integer out of range

2014-07-03 Thread ponce via Digitalmars-d-learn
On Thursday, 3 July 2014 at 10:15:25 UTC, pgtkda wrote: why is this possible? int count = 50_000_000; int is always 4 bytes, it can contains from -2_147_483_648 to 2_147_483_647.

Re: spawn and wait

2014-07-03 Thread Bienlein via Digitalmars-d-learn
There is also a Semaphore and Barrier class: http://dlang.org/phobos/core_sync_barrier.html http://dlang.org/phobos/core_sync_semaphore.html

Re: Source transformation for D

2014-07-03 Thread Kashyap via Digitalmars-d-learn
On Thursday, 3 July 2014 at 10:23:31 UTC, ponce wrote: On Thursday, 3 July 2014 at 10:17:59 UTC, Kashyap wrote: Hi, Is there a source transformation for D available? Could someone please point me to it? If not, I'd like to work on one - I'd appreciate any pointers on getting started. I am

Re: spawn and wait

2014-07-03 Thread Puming via Digitalmars-d-learn
On Thursday, 3 July 2014 at 04:51:07 UTC, Ali Çehreli wrote: On 07/02/2014 08:29 PM, Puming wrote: I want to spawn several similar tasks and then wait for all of them to complete to go on do some other things If you don't care about account for each of them individually,

Re: DUB help plz

2014-07-03 Thread K.K. via Digitalmars-d-learn
On Thursday, 3 July 2014 at 07:20:52 UTC, ponce wrote: On Thursday, 3 July 2014 at 04:46:02 UTC, K.K. wrote: Is the only thing I'm missing the .dll's? Thanks! Yes, everything went fine, and you find the missing DLL here: https://www.libsdl.org/download-2.0.php On Thursday, 3 July 2014 at

Re: CTFE bug or enhancement?

2014-07-03 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jul 03, 2014 at 02:09:09AM +, safety0ff via Digitalmars-d-learn wrote: On Thursday, 3 July 2014 at 02:02:19 UTC, safety0ff wrote: On Thursday, 3 July 2014 at 01:55:14 UTC, safety0ff wrote: Actually, this is an enhancement because adding: enum b = blah Makes them fail. :( The

Re: spawn and wait

2014-07-03 Thread Ali Çehreli via Digitalmars-d-learn
On 07/02/2014 08:29 PM, Puming wrote: I want to spawn several similar tasks and then wait for all of them to complete to go on do some other things, like: [...] My current workaround is using messages: I forgot to mention that if message passing is merely a workaround :) in this case then

Re: spawn and wait

2014-07-03 Thread Sean Kelly via Digitalmars-d-learn
On Thursday, 3 July 2014 at 10:25:41 UTC, Bienlein wrote: There is also a Semaphore and Barrier class: http://dlang.org/phobos/core_sync_barrier.html http://dlang.org/phobos/core_sync_semaphore.html This is probably what I'd do, though both this and thread_joinAll will only work if you have

Re: integer out of range

2014-07-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Thu, 03 Jul 2014 10:24:26 + pgtkda via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Thursday, 3 July 2014 at 10:22:14 UTC, ponce wrote: On Thursday, 3 July 2014 at 10:15:25 UTC, pgtkda wrote: why is this possible? int count = 50_000_000; int is always 4

immutable/mutable aliasing

2014-07-03 Thread Jet via Digitalmars-d-learn
void foo(immutable int* x, int* y) { bar(*x); // bar(3) *y = 4; // undefined behavior bar(*x); // bar(??) } ... int i = 3; foo(cast(immutable)i, i); -- In the 2.065 version, I can compile. But that is not in the documentation.

Re: immutable/mutable aliasing

2014-07-03 Thread Jet via Digitalmars-d-learn
There, how to distinguish between const and immutable? thank you~:) /** Const types are like immutable types, except that const forms a read-only view of data. Other aliases to that same data may change it at any time. Any data referenced by the const declaration cannot be changed from

Re: immutable/mutable aliasing

2014-07-03 Thread anonymous via Digitalmars-d-learn
On Thursday, 3 July 2014 at 21:06:12 UTC, Jet wrote: There, how to distinguish between const and immutable? thank you~:) /** Const types are like immutable types, except that const forms a read-only view of data. Other aliases to that same data may change it at any time. Any data

Re: immutable/mutable aliasing

2014-07-03 Thread anonymous via Digitalmars-d-learn
On Thursday, 3 July 2014 at 20:43:33 UTC, Jet wrote: void foo(immutable int* x, int* y) { bar(*x); // bar(3) *y = 4; // undefined behavior bar(*x); // bar(??) } ... int i = 3; foo(cast(immutable)i, i); -- In the 2.065 version, I can compile. But that is not in

Re: immutable/mutable aliasing

2014-07-03 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jul 03, 2014 at 09:06:11PM +, Jet via Digitalmars-d-learn wrote: There, how to distinguish between const and immutable? thank you~:) /** Const types are like immutable types, except that const forms a read-only view of data. Other aliases to that same data may change it at any

Re: immutable/mutable aliasing

2014-07-03 Thread Jet via Digitalmars-d-learn
Thank you all. These answers are very detailed. I think I learned a lot.

Re: immutable/mutable aliasing

2014-07-03 Thread Jet via Digitalmars-d-learn
Awesome!!! Thank you so much!

Re: immutable/mutable aliasing

2014-07-03 Thread Ali Çehreli via Digitalmars-d-learn
On 07/03/2014 01:43 PM, Jet wrote: void foo(immutable int* x, int* y) { bar(*x); // bar(3) *y = 4; // undefined behavior bar(*x); // bar(??) } ... int i = 3; foo(cast(immutable)i, i); -- In the 2.065 version, I can compile. But that is not in the