3 ms·
> less confusing way to do variable shadowing How is this less confusing? := vs = will either push a new variable on top of a stack of identically named variab
by bjarneh 4y ago
> less confusing way to do variable shadowing
How is this less confusing? := vs = will either push a new variable on top of a stack of identically named variables, or change the content of the top element on that stack? Why would anyone want any of that? Shadow variables are usually associated with hard-to-find-bugs, (i.e. forgetting that there is already a variable named 'xyz' in the current scope) not some great feature we want more of..
- abrax3141 4y agoFWIW I think the author is trying to simulate let binding (or lambda binding, or both). But since there’s no syntactic scope you have to do your own stack management. Ugly and clunky. But this isn’t really a language intended to be used. It’s sort of like lisp assembly.