You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be best to provide an example. Have you used python's interactive shell before? I will show a few examples and then tie that back to this issue.
Python interactive shell examples:
>>> x = 17
>>> x = x + 25
>>> print(x)
42
>>> for n in range(0, 10):
... print(n)
...
0
1
2
3
4
5
6
7
8
9
>>> def my_print(str):
... print(str)
...
>>> my_print('interactive shell')
interactive shell
>>>[Ctrl+C]
KeyboardInterrupt
>>>[Ctrl+D]
stangles-MBP:~ stangles$
The above snippet demonstrates a few things:
Variables in scope are preserved across commands. For the bf-interpreter, this would mean preserving "the tape" across input until the interactive shell session is ended.
Multi-line commands (such as function declarations and loops) are handled correctly
An interrupt halts the currently running command but keeps the interpreter running
An EOF input is required to exit the interpreter
These are the important pieces of functionality that I think the interactive shell feature should have. Let me know if you need any more details!
Akin to python's interactive shell, allow for users to write and run bf programs in an interactive shell.