Proposal: use [x,y] indicate/define a array, like json #1968
Replies: 5 comments
-
Would you be allowed to specify a type beforehand? That could lead to ambiguities. Eg. var Int32 = new []{0, 1};
var x = Int32[0]; // indexer, or new array? |
Beta Was this translation helpful? Give feedback.
-
@YairHalberstadt ofcourse it's should a indexer in this scene, I think it can be distinguished. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Wouldn't that be false and the length been 3? |
Beta Was this translation helpful? Give feedback.
-
@willard720 [x,y,z].Length == 3, [x] indicate a array has only one element. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
for example:
var arr = [3, 5];
equals:
var arr = new[] {3, 5};
and not only for initialize, i hope can do this:
Beta Was this translation helpful? Give feedback.
All reactions