Object o;
<<< i, " ", o >>>;
@```
-@exec make -s decl0.test
+@hide make -s decl0.test
## Declaring a reference
new Object @=> ref;
<<< "But now it does: ", ref >>>;
@```
-@exec make -s decl1.test
+@hide make -s decl1.test
## Arrays
new int[2] @=> ref;
<<< ref >>>;
@```
-@exec make -s decl2.test
+@hide make -s decl2.test
@``` helloworld.gw
<<< "Hello, World!" >>>;
@```
-@exec make -s CONTAINS="Hello, World!" helloworld.test
+@hide make -s CONTAINS="Hello, World!" helloworld.test
## (Bag of) Features
* [single inheritance](https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)#Design_constraints)
repeat(3)
<<< "Hello, world!" >>>;
@```
-@exec make -s CONTAINS="Hello" repeat.test
+@hide make -s CONTAINS="Hello" repeat.test
## Block example
<<< "Hello, ", s, "!" >>>;
}
@```
-@exec make -s CONTAINS="Hello" repeat2.test
+@hide make -s CONTAINS="Hello" repeat2.test
for(int i; i < 3; ++i)
<<< i >>>;
@```
-@exec make -s forloop0.test
+@hide make -s forloop0.test
It also works with a block of code.
<<< i, " " , f1, " ", f2 >>>;
}
@```
-@exec make -s forloop2.test
+@hide make -s forloop2.test
## Nested Loops
@``` forloop3.gw
}
}
@```
-@exec make -s forloop3.test
+@hide make -s forloop3.test
### Auto Loops
<<< b >>>;
}
@```
-@exec make -s forloop4.test
+@hide make -s forloop4.test
### Auto Pointer loop
If you want to change it the value in the array, you need a pointer
<<< *b >>>;
}
@```
-@exec make -s forloop5.test
+@hide make -s forloop5.test
<<< "running..." >>>;
}
@```
-@exec make -s while0.test
+@hide make -s while0.test
well this may output nothing...
lets try
<<< "running..." >>>;
} while(true);
@```
-@exec make -s while1.test
+@hide make -s while1.test
@``` lambda_call0.gw
\ i { <<< "passed '", i, "'" >>>; }(3);
@```
-@exec make -s CONTAINS="passed '3'" lambda_call0.test
+@hide make -s CONTAINS="passed '3'" lambda_call0.test
## Use case
\ i { <<< "passed '", i, "'" >>>; } @=> fptr_t fptr;
fptr(4);
@```
-@exec make -s CONTAINS="passed '4'" lambda_fptr0.test
+@hide make -s CONTAINS="passed '4'" lambda_fptr0.test
### As Argument to Functions
@``` lambda_args0.gw
}
test(\ i { <<< "passed '", i, "'" >>>; });
@```
-@exec make -s CONTAINS="passed '5'" lambda_args0.test
+@hide make -s CONTAINS="passed '5'" lambda_args0.test
#! or use alternate syntax
<<< 1 => test_function >>>;
@```
-@exec make -s function0.test
+@hide make -s function0.test
variadic_test(1, 2);
variadic_test(1, 2, 3);
@```
-@exec make -s variadic.test
+@hide make -s variadic.test
};
<<< zero, one, two >>>;
@```
-@exec make -s enum0.test
+@hide make -s enum0.test
## Storage and access Specifiers