Re: Collections

2013-10-19 Thread Jonathan M Davis
On Saturday, October 19, 2013 15:00:54 simendsjo wrote: > o DCollections: Not updated in 4 years - dead? It's not dead, and it's been updated more recently than 4 years ago (though it was still 2 years ago). The latest should be here https://github.com/schveiguy/dcollections Steven hasn't time

Re: Weird error when compiling.

2013-10-19 Thread TheFlyingFiddle
Anyway to evaluate the name of the class and return its hash at compile time? I couldn't find the built in hash unction for strings so i used the one from http://dlang.org/hash-map.html as an example. More advanced and better hash functions can be found online. public class ComponentDetail(T

Re: Weird error when compiling.

2013-10-19 Thread TheFlyingFiddle
public class ComponentDetail(T) : Component { /// Component's ID as static member. public static hash_t ID = typeid(T).toHash; typeid(T).toHash can not be evaluated by the compiler at compile-time. Placing the ID

Re: Weird error when compiling.

2013-10-19 Thread Agustin
On Sunday, 20 October 2013 at 01:56:39 UTC, TheFlyingFiddle wrote: public class ComponentDetail(T) : Component { /// Component's ID as static member. public static hash_t ID = typeid(T).toHash; typeid(T).toHash can no

Re: Weird error when compiling.

2013-10-19 Thread Agustin
On Sunday, 20 October 2013 at 01:41:58 UTC, Agustin wrote: I'm getting Assertion failure: 'thisval && thisval->op == TOKclassreference' on line 4067 in file 'interpret.c' when compiling this. public class Component { /// Comp

Weird error when compiling.

2013-10-19 Thread Agustin
I'm getting Assertion failure: 'thisval && thisval->op == TOKclassreference' on line 4067 in file 'interpret.c' when compiling this. public class Component { /// Component's unique id. private hash_t id; /

Re: Metaprogramming with D.

2013-10-19 Thread TheFlyingFiddle
res += components[i]; Should be res += components[i] * components[i];

Re: Metaprogramming with D.

2013-10-19 Thread TheFlyingFiddle
On Saturday, 19 October 2013 at 15:22:31 UTC, Agustin wrote: I'm trying to implement a template Vector and i would like to know if this is possible. My current vector class is: public class Vector(T, size_t size) { private T components[size]; } And i would like to implement a property as

Re: Injecting code into methods based on UDA's

2013-10-19 Thread TheFlyingFiddle
Is it possible to inject code into a method with UDA's? For example if i wanted a method to do some logging when it's called. Something like the following. void logMsg(string file, string msg) { //Log the message to the file. } struct Log { string logFile; } class Foo { void bar() { /*

Re: Injecting code into methods based on UDA's

2013-10-19 Thread TheFlyingFiddle
Sry accedentaly clicked send while writing..

Injecting code into methods based on UDA's

2013-10-19 Thread TheFlyingFiddle
void logMsg(string file, string msg) { //Log the message to the file. } struct Log { string logFile; LogInfo toLog; } class Foo { void bar() { /* do something */ } @Log("fooInfo.txt", LogInfo.methodCall | LogInfo.returnValue) void baz() { //Doess } }

Re: Collections

2013-10-19 Thread Jacob Carlborg
On 2013-10-19 15:00, simendsjo wrote: Last I heard, collection design was delayed while waiting for the allocator design. But I guess there are plenty of collection implementations already. So where are they? o Phobos: std.container - RedBlackTree, BinaryHeap, Array, SList, DList o DCollections:

Metaprogramming with D.

2013-10-19 Thread Agustin
I'm trying to implement a template Vector and i would like to know if this is possible. My current vector class is: public class Vector(T, size_t size) { private T components[size]; } And i would like to implement a property as this: @property public size_t length() const { return Tra

D and C++

2013-10-19 Thread develop32
Hi, Are there any recent improvements in how D interfaces with C++? I got the impression that some work has been done on that, in order to make DMD a self-hosting compiler.

Collections

2013-10-19 Thread simendsjo
Last I heard, collection design was delayed while waiting for the allocator design. But I guess there are plenty of collection implementations already. So where are they? o Phobos: std.container - RedBlackTree, BinaryHeap, Array, SList, DList o DCollections: Not updated in 4 years - dead? o

Re: D on Windows - linker question

2013-10-19 Thread evilrat
On Friday, 18 October 2013 at 16:52:01 UTC, Benjamin Thaut wrote: Am 18.10.2013 18:40, schrieb Erik van Velzen: Hello, I have set up my enviroment according to these instructions: http://wiki.dlang.org/Installing_DMD_on_64-bit_Windows_7_%28COFF-compatible%29 When I compile a small tutorial pro

Re: Can't compile on 64 bit Windows

2013-10-19 Thread evilrat
On Sunday, 28 April 2013 at 12:46:31 UTC, Josh wrote: I followed the instructions in http://wiki.dlang.org/Installing_DMD_on_64-bit_Windows_7_(COFF-compatible) and all seems ok. Except I get these errors when I'm compiling: Is there anything that those instructions left out that I need to do