2016-02-07 16:22:55 -05:00
|
|
|
import simple_print;
|
2014-06-17 00:10:57 -07:00
|
|
|
|
|
|
|
|
|
2015-05-16 12:05:23 -04:00
|
|
|
obj TemplateTest<T,J> {
|
2015-05-09 06:24:56 -04:00
|
|
|
var a: T;
|
|
|
|
|
var b: J;
|
|
|
|
|
fun print(): void {
|
2016-02-07 16:52:01 -05:00
|
|
|
simple_print::print("a: ");
|
|
|
|
|
simple_print::print(a);
|
|
|
|
|
simple_print::print("\n");
|
|
|
|
|
simple_print::print("b: ");
|
|
|
|
|
simple_print::print(b);
|
|
|
|
|
simple_print::print("\n");
|
2014-06-17 00:10:57 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2015-05-09 06:24:56 -04:00
|
|
|
fun main(): int {
|
2014-06-17 00:10:57 -07:00
|
|
|
|
2015-07-04 17:02:51 -04:00
|
|
|
var test: TemplateTest<int, *char>;
|
|
|
|
|
var test2: TemplateTest<*char, *char>;
|
2014-06-17 00:10:57 -07:00
|
|
|
test.a = 24;
|
|
|
|
|
test.b = "Hello World";
|
|
|
|
|
test2.a = "Pi incoming";
|
|
|
|
|
test2.b = "3.14159 - Fooled you! txt pi. C is being weird with floats. Not a Kraken problem. Ahh Well.";
|
|
|
|
|
|
|
|
|
|
test.print();
|
|
|
|
|
test2.print();
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|