Rudimentary para-poly procedures
This commit is contained in:
1 parent
15dbea6899
commit
1ced92be47
8 files changed
+186
-77
No files matched your search
+4
-1
@@ -3,11 +3,14 @@ import (
|
||||
)
|
||||
|
||||
proc new_type(T: type) -> ^T {
|
||||
return ^T(alloc_align(size_of(T), align_of(T)));
|
||||
return ^T(alloc(size_of(T), align_of(T)));
|
||||
}
|
||||
|
||||
proc main() {
|
||||
var ptr = new_type(int);
|
||||
ptr^ = 123;
|
||||
|
||||
fmt.println(ptr^);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user