Declarations are now written |type| identifier;, generally. Functions are similar |void| func() {}, etc. Special declarations still work, etc
This commit is contained in:
@@ -2,11 +2,11 @@ import mem;
|
||||
import io;
|
||||
|
||||
typedef AnObject {
|
||||
int a;
|
||||
int b;
|
||||
char* c;
|
||||
|int| a;
|
||||
|int| b;
|
||||
|char*| c;
|
||||
|
||||
void print() {
|
||||
|void| print() {
|
||||
print(a+b);
|
||||
print("\n");
|
||||
print(c);
|
||||
@@ -15,8 +15,8 @@ typedef AnObject {
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
AnObject* ptr = new<AnObject>();
|
||||
|int| main() {
|
||||
|AnObject*| ptr = new<AnObject>();
|
||||
ptr->a = 4;
|
||||
ptr->b = 7;
|
||||
ptr->c = "Hello decent memory! Quite a nice feeling\n";
|
||||
@@ -24,4 +24,4 @@ int main() {
|
||||
delete<AnObject>(ptr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user