On 3/6/2012 2:30 PM, H. S. Teoh wrote:
It'd be really cool if I could do this:

        void func(int[] vector, int[] bounds) {
                assert(vector[]>= 0&&  vector[]<  bounds[]);
                ...
        }

Is there any reason why we shouldn't implement this?


T


This same problem exists for making proper syntactical sugar for simd comparison functions.

!= ==  (opEquals is required to return a bool)

and

<= >= < > (opCmp is required to return an int)


Granted its possible to live without the sugar but the code looks more like asm, and reading the code takes longer without the operators in it.

Reply via email to