summaryrefslogtreecommitdiff
path: root/example-container/main.zig
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-07-02 21:50:25 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-07-02 21:50:25 +0200
commit898b1c827293c8ae87642be75703c3a0eb99bf22 (patch)
tree97d74f4c41f4eed63e3cf73411b61a4dbce108c1 /example-container/main.zig
parent5e2e4b3d8bb1c685c962ea1f447d7ee6f6babaac (diff)
downloadzig-playground-898b1c827293c8ae87642be75703c3a0eb99bf22.tar.gz
zig-playground-898b1c827293c8ae87642be75703c3a0eb99bf22.zip
container: testing containers struct / file
Diffstat (limited to 'example-container/main.zig')
-rw-r--r--example-container/main.zig21
1 files changed, 21 insertions, 0 deletions
diff --git a/example-container/main.zig b/example-container/main.zig
new file mode 100644
index 0000000..9020adb
--- /dev/null
+++ b/example-container/main.zig
@@ -0,0 +1,21 @@
+const Object = @import("Object.zig");
+
+const Moose = struct {
+ foo: i32,
+
+ fn dump(self: Moose) void {
+ const print = @import("std").debug.print;
+ print("Self = {s}\n", .{@typeName(Moose)});
+ print("FOO = {}\n", .{self.foo});
+ }
+};
+
+pub fn main() void {
+ const o12 = Object.init(12);
+ const o13 = Object.init(13);
+ o12.dump();
+ o13.dump();
+
+ const m = Moose{ .foo = 42 };
+ m.dump();
+}