Re:Crabtime: Zig's Comptime in Rust
by paulddraper on Sunday March 23, 2025 @04:00PM
(#43455445)
Many of those are setting properties, not variables.
A variable reference can lookup properties on the global object, or other objects with ‘with’
> Null means not a thing, undefined means there is not even the notion of the thing.
If only "undefined" was consistently the same as lack of variable / collection entry, it would be understandable. But as things are, {x: 1, y: undefined} is not the same as {x: 1} in many ways - indeed, so much so that TS distinguishes between these two cases in its type system.
A lot of the fixes are just removing the old broken way of doing things.
I'd still probably change 'for x of ...' to implicitly be 'const x' and require let if you are doing shenanigans with changing the values.
I am surprisingly ok with null and undefined. Null means not a thing, undefined means there is not even the notion of the thing.
I'm pretty sure there are more than three ways to declare a variable.
at least