Pal-Kristian Engstad wrote:
Hence:
> 
> (. aloc 3) <=> (array-nth aloc3)     
> (. vec 2) <=> vec[2] <=> (vector-nth vec 3)

> Is there a reason not to have > aloc[3]?

The problem here is that when we see the expression aloc[3], we don't
have enough syntactic information to determine if the type of aloc is
an array (having at least 4 elements) or a vector.

We can support this syntax of aloc's type has already resolved to some
array/vector type. This is similar to the st.f field selection syntax
for structures.

It is possible to infer types that are variable over array/vector types 
(same for structures), at the cost of complicating the inferred types.

It is definitely possible to support this syntax using different
syntactic constructs for example:  aloc[3] for array subscript and
vec{3} for vector subscript.

Swaroop.

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to