develooper Front page | perl.perl6.users | Postings from July 2021

Re: REPL / Linenoise question (backslashes)

Thread Previous | Thread Next
William Michels via perl6-users
July 21, 2021 16:52
Re: REPL / Linenoise question (backslashes)
Message ID:
Dear Brian,

Thank you for your analysis! I am particularly intrigued by your
Jupyter comment:

"Note that this is not the same as the raku 'unspace' -- a backslash
followed by a newline will be replaced with a newline before the code
is executed. To create an unspace at the end of the line, you can use
two backslashes."

Sorry for my continuing confusion, but I don't see any use-case for an
"unspace" at the end of a line in the Raku REPL, or the Jupyter
kernel. Would this be useful for something like POD documentation? So
you can enter text, enter an "unspace"-followed-by-newline, and have
the REPL/Jupyter_kernel know not to break the text into chunks
(linewise)? And if you need to create an "unspace" *within* a line of
code in the Jupyter kernel, does it also have to be two consecutive

Two final thoughts/comments:

1. I'm using Linenoise instead of Readline on my (older) MacOS system,
in part because there were issues hooking into the MacOS Readline
library. Does one (either Linenoise or Readline) handle end-of-line
backslashes better?

2. I put up some REPL code from R, Python and Ruby (irb). They seem to
fall into two categories: those that accept pasted multi-line code but
don't tolerate backslashes (R), and those that don't accept pasted
multi-line code but do tolerate backslashes (Python, Ruby).
Personally, I like R's handling better (here I'm assuming different
OSes can handle copy/pasting equally well).

What say everyone else?

Best Regards, Bill.

PS I should note that the R-Foundation releases a GUI for each
platform flavor that they release. Also there's a Vim-R plugin for
interconnectivity, for those into that sort of thing:

On Tue, Jul 20, 2021 at 3:21 AM Brian Duggan <> wrote:
> On Monday, July 19, William Michels via perl6-users wrote:
> > I don't see how the Raku REPL knows how to cycle from taking input at its
> > prompt and moving to the read/evaluate step.
> This currently happens when the parser throws one of these exceptions:
>   X::Syntax::Missing
>   X::Comp::FailGoal
>   see
> I think this is less than awesome in some cases, which is why in
> the Jupyter command line I explicitly supported using a backslash
> to indicate that there is more input --
> Brian

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About