01alchemist / TurboScript

Super charged typed JavaScript dialect for parallel programming which compiles to WebAssembly
Apache License 2.0
494 stars 35 forks source link

User wants int32[] as well as Array<int32> #121

Open MaxGraey opened 7 years ago

MaxGraey commented 7 years ago

How

let arr1: int32[] = new Array<int32>(1);
let arr2: int32[] = new int32[](2); // if possible and make sense
let arr3: int32[] = new Array(3); // implicitly type detection
dcodeIO commented 7 years ago

Sorry, posted here but then noticed that it's the wrong repo ^^

nidin commented 7 years ago

😄 btw @dcodeIO is Array type implemented in AssemblyScript

nidin commented 7 years ago

@MaxGraey I would simplify

let arr2: int32[] = new int32[](2);

to

let arr2: int32[] = [](2);
MaxGraey commented 7 years ago

I think new keyword should be exists.

let arr2: int32[] = new [](2);

The best solution in my opinion (shortest and compatible):

let arr2 = new int32[](2);