top | item 46594118 (no title) phcreery | 1 month ago Agreed, using `var` keyword for something that is non-var-ying (aka immutable) is not very intuitive. discuss order hn newest ekipan|1 month ago Mutability is distinct from variability. In Javascript only because it's a pretty widely known syntax: const f = (x) => { const y = x + 1; return y + 1; } y is an immutable variable. In f(3), y is 4, and in f(7), y is 8.I've only glanced at this Zen-C thing but I presume it's the same story. Deanoumean|1 month ago "immutable variable" is an oxymoron. Just because Javascript did it does not mean every new language has to do it the same way. load replies (4)
ekipan|1 month ago Mutability is distinct from variability. In Javascript only because it's a pretty widely known syntax: const f = (x) => { const y = x + 1; return y + 1; } y is an immutable variable. In f(3), y is 4, and in f(7), y is 8.I've only glanced at this Zen-C thing but I presume it's the same story. Deanoumean|1 month ago "immutable variable" is an oxymoron. Just because Javascript did it does not mean every new language has to do it the same way. load replies (4)
Deanoumean|1 month ago "immutable variable" is an oxymoron. Just because Javascript did it does not mean every new language has to do it the same way. load replies (4)
ekipan|1 month ago
I've only glanced at this Zen-C thing but I presume it's the same story.
Deanoumean|1 month ago