Re:A Lisp that runs Python (2016)
by JasonFruit on Friday October 13, 2017 @02:04PM
(#15467936)
IIRC, it still uses Python's weird ideas of scope. That is to say, no.
[ Parent
| on HN ]
Re:A Lisp that runs Python (2016)
by NoahTheDuke on Friday October 13, 2017 @03:13PM
(#15468491)
> 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?
Many 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.