Printing Lists

matklad.github.io · 2026-08-21 · by Long Nguyen ·generic
To print a comma-separated list, a concise idiom is to optionally print the comma first, before the element:

Printing Lists

To print a comma-separated list, a concise idiom is to optionally print the comma first, before the element:

for (items, 0..) |item, item_index| {
    if (item_index > 0) std.debug.print(", ");
    std.debug.print("{}", .{item});
}

Comments (0)

No comments yet