I am making a scripting language, but I need help on deciding some syntax. I am mainly having issues deciding two things.
First, the syntax for calling an parts in the array. I was thinking one of two options, but give me suggestions if you want.
请允许我说,我有一阵列,在 Java文中,代表人数将相当于代表人数。
var people = [
["Joe",34],
["Bill",29],
["Steve",36]
];
备选办法如下:
Option One
people[2][1]
returns 36
Option Two
people[2,1]
returns 36
第二,要求发挥职能。 我正在考虑两种选择之一,但如果你愿意,我会提出建议。
请允许我说,我有一项职能是,在 Java文中代表 as人。
function foo(bar,hi) {
return bar;
}
备选办法如下:
Option One
The same as Javascript
example:
function foo(bar,hi) {
return bar
}
Option Two
The same as Javascript, but
- separating each private variable with it s own set of parentheses
- no need to state "function" in front
example:
foo(bar)(hi){
return bar
}
Option Three
The same as Javascript, but
- a colon to separate the namespace from the private variables
- no parentheses due to the lack of need
example:
foo:bar,hi{
return bar
}
任何意见和建议都会非常有益! 我希望你们提出一些伟大的想法,以便做到这一点。 我仍需要一些其他事情的帮助,但这些事情实际上不是任何重大决定。
<><>>>> 预产!