News Score: Score the News, Sort the News, Rewrite the Headlines

Zig's dot star syntax (value.*)

Maybe I'm the only one, but it always takes my little brain a split second to understand what's happening whenever I see, or have to write, something like value.* = .{...}. If we take a step back, a variable is just a convenient name for an address on the stack. When this function executes: fn isOver9000(power: i64) bool { return power > 9000; } Say, with a power of 593, we could visualize its stack as: power -> ------------- | 593 | ------------- If we changed our function to take a poin...

Read more at openmymind.net

© News Score  score the news, sort the news, rewrite the headlines