-
Usual variables
someVariable (str) = "Hello"
-
Read-only variables
someValue (int const) = 10
-
For
for i in iterator: doSomething -
While
while condition: doSomething
if condition:
doSomething
else condition2:
doSomething2
else:
doSomething3-
Function declaration
functionName (FunctionReturnType) argName1 (Arg1Type), argName2 (Arg2Type), argName3 (Arg3Type): return something -
Function call
# call a function providing with arg1 and the second argument is the result of anotherFunctionName function functionName arg1, (antherFunctionName argForAnotherFunction)
# As in python-
Definition
class Person: # constants name (String const) age (int const) passport (Passport const) # variables mood (private String) = "OK" # constructors new (Person) # (Person) can be omitted name (String), age (int): this.name = name this.age = age this.passport = new name age # methods changeMood (void) newMood (String): this.mood = newMood
-
Create instance
somePerson (Person const) = new "Rob", 12
# variable assignment
helloVariable (String const) = helloFunction "MyName"
# helloWorld function
helloWorld (String)
name (String),
age (int):
print ["Hello", name, ", ", age]
# call ctor
person (Person const) = Male.new "Rob"