command - Which would be better for the syntax for an array? -



command - Which would be better for the syntax for an array? -

i making scripting language, need help on deciding syntax. having issues deciding 2 things.

first, syntax calling parts in array. thinking 1 of 2 options, give me suggestions if want.

let's have array in javascript represented as

var people = [ ["joe",34], ["bill",29], ["steve",36] ];

the options are

option 1 people[2][1] returns 36 alternative 2 people[2,1] returns 36

second, syntax calling function. thinking 1 of 2 options, give me suggestions if want.

let's have function in javascript represented as

function foo(bar,hi) { homecoming bar; }

the options are

option 1 same javascript example: function foo(bar,hi) { homecoming bar } alternative 2 same javascript, - separating each private variable it's own set of parentheses - no need state "function" in front end example: foo(bar)(hi){ homecoming bar } alternative 3 same javascript, - colon separate namespace private variables - no parentheses due lack of need example: foo:bar,hi{ homecoming bar }

any , advice , suggestions helpful! hope guys come great ideas way this, , please suggest syntax. still need help other things, not big decisions.

thanks in advance!

1) decision not 1 of syntax - deciding whether include 2d arrays base of operations type. if goal write simple language, overkill. nested arrays plenty (people[2][1]).

2) since you're going have parse these function patterns (and gather don't have access regular expressions), should take based on ease of parsing. me, that's alternative #1, because have definite start point declaration of function (the reserved word "function"). when parsing through script, if token buffer consists of "function", know next bit of code going function declaration. same cannot said either of other proposals.

syntax command

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -