simit-lang / simit

A language for computing on sparse systems
http://simit-lang.org
Other
454 stars 52 forks source link

Constant externs #81

Open stephenchouca opened 8 years ago

stephenchouca commented 8 years ago

Currently there is no way to declare constant extern variables. The following is the proposed syntax for declaring constant externs:

const extern V : set{Vertex};
const extern M : matrix[3,3](float);

export func main()
   V.a = 1.0;  % Compile-time error, since V is read-only
   M = 1.0;  % Comple-time error, since M is also read-only
end