🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Integer arrays

posted in noaktree leaves
Published July 15, 2005
Advertisement
I have a headache...

I am now calling my scripting language A2 ("A squared") after my city. It now supports integer arrays which can be used in the following ways:

int x[expression;]; // Creates an integer array of size determined by expression.
int x[expression;] = {expression; ...}; // Creates an array as above but sets each value with expressions
int x[expression;] = integer array; // Creates an array from another array.
int x[expression;] = function (internal or external) that returns an integer array;
x[expression;] = integer expression;
x = {expression; expression; ...}; // Array elements can be redefined all at once.
int y = x[expression;];
print x; // Example 5 3 77 4 3
print x[expression;]; // Prints a single element

Arrays can be passed as parameters and return types by declaring a function like so:

function int[] flable (int Array1[], int Array2[]);

Memory is managed and element access is range checked.

I hope to have a first version up by next week. Next I'll need to refactor my function parsing class. There are some redundant operations in there and it's getting too big for a single source file. Hopefully the other types will go in faster now that I have a basic framework working for data types. We will see.
Previous Entry Finished C binding
0 likes 2 comments

Comments

TraderJack
Quote: Title of the Journal

"Journal of noaktree: Noaktree Leaves"


When are you leaving
July 15, 2005 03:09 PM
noaktree
Haha. So what do you think of my language design? Name? A²
July 16, 2005 12:28 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement