Help me decide stuff

Posted by ludamad on April 5, 2009, 6:01 p.m.

Okay, while designing ludascript lots of things came up that I never had considered. Now they need to be resolved. You guys just vote on whatever options you like best.

1) Function definition:

The syntax for defining functions (for those that only use GM: GM doesn't need a function def syntax because it keeps scripts in separate files, but this only uses one file so it needs it).

A) def FuncName(arg, anotherarg){}

B) function FuncName(arg, anotherarg){}

C) FuncName(arg, anotherarg){}

D) FuncName = function(arg,anotherarg){}

E) ~FuncName??arg::anotherarg -> <-

2) Iterating 'i' from 0 to 'N'

A) for (i = 0; i <= N; i++)

B) for (i in 0:N)

C) for (i from 0 to N)

D) (FORLOOP (= i, 0) (<= i, N)(++i))

3) Globals versus locals (how the user indicates the difference)

A) global.global, local

B) $global, local

C) global, local.local

D) gGlobal, local//small g + capital means global here

E) global AS GLOBAL, local AS LOCAL

4) Arrays, by reference or by value?

A)

a = [];

b = a;

change(a);//both b and a are changed

B)

a = [];

b = a;//the contents of 'a' are expensively copied into 'b'

change(a);//only a changes

C)

a = [];

b = a;//do not allow array assignments, this errors

Okay, the last one in each is a joke. Feel free to vote for em anyway. Suggest stuff too if you'd like.

Comments

Mush 15 years, 10 months ago

The last ones will give your language some character.

SixWinged 15 years, 10 months ago

BBBB

ludamad 15 years, 10 months ago

I actually found some cases where not having semi-colons would be ambiguous, so, at least for now, they're mandatory.

ludamad 15 years, 10 months ago

For the record, my current implementation is BBDA, to pass an array by value you must do a = copy(b);

JoshDreamland 15 years, 10 months ago

Aww, look at the GML-oriented peoples picking the closest things to their favorite language :3

PY 15 years, 10 months ago

C

A

B

B

Eh, Josh, the language itself isn't really that bad. C++'s is better, but that's expected.

Stained Glass 15 years, 10 months ago

1. C (No return type?)

2. A

3. A

4. B

ludamad 15 years, 10 months ago

Return type? My language doesn't use static typing.

PY: GML is horrible.

RC 15 years, 10 months ago

1) B

2) A

3) B

4) C

Acid 15 years, 10 months ago

BABB

I know… I'm late.