4 ms·
Has Hy gotten the let special form working yet? Last I looked, there was a ton of conversation over let not working right/at all, which seems like a big sticki
by paultopia 9y ago
Has Hy gotten the let special form working yet? Last I looked, there was a ton of conversation over let not working right/at all, which seems like a big sticking point.
- JasonFruit 9y agoIIRC, it still uses Python's weird ideas of scope. That is to say, no.
- NoahTheDuke 9y ago> Python's weird ideas of scope I don't know that I'd call them weird, just the natural result of Python's assignment syntax (tho I suspect that you might call that weird as well). Without specific declaration syntax, it would be somewhere between messy and impossible to differentiate between block and function-level scopes. The only thing I could think of would be the inclusion of a new declaration/assignment operator, like `=:`, that would declare the variable as block scoped, but such a change would be backwards incompatible and I don't believe they're going to do that again. What would you like it to look like? How would you want it to work?
- xapata 9y agoMany choices for a new operator would not cause backwards incompatibility, as it'd currently be invalid syntax. However, allowing block scope variables would make the interpreter internals far more complex for dubious benefit.
- lionel- 9y agoThere's nothing weird about closure-based scoping. You find this in Python, R, Javascript, ... It has roots in the lambda calculus.