Extended Type Design: further examples

jovo jovo at at.home
Tue Mar 20 04:26:33 PDT 2007


Derek Parnell Wrote:
> 
>   const char[] s;    // ok
>   ...
>   s[0] = 'a'; // fails
>   s    = "new data"; //ok
>   s.length = 2; // ok
> 

No, it can not.
 
const int[] a = [1, 2, 3, 4]; 
a.length = 2; // ok?
some_var = a[3]; // oops!
 
But length is not field.
 
jovo




More information about the Digitalmars-d mailing list