59 lines
1.5 KiB
Plaintext
59 lines
1.5 KiB
Plaintext
import to_import: simple_print, a, b, string_id
|
|
|
|
obj Something (ObjectTrait) {
|
|
var member: int
|
|
fun method(a: int):int {
|
|
return 5+a+member
|
|
}
|
|
fun return_this(): *Something {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
/*fun some_function(): int return 0;*/
|
|
/*fun some_other_function(in: bool): float {*/
|
|
/*return 0.0*/
|
|
/*}*/
|
|
fun main(): int {
|
|
/*var a_declaration:int*/
|
|
/*simple_print(1 + 2)*/
|
|
/*var again = 2 + 4 - 1 * 400*/
|
|
/*simple_print(again)*/
|
|
/*again = 2 + (4 - 1) * 400*/
|
|
/*simple_print(again)*/
|
|
/*var another_declaration: int = 8.0*/
|
|
/*simple_print(another_declaration)*/
|
|
/*var yet_another_declaration = "Hello Marcus\n"*/
|
|
/*simple_print(yet_another_declaration)*/
|
|
/*simple_print("Hello World!\n")*/
|
|
/*simple_print(1337)*/
|
|
/*if (1 + 2 && false) simple_print("its true!")*/
|
|
/*else simple_print("its false!")*/
|
|
/*var counter = 10*/
|
|
/*counter--*/
|
|
/*--counter*/
|
|
/*while (counter) simple_print(counter--)*/
|
|
/*simple_print("\n")*/
|
|
/*counter = 8*/
|
|
/*while (counter) {*/
|
|
/*simple_print(--counter)*/
|
|
/*}*/
|
|
/*simple_print("\n")*/
|
|
/*for (var j = 0; j < 10; j++;)*/
|
|
/*simple_print(j)*/
|
|
var an_obj: Something
|
|
an_obj.member = 20
|
|
simple_print(an_obj.member)
|
|
simple_print("here is thing")
|
|
simple_print(123)
|
|
simple_print("\n")
|
|
simple_print(an_obj.method(1))
|
|
simple_print("\n")
|
|
simple_print(string_id("WoooopsEee\n"))
|
|
var with_ptr = an_obj.return_this()
|
|
simple_print(with_ptr->method(2))
|
|
simple_print("\n")
|
|
return 0
|
|
}
|
|
|