sirisian / ecmascript-types

ECMAScript Optional Static Typing Proposal http://sirisian.github.io/ecmascript-types/
453 stars 4 forks source link

Should the length be part of the generic syntax for arrays? #55

Open sirisian opened 3 years ago

sirisian commented 3 years ago
let a[10]<uint8>;

vs:

let a:[]<10, uint8>; // or:
let a:[]<uint8, 10>;

I have no real design questions. Just something I was thinking about when making the generic syntax changes.

C++ template style array for reference looks like std::array<int, 3>.

If non-type parameters will be supported by generics is up in the air though. If it was supported and expected then this would need to be debated.