Declarations are now written |type| identifier;, generally. Functions are similar |void| func() {}, etc. Special declarations still work, etc

This commit is contained in:
Nathan Braswell
2014-08-01 00:45:48 -07:00
parent 4cf8dbbd5b
commit 5b57770774
31 changed files with 199 additions and 175 deletions

View File

@@ -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;
}
}