[Snek] [PATCH v3] snekserver: allow network connections to a snigle Snek instance

Misha Gusarov dottedmag at dottedmag.net
Sun May 17 09:10:10 PDT 2020


Hey,

On 19 Apr 2020, at 12:24, Misha Gusarov wrote:

> OK. I'll send implementation of reset/eeprom soon too.

I tried to, and found out I don't understand the lifetime of Snek 
top-level, and
got it wrong for ev3 port too.

Let me see how I see it should work, and please tell me where it should 
be corrected.

* ./snek-ev3, no stored program

    -> REPL

* ./snek-ev3, a stored program exists

    -> Run the program. SIGINT should exit into REPL

* ./snek-ev3 --file foo.py, no stored program

    -> Evaluate foo.py, exit into REPL

* ./snek-ev3 --file foo.py, a stored program exists

    -> Evaluate foo.py, then run stored program. SIGINT should exit into 
REPL

* ./snek-ev3 foo.py, stored program irrelevant

    -> Run foo.py, SIGINT should exit Snek.

* ./snek-ev3 --file foo.py prog.py, stored program irrelevant

    -> Evaluate foo.py, then run foo.py. SIGINT should exit Snek.

Now, how should reset() interact with these 6 modes?

Are all these modes relevant, maybe some of them are completely useless?

Best,
Misha.


More information about the Snek mailing list