Generic procedures generate types on use

This commit is contained in:
Ginger Bill
2017-06-25 19:41:07 +01:00
parent c4081393c1
commit 15dbea6899
6 changed files with 247 additions and 171 deletions

View File

@@ -2,7 +2,15 @@ import (
"fmt.odin";
)
proc new_type(T: type) -> ^T {
return ^T(alloc_align(size_of(T), align_of(T)));
}
proc main() {
var ptr = new_type(int);
}
/*
let program = "+ + * - /";
var accumulator = 0;
@@ -18,4 +26,5 @@ proc main() {
fmt.printf("The program \"%s\" calculates the value %d\n",
program, accumulator);
*/
}