simit icon indicating copy to clipboard operation
simit copied to clipboard

Constant externs

Open stephenchouca opened this issue 8 years ago • 0 comments

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

stephenchouca avatar Oct 03 '16 20:10 stephenchouca