* - Indicates a change
+ - Indicates an addition
# - Indicates a removal
Since last edit, that is.
--
As in many languages, a semi-colon will mark the end-of-line.
--
Strings will be like every other programming language; beginning and ending with a (double) quote.
--
*Block comments will be [[ comment ]], single line comments will be "//comment"
--
Modifiers are the same as any .NET language. These include "public," "private," "sealed," and "abstract". However, "public" will be "global," "private" will be "internal," "sealed" will be "closed," and "abstract" will be "open".
--
Threads will be a built-in type for easier access. (yay)
--
#Moved arrays and matrices so they have their own mini-topic
--
Instead of using "." to access the methods of a variable, the colon (":") will be used. I.e. instead of "<var>.<method>;", it will be "<var>:<method>;"
--
Accessing the current application/class will be "current" instead of "this" or "Me".
--
Inheritance will be implemented.
--
"parent" will be used instead of "base" (like in C# or <insert other language that uses "base">) or "super" (like Java).
--
"break" (from C#, not sure on its equivalent in Java, etc.) will be "exit"
--
"quit" will be a general command to exit the program, unless in an infinite loop :P.
--
+Preprocessor directives will only be in the main file and will be denoted by '@'.
VARIABLES
Will be defined by "<type> <name> [= <value>];"
-Here is a list of current types (layout is "<type> : <declaration name> : <default value>")
-string : str : ""
-integer : int : 0
-boolean : bool : false
-byte : byte : 00
CONDITIONALS
Will be accessed by
"if (<condition>) {
<code>
}
elseif (<condition>) {
<code>
}
else {
<code>
}"
You will also have the ability to use switch/case statements that will be used in a similar fashion.
METHODS / FUNCTIONS
Methods, since they don't return anything, are sub-procedures and therefore will be accessed by
"<modifiers> sub <method name> ([<arguments>]) {
<code>
}"
Functions will be similar, replacing "sub" with their return type.
"<modifiers> <type> <function name> ([<arguments>]) {
<code>
return <type>;
}"
LOOPS
Will support 4 types of loops:
-While
"do {
<code to be executed until condition is false>
} while (<condition>);"
-Until
"do {
<code to be executed until condition is true>
} until (<condition>);"
---Both of the above loops can have the "test" (the "while" or "until" part) either before "do", or after the closing brackets like in the example.
-For
"for (<int>[ = beginning], <end>[, increment]) {
<code>
}"
-For Each
"foreach (<type> <var> in <collection [of type]>) {
<code>
}"
Thanks to calcdude for the idea of testing before and after.
CLASSES
Will be implemented in the same way that most languages (at least the ones I know) implement them.
"<class name> <class var name> = new <class name>;"
ENUMS
An enum, in case you don't know what it is, is basically a group of numbers. However, in Zenon, they can be a group of anything. (If that can't be done, then a new group type will be added called Group)
-Declared:
"<modifiers> enum <name> {
<name> = <number>,
<name2> = <number>,
etc.
}"
-Accessed:
"<enum> <var name> = <enum>:<enum child>;"
+ARRAYS/MATRICES
As an example, here are declarations of a string array, matrix, and collections that have more that 2 dimensions:
-Array: str# hello = new str#[0][1][2];
-Matrix: str# hello = new str#[[0][1][2],[3][4][5]];
-Multi: str# hello = new str#[[0][1][2],[3][4][5],[6][7][8]];
Or, for non-specific declarations, one can do
-Array: str# inf = new str#[];
-Matrix: str# inf = new str#[,];
-Multi: str# inf = new str#[,,];