torch / trepl

A pure Lua-based, lightweight REPL for Torch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

option to ignore local?

jonberliner opened this issue · comments

when debugging a script, often I want to copy blocks of code and run interactively in the trepl. However, I can't run in the repl via copy+paste, because things declared local in a script cannot see each other when run in the repl. Is there, or is there any interest, in adding a flag to ignore local so script blocks can be tested in the repl?

it's an interesting proposition, and i've definitely had to remove local when copy-pasting code in the interpreter. if facilitated via a separate flag, seems like a useful addition.

Another perspective is to do a multiline paste, so that local scopes are not lost with every line. IPython does this nicely with %paste and %cpaste. Having a similar functionality in trepl would be clutch for many workflows. I tried this with iTorch 4.1.1 but couldn't get it to work.