Declarations are now written |type| identifier;, generally. Functions are similar |void| func() {}, etc. Special declarations still work, etc
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
import io;
|
||||
|
||||
typedef DestructorPrint {
|
||||
char* myStr;
|
||||
DestructorPrint* construct(char* str) {
|
||||
|char*| myStr;
|
||||
|DestructorPrint*| construct(|char*| str) {
|
||||
myStr = str;
|
||||
return this;
|
||||
}
|
||||
void destruct() {
|
||||
|void| destruct() {
|
||||
println(myStr);
|
||||
}
|
||||
};
|
||||
|
||||
typedef NoDistruction {
|
||||
int a;
|
||||
void dummyFunc() {}
|
||||
|int| a;
|
||||
|void| dummyFunc() {}
|
||||
};
|
||||
|
||||
void indirPrint() {
|
||||
DestructorPrint testObj.construct("Hello Destructors!");
|
||||
NoDistruction dummy;
|
||||
|void| indirPrint() {
|
||||
|DestructorPrint| testObj.construct("Hello Destructors!");
|
||||
|NoDistruction| dummy;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|int| main() {
|
||||
indirPrint();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user