Possible change to array runtime?

deadalnix deadalnix at gmail.com
Thu Mar 13 18:12:31 PDT 2014


On Thursday, 13 March 2014 at 22:21:56 UTC, sclytrack wrote:
>
> 	Language changes? Like this?
>
> 	-------------
>
> 	Delayed D Language			D Normal
>
> 	immutable int * a;			int * a;
> 	immutable qual(int) * a;		immutable(int) * a;
> 	immutable int qual(*) a;		immutable int * a;
>
> 	-------------
>
> 	struct A
> 	{
> 		int a;
> 		qual(int) b;
> 	}
> 			
>
> 	A vari;
> 	const A cvari;
> 	vari.a = 1;
> 	cvari = vari;
> 	cvari.a = 2;
> 	cvari.b = 3;	//error
>
> 	-------------
>
> 	qual
> 	class Test
> 	{
> 	}
>
>
> 	Delayed D				D struct language
>
> 	immutable Test t;			immutable(Test) * t;
> 	immutable qual(Test) t; 		immutable Test * t;
>
> 	-------------
>
>
> 	struct Array(T)
> 	{
> 		qual(T) * data;
> 		size_t length;
> 	}
>
>
> 	Array!(int) a;	
> 	const Array!(int) b;
>
> 	void routine(const Array!(int) b)
> 	{
>
> 	}
>
> 	b = a;
> 	routine(a);

I'm not sure how to understand your change proposal, you should
explicit it more. But it seems that you get what the problem is
(or at least, you are poking the right language constructs in
your proposal).


More information about the Digitalmars-d mailing list