Declarations are now written |type| identifier;, generally. Functions are similar |void| func() {}, etc. Special declarations still work, etc
This commit is contained in:
@@ -3,24 +3,24 @@ import mem;
|
||||
import vector;
|
||||
|
||||
typedef AbleToBeDestroyed (Destructable) {
|
||||
void destruct() {
|
||||
|void| destruct() {
|
||||
println("Destroyed!");
|
||||
}
|
||||
};
|
||||
|
||||
int main() {
|
||||
vector<int> intVec.construct();
|
||||
|int| main() {
|
||||
|vector<int>| intVec.construct();
|
||||
intVec.addEnd(1);
|
||||
intVec.addEnd(3);
|
||||
intVec.addEnd(3);
|
||||
intVec.addEnd(7);
|
||||
for (int i = 0; i < intVec.size; i++;)
|
||||
for (|int| i = 0; i < intVec.size; i++;)
|
||||
print(intVec.at(i));
|
||||
|
||||
println();
|
||||
|
||||
vector<AbleToBeDestroyed>* desVec = new<vector<AbleToBeDestroyed>>()->construct();
|
||||
AbleToBeDestroyed testDestruct;
|
||||
|vector<AbleToBeDestroyed>*| desVec = new<vector<AbleToBeDestroyed>>()->construct();
|
||||
|AbleToBeDestroyed| testDestruct;
|
||||
desVec->addEnd(testDestruct);
|
||||
delete<vector<AbleToBeDestroyed>>(desVec);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user