keith-packard / snek

Snek programming language for tiny systems
GNU General Public License v3.0
294 stars 30 forks source link

underscore variable? #72

Closed incanus closed 1 year ago

incanus commented 1 year ago

Have you considered adding the underscore (_) variable to the interactive REPL? Per the main Python docs:

Separately, the interactive interpreter makes the result of the last evaluation available in the variable _. (It is stored in the builtins module, alongside built-in functions like print.)

Notably, this never gets set to None.

keith-packard commented 1 year ago

Sure, this seems easy enough. I had to compress some other code a bit to make room, but that led to a new helper function, snek_id_store, which replaced a repeated pattern in the code and so made a nice simplification and cleanup.