Docstrings and triple-quoted strings in Atom/Juno


#1

I am often using “shift-enter” to read parts of a source file to the REPL. For example:

"""
A very helpful function giving 12
"""
f() = 12

When I do so the following happens:

I actually do not need to have the doctoring itself available in the REPL’s help> mode. Apart from the inconvenience of pressing shift-enter at least 3 time, I am more worried about executing some code which is in the docstring itself. I tend to “circumvent” this issue by not documenting my code.

Probably related is a more general issue about triple-quoted strings, e.g. when using RCall

using RCall

R"42"

R"""
42
"""

The sigle quoted syntax is understood by the REPL, the triple quoted not.


#2

The solution is to highlight the entire block of code and then press shift+enter.


#3

Ok - this would be a work-around. Still a bit inconvenient because one would have to first select some code and then send it to the REPL.

However, for loops, function definition etc. are also identified as such a send in to the REPL in one go. Couldn’t this behavior also adapted to triple quoted strings?