Re: what prevents dynamic array from being deprecated & tuple being accepted?

2009-04-02 Thread Trass3r
davidl schrieb: The cons/pros of this proposal: Cons: ungly syntax da!(int)(3) is really worse than int[3]; slow down the compiling process Yep, you say it. Also Tuple!(int, float) is accused as ugly Can't understand what's so ugly about that. int~float is nothing better.

Re: what prevents dynamic array from being deprecated & tuple being accepted?

2009-04-02 Thread davidl
在 Thu, 02 Apr 2009 12:08:39 +0800,davidl 写道: Something like following can substitute dynamic array: struct da(T){ T* ptr; int len, capacity; T opIndex(int i){} int length(){ return len;} void length(int len){ // do allocation} this(int i){ //allocate memory for ptr

what prevents dynamic array from being deprecated & tuple being accepted?

2009-04-01 Thread davidl
Something like following can substitute dynamic array: struct da(T){ T* ptr; int len, capacity; T opIndex(int i){} int length(){ return len;} void length(int len){ // do allocation} this(int i){ //allocate memory for ptr } this(){ // do nothing} da!(T) opCat(T* a){