mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
19 lines
288 B
Plaintext
19 lines
288 B
Plaintext
module add;
|
|
import std;
|
|
struct Foo(Printable)
|
|
{
|
|
int a;
|
|
}
|
|
|
|
fn usz! Foo.to_format(&self, Formatter* f) @dynamic
|
|
{
|
|
return f.printf("Foo[%d]", self.a);
|
|
}
|
|
|
|
fn int add(int a, int b) @export("adder")
|
|
{
|
|
io::printn("In adder");
|
|
Foo x = { a };
|
|
io::printfn("Print foo: %s", x);
|
|
return a + b;
|
|
} |