From ec654626dddbf0caf8c00b7a0bfed579df8ce669 Mon Sep 17 00:00:00 2001 From: Robert Voogdgeert Date: Fri, 3 Nov 2023 11:55:39 +0000 Subject: [PATCH] Update exercises/028_defer2.zig --- exercises/028_defer2.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/028_defer2.zig b/exercises/028_defer2.zig index 35c1326..322a06b 100644 --- a/exercises/028_defer2.zig +++ b/exercises/028_defer2.zig @@ -15,6 +15,10 @@ pub fn main() void { // This function is _supposed_ to print an animal name in parentheses // like "(Goat) ", but we somehow need to print the end parenthesis // even though this function can return in four different places! + +// In zigling 027 runLater() is said to run when the block, within which runLater() is defined, has finished. +// In zigling 028 the block seems to be the function printAnimal, within which the to be defered print function is formulated, but the defer runs after every if{} block; +// Shoud the explantion in the comments of 027 be reformulated? fn printAnimal(animal: u8) void { std.debug.print("(", .{});