Re: Linux dll - Windows dll

2014-01-25 Thread Benjamin Thaut
Am 25.01.2014 04:13, schrieb Mineko: Alright.. I've been having issues with getting windows DLL's to work with DMD, as in I can't make them and can't even compile without a bunch of errors. So, I need help on that, as the dll part of the site ain't helping. Also, any idea on how to convert

Re: shared methods

2014-01-25 Thread Johannes Pfau
Am Fri, 24 Jan 2014 22:30:13 + schrieb Kagamin s...@here.lot: http://igoro.com/archive/volatile-keyword-in-c-memory-model-explained/ As I understand, because Itanium doesn't have cache coherency, a memory fence is needed to implement volatile load and store. On x86 load and store are

automatic type creation

2014-01-25 Thread Frustrated
I'd like to support extensions of my own interfaced based design where anyone could simply drop in there own inherited classes and everything would work as if they designed everything using those classes from the get go. To do this though, I need a way to know how to generate these unknown

Re: How to skip permission denied exceptions if iterate through directories?

2014-01-25 Thread simendsjo
On Friday, 24 January 2014 at 23:46:04 UTC, Clas Onnebrink wrote: (...) I want work through a directory on my linux server but there are some directories I have no permissions to access so I get following: ~/Projects/cltools/smdups $ source/smdups -r -p=/media/clas/Elements2 -e=*.*

Re: Linux dll - Windows dll

2014-01-25 Thread Mineko
Ok thank both of you, looks like I really will have to wait on Windows DLL's.

Re: Profiling

2014-01-25 Thread Philippe Sigaud
On Fri, Jan 24, 2014 at 10:25 PM, Benjamin Thaut c...@benjamin-thaut.de wrote: What Plattform are you profiling on? Linux 32bits. Does it change something? I'm not using any OS-specific part of Phobos, AFAICT.

Generating an enum from a tuple of Types?

