aboutsummaryrefslogtreecommitdiff
path: root/091_async8.zig
diff options
context:
space:
mode:
authorDave Gauer <dave@ratfactor.com>2021-06-15 10:12:57 -0400
committerDave Gauer <dave@ratfactor.com>2021-06-15 10:12:57 -0400
commitda219d3c40dd2711cb1b144a8fd2f6ca4e86d159 (patch)
tree5e083e01b8d7f46c5a15fd9a927e44f52876cdc6 /091_async8.zig
parent8dd9c1ddcb55b5a28f0dbec844a971daceef062e (diff)
downloadziglings-da219d3c40dd2711cb1b144a8fd2f6ca4e86d159.tar.gz
ziglings-da219d3c40dd2711cb1b144a8fd2f6ca4e86d159.tar.bz2
ziglings-da219d3c40dd2711cb1b144a8fd2f6ca4e86d159.tar.xz
ziglings-da219d3c40dd2711cb1b144a8fd2f6ca4e86d159.zip
added ub exploration to ex090
Diffstat (limited to '091_async8.zig')
-rw-r--r--091_async8.zig20
1 files changed, 20 insertions, 0 deletions
diff --git a/091_async8.zig b/091_async8.zig
new file mode 100644
index 0000000..5f9e19b
--- /dev/null
+++ b/091_async8.zig
@@ -0,0 +1,20 @@
+//
+// Perhaps you have been wondering why we have always called 'suspend'
+// with an expression in the form of an empty block:
+//
+// suspend {}
+//
+// well,
+//
+const print = @import("std").debug.print;
+
+pub fn main() void {
+
+ var my_beef = getBeef(0);
+
+ print("beef? {X}!\n", .{my_beef});
+}
+
+fn getBeef(input: u32) u32 {
+ suspend {}
+}