evhub / coconut

Simple, elegant, Pythonic functional programming.
http://coconut-lang.org
Apache License 2.0
4.05k stars 120 forks source link

`where` should use temporary variable names #784

Closed evhub closed 1 year ago

evhub commented 1 year ago

Will make the variables still usable in lambdas (unlike using del) while making them not usable outside of the scope of the where.

evhub commented 1 year ago

The problem with this is that you need to first figure out all the assign names, then go back and replace them all. Which is doable, but a bit tricky. Strategy will probably be to store all the assign names in a parsing context, then regex replace them when handling the where.