2014-01-25 Thread Johannes Pfau
Is it possible to generate a enum from a tuple of types without string mixins? struct S(Types...) { enum Tag { //? } } where the tag enum should have Types.length members. The exact names of the enum members don't matter and could be numbered, for

Re: Generating an enum from a tuple of Types?

2014-01-25 Thread Stanislav Blinov
On Saturday, 25 January 2014 at 15:38:39 UTC, Johannes Pfau wrote: Is it possible to generate a enum from a tuple of types without string mixins? struct S(Types...) { enum Tag { //? } } Without mixins altogether... dunno. But nothing stops you

Re: Generating an enum from a tuple of Types?

2014-01-25 Thread Dicebot
If one wants to generate code with new identifiers, usage of string mixins is pretty much unavoidable.

Re: Generating an enum from a tuple of Types?

2014-01-25 Thread Artur Skawina
On 01/25/14 16:38, Johannes Pfau wrote: Is it possible to generate a enum from a tuple of types without string mixins? struct S(Types...) { enum Tag { //? } } where the tag enum should have Types.length members. The exact names of the

Re: Generating an enum from a tuple of Types?

2014-01-25 Thread Johannes Pfau
Am Sat, 25 Jan 2014 18:55:54 +0100 schrieb Artur Skawina art.08...@gmail.com: Well, if you don't need names then just use the index directly. Eg, see 'DiscUnion.type' in

Re: shared methods

2014-01-25 Thread Kagamin
On Saturday, 25 January 2014 at 10:00:58 UTC, Johannes Pfau wrote: (For example it isn't valid in D to access a shared variable with normal operations anyway, AFAIK. You need to use the atomicOp things and these will the worry about the hardware part, using the correct instructions and so on)

Re: shared methods

2014-01-25 Thread Kagamin
Also if you read a shared value with atomicLoad every time, this disallows caching in registers or on stack, which is also performance hit. The shared value should be read once and cached if possible.

dmd compile large project

2014-01-25 Thread Erik van Velzen
I just downloaded a larger project from Github without a build script or anything. Is there an easy way to compile it to a library or object files?

Re: dmd compile large project

2014-01-25 Thread Uplink_Coder
try dub :D

Re: dmd compile large project

2014-01-25 Thread Dicebot
On Saturday, 25 January 2014 at 22:01:59 UTC, Erik van Velzen wrote: I just downloaded a larger project from Github without a build script or anything. Is there an easy way to compile it to a library or object files? If it has package.json file in root, that it is a dub

Re: dmd compile large project

2014-01-25 Thread Erik van Velzen
Thanks for the input I was thinking there maybe was an easy way that I wasn't aware of. I only wanted to use a small part of the project so I just made a list of those files and their dependencies and compiled that.

Re: shared methods

2014-01-25 Thread Johannes Pfau
Am Sat, 25 Jan 2014 21:41:20 + schrieb Kagamin s...@here.lot: On Saturday, 25 January 2014 at 10:00:58 UTC, Johannes Pfau wrote: (For example it isn't valid in D to access a shared variable with normal operations anyway, AFAIK. You need to use the atomicOp things and these will

Re: shared methods

2014-01-25 Thread Johannes Pfau
Am Sat, 25 Jan 2014 21:48:39 + schrieb Kagamin s...@here.lot: Also if you read a shared value with atomicLoad every time, this disallows caching in registers or on stack, which is also performance hit. The shared value should be read once and cached if possible. Yes, I came to the

Good ol' OpenGL D-C interfacing. :(

2014-01-25 Thread Mineko
Alright.. For the record, I've been searching on how to fix this for 2 hours now, so yeah. Anyway, here's the issue, and it's probably half OpenGL being well.. OpenGL, and the other half being D-C interfacing. Point is, I'm trying to draw a triangle with a custom Triangle class I made, and

Xor trick?

2014-01-25 Thread bearophile
Do you know how to perform the xor trick (http://en.wikipedia.org/wiki/XOR_swap_algorithm ) on two pointers in D? This is a try: void foo(T)(ref T x, ref T y) pure nothrow { x ^= y; y ^= x; x ^= y; } void main() { int* p, q; foo(p, q); } Currently that gives:

Re: Xor trick?

2014-01-25 Thread Martin Cejp
That's what you get for trying to be a smartass! Seriously though, why would you want to do this? It's not actually faster or anything, you know.

Re: Xor trick?

2014-01-25 Thread Adam D. Ruppe
On Sunday, 26 January 2014 at 00:04:08 UTC, bearophile wrote: Do you know how to perform the xor trick (http://en.wikipedia.org/wiki/XOR_swap_algorithm ) on two pointers in D? You don't; it is undefined behavior and could lead to crashes. Suppose another thread triggers a GC run right after

Re: Xor trick?

2014-01-25 Thread bearophile
Adam D. Ruppe: You could cast it to size_t, then the compiler will let you do the operation, but casting pointers to and from integers means you take matters of correctness into your own hands. Right, so I have to carry around size_t instead of pointers. Bye and thank you, bearophile

Re: Xor trick?

2014-01-25 Thread H. S. Teoh
On Sun, Jan 26, 2014 at 12:14:40AM +, bearophile wrote: Adam D. Ruppe: You could cast it to size_t, then the compiler will let you do the operation, but casting pointers to and from integers means you take matters of correctness into your own hands. Right, so I have to carry around

Re: Python calling D

2014-01-25 Thread Ellery Newcomer
On Friday, 24 January 2014 at 10:55:34 UTC, Russel Winder wrote: Probably want to use a virtualenv for this rather than install into the base installation you can also do python setup.py build python runtests.py -b hello It needs to work for Python 3.3 as well! try the latest commit

Re: Good ol' OpenGL D-C interfacing. :(

2014-01-25 Thread Rikki Cattermole
On Saturday, 25 January 2014 at 23:28:07 UTC, Mineko wrote: Alright.. For the record, I've been searching on how to fix this for 2 hours now, so yeah. Anyway, here's the issue, and it's probably half OpenGL being well.. OpenGL, and the other half being D-C interfacing. Point is, I'm trying

Re: Good ol' OpenGL D-C interfacing. :(

2014-01-25 Thread Mineko
On Sunday, 26 January 2014 at 02:39:29 UTC, Rikki Cattermole wrote: On Saturday, 25 January 2014 at 23:28:07 UTC, Mineko wrote: Alright.. For the record, I've been searching on how to fix this for 2 hours now, so yeah. Anyway, here's the issue, and it's probably half OpenGL being well..

Re: Good ol' OpenGL D-C interfacing. :(

2014-01-25 Thread TheFlyingFiddle
On Saturday, 25 January 2014 at 23:28:07 UTC, Mineko wrote: Alright.. For the record, I've been searching on how to fix this for 2 hours now, so yeah. Anyway, here's the issue, and it's probably half OpenGL being well.. OpenGL, and the other half being D-C interfacing. Point is, I'm trying

Re: Good ol' OpenGL D-C interfacing. :(

2014-01-25 Thread Mineko
On Sunday, 26 January 2014 at 03:39:37 UTC, TheFlyingFiddle wrote: On Saturday, 25 January 2014 at 23:28:07 UTC, Mineko wrote: Alright.. For the record, I've been searching on how to fix this for 2 hours now, so yeah. Anyway, here's the issue, and it's probably half OpenGL being well..

Re: sqlite_mismatch using etc.c.sqlite3

2014-01-25 Thread Jesse Phillips
On Saturday, 25 January 2014 at 12:43:48 UTC, Jacho Mendt wrote: sqlite3_exec here returns 21, wich is the code for SQLITE_MISMATCH. I know I'm doing something wrong, i just can't find what. I can't really see why that would be considering the explaination of that error: This error occurs

Re: automatic type creation

2014-01-25 Thread Ali Çehreli
Where is the tldr; section? :) On 01/25/2014 04:08 AM, Frustrated wrote: I'd like to support extensions of my own interfaced based design where anyone could simply drop in there own inherited classes and everything would work as if they designed everything using those classes from the get

Re: automatic type creation

2014-01-25 Thread Frustrated
On Sunday, 26 January 2014 at 05:19:51 UTC, Ali Çehreli wrote: Where is the tldr; section? :) On 01/25/2014 04:08 AM, Frustrated wrote: I'd like to support extensions of my own interfaced based design where anyone could simply drop in there own inherited classes and everything would work as