I've had this neat idea of creating a REPL mode for DS9. The idea is that, instead of writing something like this-
julia> DS9.connect()
"7f000001:59505"
julia> DS9.set("frame new")
julia> X = randn(512, 512);
julia> DS9.set(X)
you could do this-
julia>|
DS9> connect
"7f000001:59505"
DS9> set frame new
DS9> set X
Creating custom REPL modes can be done with something like REPLMaker, so the questions would just be
- How do we want to interface with the custom mode (i.e. what character to switch over (I used
|), what color is the prompt, is there additional information we want to show?)
- What commands can be used in this interface (I'm pretty sure we can just use macros and allow use of any commands, but it makes most sense to use this for
connect, set, and maybe some others). Another idea I had is that the command line defaults to issuing set commands, that is, running DS9> frame new would just call set("frame new") with some special cases like connect would call the DS9.connect method.
If this sounds interesting, I'd like to slowly incorporate this into a PR. It is mostly just expression parsing, so we could create a macro system like ds9"frame new" which would include all the logic we need for the REPL.
I've had this neat idea of creating a REPL mode for DS9. The idea is that, instead of writing something like this-
you could do this-
Creating custom REPL modes can be done with something like REPLMaker, so the questions would just be
|), what color is the prompt, is there additional information we want to show?)connect,set, and maybe some others). Another idea I had is that the command line defaults to issuingsetcommands, that is, runningDS9> frame newwould just callset("frame new")with some special cases likeconnectwould call theDS9.connectmethod.If this sounds interesting, I'd like to slowly incorporate this into a PR. It is mostly just expression parsing, so we could create a macro system like
ds9"frame new"which would include all the logic we need for the REPL.